Xcode Mark is similar to emacs

Is it possible to mark a line in Xcode similar to the "mark" functionality in emacs? Also is there a shortcut that I can use to go to the line number? My source code is getting long and difficult to navigate.

+6
xcode
source share
3 answers

Yes; if you put the text in the line you want to tag and select Edit > Add to Bookmarks (or ⌘D), you can bookmark this line in your project. You can then access these bookmarks from the Bookmarks item in the Groups & Files panel.

To go to a specific line, select Edit > Go to Line... in the menu (or ⌘L) and enter the number of the line you want to go to.

I also recommend that you use the #pragma mark to help you navigate through the source files. It accepts the format:

 #pragma mark <Label> 

And it will appear in the pop-up menu of functions at the top of the source file; this makes it easy to navigate your code by grouping common functions, improving the overall structure and readability of your code.

+13
source share

You can also use the key sequence "mark", control-@ or control-space, then you can use Delete to Mark (control-W), Select to Mark (control-X control-M) and Swap With Mark (control- X control-X). These emacs type key bindings are supported in all Cocoa text representations on Mac OS X, and you can customize the key bindings for Xcode in Xcode> Preferences> Key Bindings> Text Key Bindings.

+8
source share

You can mark a single line in a file: in a .emacs file

 (global-set-key "\C-cb" 'bookmark-map) 

installs it, therefore:

control-c bm sets a bookmark (you can name it whatever you want)

control-c bj goes to bookmark (it asks which bookmark you want)

Also:

 (global-set-key [f1] 'goto-line) 

sets F1 to query the line number and go to this file

+1
source share

All Articles