Reputation: 15241
XCode is a little weak in the way that it obliges you to format code, and the restrictions it places on you. I'm thinking of things such as select a block of code and use tab to reposition the whole block, which is very useful for cleaning up indenting, amongst other things.
I realise that I can use an external editor (such as Sublime Text 2, which is superb and my daily editor) to edit code, but I'm wondering if there are any plugins or tools which exist out there which integrate into xcode to improve this development experience.
What kind of extensions exist for xcode, or if there aren't any, are there any lesser-known features which assist in improving this?
Upvotes: 3
Views: 829
Reputation: 3092
Though the first answer is a great one (learned a lot from it), I wanted to add a little hint that helps me a lot when pasting codesnippets. A lot of times xCode copies indentation in a way I don't like and then I have to reindent the whole snippet.
What I started to do is jump to the first char in line (ctrl + a | cmd + ArrowLeft) and either paste the code immediatly, or indent by one or two before pasting, dependend if I'm in a function, loop etc.
Upvotes: 1
Reputation: 26375
It's hard to give you an answer, as we don't know what features you use elsewhere that you think are missing in Xcode. For example, you can move a block of code in or out by pressing Cmd-{
or Cmd-}
. Or you can "fix" the indenting by using ctrl-i
as jrturton pointed out above. All of the emacs keybindings work. In fact, you should look over the key bindings in the prefs to see what other things are possible. Some of my favorites are:
1) Select a word and hit Cmd-E
to make it the search term. Then Cmd-G
to find the next instance.
2) F6
to step over in the debugger, F7
to step in and F8
to step out
3) As much as I hate command lines, gdb
has a number of useful commands for calling methods while stopped at a breakpoint. You can call any function or C++ or Objective-C method using the call
command. (Type help call
at the gdb prompt to learn more.)
4) If your index is up-to-date, you should be able to Cmd-click on a symbol to go to it's definition, or option-Click to see its documentation.
Are those the sorts of things you're looking for? If not, please give examples of what you want. As far as I know there is no plug-in mechanism in Xcode 4, so no extensions exist.
Upvotes: 3