Hacker News new | ask | show | jobs
by interpol_p 3879 days ago
I haven't used VS in many years, but I like what you describe. I don't know if this will be helpful, but these are my alternatives in Xcode:

> For instance if you want to do a find/replace in VS you can double click on a word do Ctrl+H and the word you selected populates the search box.

Your workflow sounds nicer than Xcode's here. While I don't often use find+replace, I do use project level find constantly. My muscle memory shortcut for this is:

Cmd+C, Cmd+Shift+F, Cmd+V, Return

I'm pretty sure I use this hundreds of times a day. Especially when analysing unfamiliar code to trace its execution paths.

> Ctrl+F2 code bookmarks

These sound really cool. A bit like numbered unit groups in Starcraft.

The only similar mechanism in Xcode is quick open. Cmd+Shift+O then start fuzzy-typing the name of a file, method or declaration and hit return to jump to it in the editor (option+return for assistant editor). I have actually changed my quick open shortcut to Cmd+Shift+D because it's easier to trigger one-handed.

> In VS you have a stack of source code windows that you can easily move about via Ctrl+W+n

Unfortunately, while a stack of source locations is maintained in Xcode, you can't jump to a direct location within the stack.

What I do here is use Ctrl+Cmd+Left and Ctrl+Cmd+Right to navigate back and forward in the history stack for an editor window. So, for example, if you Cmd+Click a symbol to jump to its declaration, you can press Ctrl+Cmd+Left to go back.

The one thing I like about Xcode's version of this is that it keeps track of source locations rather than files or windows. So you actually navigate back/forward within the same file (if you were jumping around within the file) as well as between files.

1 comments

You can use Cmd+E to directly insert the selected text into the search buffer, so for the Project-Wide search you wind up with the shorter sequence:

Cmd+E, Cmd+Shift+F, Return

This sequence seems to work in many other apps, I don't know if it's a system command or just a common convention.

Thanks! That's really useful to know.