使 Xcode 更突出所选符号
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7333509/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Make Xcode highlight selected symbol more
提问by Tomas Andrle
Xcode underlines all occurrences of a symbol that the cursor is on. However, the underline doesn't exactly "pop out" in the source code. Is it possible to make Xcode highlight the background color of the symbol, like Eclipse does it? I can't find anything in the Preferences panel.
Xcode 会在光标所在的所有符号处加下划线。但是,下划线在源代码中并没有完全“弹出”。是否可以像 Eclipse 那样让 Xcode 突出显示符号的背景颜色?我在“首选项”面板中找不到任何内容。
Xcode:
代码:
Eclipse:
蚀:
回答by Vivian_S.O.
XCode already has this feature but there's a delay on it after you single clickon the text you want to highlight. You can set the delay to 0 seconds.
XCode 已经具有此功能,但在您单击要突出显示的文本后会出现延迟。您可以将延迟设置为 0 秒。
XCode > Preferences > TextEditing > HighlightInstancesOfSelected and set Delay to 0s
XCode > Preferences > TextEditing > HighlightInstancesOfSelected 并将延迟设置为 0s
This works but I wasn't able to change the color of it. It is a pale blue color and a bit hard to see.
这有效,但我无法更改它的颜色。它是一种淡蓝色,有点难以看到。
回答by Balazs Vadnai
Search for AutoHighlightSymbol
in Alcatraz(Xcode's package manager). It will do exactly what you want.
搜索AutoHighlightSymbol
在恶魔岛(Xcode的包管理器)。它会做你想要的。
After you have the plugin installed, select Editor > Edit Highlight Color. This is transparent by default, so you have to pick one that suits your color theme best.
安装插件后,选择编辑器 > 编辑高光颜色。默认情况下这是透明的,因此您必须选择最适合您的颜色主题的颜色。
EDIT: Now that Alcatraz is gone, you're going to have to install the plugin manually. Download from their GitHub, build the project and restart Xcode - which needs to be unsigned for being able to load 3rd party bundles. More info on this here.
编辑:现在 Alcatraz 消失了,你将不得不手动安装插件。从他们的 GitHub下载,构建项目并重新启动 Xcode - 需要未签名才能加载 3rd 方包。更多信息在这里。
回答by Zev Eisenberg
This is not exactly what you are looking for, but you may want to check out the PolychromaticXcode plugin (most easily installed via Alcatraz). It gives every symbol a unique color, which is used consistently throughout. So every instance of myVar
might be blue, and every instance of myOtherVar
might be red.
这并不完全是您要找的东西,但您可能想查看多色Xcode 插件(最容易通过Alcatraz安装)。它为每个符号赋予了独特的颜色,并贯穿始终。所以每个 的实例myVar
可能是蓝色的,每个 的实例myOtherVar
可能是红色的。
回答by Zev Eisenberg
This plugin does what you want. It's available through Alcatraz:
这个插件做你想做的。它可以通过Alcatraz 获得:
回答by Mr.Fingers
community!
社区!
I have the same trouble and found something like that. (where the "currencyId" i select,another its work of plugin)
我有同样的麻烦,发现了类似的东西。(我选择的“currencyId”,另一个它的插件工作)
Its, i guess, do the same thing like [Cmd+E, Cmd+Fand Cmd+Gcombo] But its easier,you must only select word in your code.
它,我猜,做同样的事情 [ Cmd+E,Cmd+F和Cmd+G组合] 但它更容易,你必须只在你的代码中选择单词。
How to installit to Your XCode:
如何将其安装到您的 XCode:
- Launch XCode
- On top menu select Window->Package Manager
- In
search type "highlightSelectedString"
- Install it!
?
Profit
- 启动 XCode
- 在顶部菜单上选择 Window->Package Manager
- 在搜索类型“ highlightSelectedString”
- 安装它!
?
利润
And also you can change colorof highlighting!!!
而且您还可以更改突出显示的颜色!!!
go to Edit->Set Highlight color
Choose your color
去编辑->设置高光颜色
选择你的颜色
回答by Emerald Weapon
I don't know if this is still relevant, but when you hover with the cursor on a symbol a small selection menu shows up and you can select "Edit All in Scope". This highlights all such symbols in a much more visible way. As the name suggests, this functionality is meant for a higher purpose, but I think it comes in handy even just for highlighting. I don't know if this feature was available before Xcode 5.
我不知道这是否仍然相关,但是当您将光标悬停在符号上时,会出现一个小选择菜单,您可以选择“编辑范围内的所有内容”。这以更明显的方式突出显示所有此类符号。顾名思义,这个功能是为了更高的目的,但我认为即使只是为了突出显示它也派上用场。我不知道这个功能在 Xcode 5 之前是否可用。
回答by raj
ok go to xcode select preferences pop over will come select fonts and colors down u can see 4 buttons,with 1 having name selection,click and choose any deep color
好的,转到 xcode 选择首选项弹出将选择字体和颜色向下你可以看到 4 个按钮,其中 1 个具有名称选择,单击并选择任何深色