Is it possible to bookmark a line in XCode similar to the "mark" functionality in emacs? Also is there a shortcut used I can use to jump to a line number? My source code is becoming long and hard to navigate.
Yes; if you place the text caret on the line that you want to bookmark and select Edit > Add to Bookmarks
(or ⌘D) you can add that line to the bookmarks in your project. You can then access these bookmarks from the Bookmarks
item in the Groups & Files
pane.
To go to a certain line, choose Edit > Go to Line...
from the menu (or ⌘L), and type in the line number you want to navigate to.
I would also recommend that you use the #pragma mark
directive to help you navigate around in source files. It takes the format:
#pragma mark <Label>
And will show up in the functions popup menu at the top of your source file; it makes it much easier to navigate around your code by grouping together common functions, improving the overall structure and readability of your code.
You can bookmark an individual line in a file: in your .emacs file
(global-set-key "\C-cb" 'bookmark-map)
sets it up, so:
control-c b m sets a bookmark (you can name it whatever you want.)
control-c b j jumps to a bookmark (it asks which bookmark you want)
Also:
(global-set-key [f1] 'goto-line)
sets F1 to ask for a line number and jump to that file
You can also use the "mark" key sequence, 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-like key bindings are supported in all Cocoa text views in Mac OS X, and you can customize the keybindings for Xcode in Xcode > Preferences > Key Bindings > Text Key Bindings.