Xcode : shortcut for highlight feature - xcode

I recently started using Xcode for developing. It's pretty neat. By accident I happened to see one of its features. The feature only highlights the block of code I am currently working on. Other codes are covered with light grey. I do not know how to get that effect again. Can anybody help? Thanks!

You probably hovered your mouse over the line number bar like this:

You may be referring to the "focus ribbon" on the left side between the code and line numbers.
Refer to: https://developer.apple.com/library/mac/#documentation/ToolsLanguages/Conceptual/Xcode4UserGuide/Editing/Editing.html
(Figure 3-10)

This is called Code Folding Focus.
If you want to turn it ON or OFF as you please, do as follows in Xcode/Preferences:
Then, assign the key of your fits.

Related

Clojure Calva in VisualStudio Code loses syntax colors when switching from one window to the other

When I change from one window to the other, the one I leave loses the colors of the parentheses and brackets and everything is left in white letters.
I have to go back to the previous window to get colors back. I recently updated to version 1.48.1, but it started to happen with the previous update. Any help is welcome. Thanks!!
I am a Calva maintainer. This is a bug that should be fixed. Here's the issue:
https://github.com/BetterThanTomorrow/calva/issues/761
I provided some more context there.

VS2012 Text Editor Width

Is it possible to change the width of the text editor in VS2012 - I've got a fairly wide screen and use fairly small text so I end up with a lot wasted real-estate in the middle of my screen.
I don't want to turn off word wrap - I just want the wrap to start further right on the line. If that makes sense!?
You can set this with HTML in Visual Studio 2012 but there is no global setting and it's missing in quite a few languages.
You can just put another "dummy" window next to the one you are writing in, so the actual editor window will be smaller. You can put it on the left if you want to pan the text to the right, and to the right if you want to shorten the lines.
I actually found the answer elsewhere; VS doesn't appear to provide this functionality but Resharper does. Resharper -> Options -> Code Editing -> C# -> Formatting Style -> Line Breaks and Wrapping -> Right margin (columns)
I put mine to 200 which fixed the issue
I know that this is not what you are looking for, but I believe it solves the same problem. I too have a fairly large screen and try to make use of it as optimally as possible.
I hate tabbing between code or design tabs and try to avoid that as much as possible.
VS has a feature that permits the user to create Horizontal or Vertical Tab groups and ever since I have started using it, I have found it very helpful. These options are present in the context menu by right clicking the tab or in the VS Window Menu (Menus are seen only if the tab groups feature is not active).
I have created a screenshot with Vertical Tab Groups created as shown below. In this example, I have a overview of both the designer and the code view at the same time.
We can use tab groups whenever there is a dependency such as comparing code, redesigning a module, etc. I know it takes a little time to get used to this feature but try it out and see :)

Is there any way to scroll beyond the last line in xcode?

I ask if there is any way to scroll beyond the last line in xcode, because I always end up pressing a lot of enters to the end of my files, so that I don't have to always type my code at the bottom of my window.
I have skimmed through the properties panel of XCode, and had a look at this forum. So far the answer looks negative, but I kept my hopes up. :)
Any ideas for tricking XCode to scroll beyond the last line? (I have XCode 4.5.2)
There is now a plugin for that !
Have a look at SCXcodeEditorInset !
Dont think there is a way to do this but if you are trying to edit the buttom of the code while having it near the top of your display, you can click the middle view button in xcode to bring up the console/watcher and then drag that up to the desirable spot. This does decrease the overall space of your editor but can sometimes be useful if you prefer this or just need to do that temporarily
What I do is, When you finished typing at the bottom, before you go to top, type some unnecessary code "asdf" as error then go where you want. you can come back clicking on top right red error panel.

Cocoa: simple tabs

Does any one know how to create a tab bar like this:
I mean that simple tab, without rounded corners or texture, with "Untitled" string
Is this a standard control? Or is there an open source library for such tabs? I think I saw it in a open source editor or something but totally forgot which one.
There are no doubt other ways to do this, but one I've used often in the past is PSMTabBarControl. It's been around for a while, and forked a few times. The version at https://github.com/dorianj/PSMTabBarControl can be used with Xcode 4.
Documentation can be found http://www.positivespinmedia.com/dev/PSMTabBarControl.html.

Can I add my own code snippets to xcode 4?

It'd be really handy to have collection KVC accessor snippets in xcode, as they're a pain to do by hand. Has anyone who's been using 4 for a while worked out how to add new ones?
(...we're allowed to talk about it now, right?)
Yes, it's quite easy - you just highlight text you want to use as a snippet and drag it into the snippets area (dragging selected text can be difficult, I find it works better if you drag from the left edge of the editor). It brings up a dialog box asking you to name it.
Also, you can have custom parameters in snippets - if you put the text <#paramName#> anywhere in the code you are dragging, when you use the snippet it will come up as a replaceable parameter that you can tab between just like in the official Snippets.
Also make sure to set a completion prefix, which makes it shorter to activate the snippet as you are typing. The nice thing about using Snippets over other solutions like global system text expanders, is that snippets can also be limited to being valid in a certain area of code - so for example a snippet that filled out a string formatting line can be marked as valid only within a block, not outside a method. That way the completion prefix only hits in areas where it's valid to use.
You can edit a snippet by clicking once on it, a box will come up with the snippet text and some other snippet settings you can edit.
A tip to help you drag the code every time, select text then click + hold (do not move mouse) until mouse pointer changes from "I" to pointer. You'll then be able to drag the selected text to the Code Snippet Library.
Drag the highlighted code to the Snippet library. (It can be stubborn and not want to drag. Holding the mouse button down for a moment before dragging seems to help.)
You can use Snippets to manage code snippets in Xcode. Check out this demo http://www.youtube.com/watch?v=il4kE4diy0k
Simply select the code, the press ALT key and drag it into the code snippets library and rename it there, Make sure to press the ALT key, other than this you won'n be able to drag it.

Resources