Xcode Editor – Kinda Sucks

Scince my harddrive died a month ago I haven’t been able to find the mac version of emacs I installed 2 years ago and loved ever since. So lately I’ve been having to use Xcode a lot more. Sure there are a lot of nice things about it that supposedly make building projects and debugging more simple but I’m not a fan at all of the editor. First, when I’m just opening files from my finder they all open up new windows. You have to drag each file individually (not as a group) into an already open window to get them all in the same editor. Then its difficult to switch back and forth between files. Until today I had to reach for the mouse and click the next arrow! What?! It sounds lame but its really a no brainer that any good code editor should have a quick way to switch back and forth between open files, like Ctrl-x b in emacs. Anyway, I figured Xcode has to have this feature so I did some googling. There’s very little info on it, I found a clue on this guy’s blog.

Aparently you can use Ctrl-1, and then use the arrows keys to choose which file you want. That’s a pretty crappy shortcut if you ask me. You need to use both hands and each has to remove itself from the home row. Luckily a submitter to that blog added

You can now add command keys to any menu item in any application that currently lacks them.

System Preferences > Keyboard & Mouse > Keyboard Shortcuts

Scroll to the bottom of the list and you’ll see “Application Keyboard Shortcuts”. Click the + sign to add a new one.

That got me excited but the process of doing this wasn’t intuitive. It asks for a Menu Title of the shortcut you’re making.

Adding a Keyboard Shortcut to Xcode

What? What’s that? I found out here. Apparently you have to use the exact command (including the … if its there) listed in the file menu of the app you want the shortcut for. Unfortunately at this point you can’t open your app because it has to be closed during the process or the shortcutting won’t work. It’d be nice if they put a nice pull down menu of your options here. But it isn’t there and either is the menu option in Xcode to switch between files. I tried the command “Go Back” as that’s what pops up when I hover my mouse over the button I want to short cut. I even tried a few cuss words but none of it worked. Xcode really needs to fix both how files are added to the editor, shortcuts for moving between files, and while they’re at it it’d be great to throw in the function hiding options in the gutter that are really handy in visual studio :).

Like I said I’m somewhat new to Xcode so if anyone knows how to fix any of these problems with some settings, or hacks that I haven’t discovered please leave a comment.


  1. Derek Johnson said:

    On switching between files. I just leave everything in separate windows and use Command-` to switch windows. I like it this way. I can have all the files in windows sized just right and cycle through them when I need to.

  2. Tom said:

    Hi Dave,

    Is what you are looking for the ‘next file’ and ‘previous file’ options in the ‘view’ menu?

    You can change the key bindings to what ever you want so your hands won’t need to leave the home keys,


  3. Frank said:

    I am in total agreement here! I’m just starting to use Xcode because I want to develop apps for the iPhone. Where the heck is Ctrl-Tab like in Visual Studio? The point of this feature is to be able to have a collection of source files that you have open and want to quickly switch between them. The key point is that this collection is a stack. With one hand, I can navigate an entire project. Once I get to typing, I don’t want to touch the mouse, it’s a horrible break in the mental coding process (for me anyways).

    Ctrl-~ would work if all the files were opened as tabs instead of separate windows. I don’t want to have to resize all the windows just right, what a time waster. Not to mention I have upwards of 10-20 files open sometimes and this becomes a very unmanageable thing at this scale.

  4. Alex Kac said:

    You change the keybindings for XCode within XCode. You can change almost anything.

  5. Kae said:

    I totally agree with you. Switching between files in Xcode is not good at all. I prefer the way it is done in Visual Studio, where you switch between the files in the most recent order. I don’t want to cycle through 20 files to get to the previous one.
    I have allways avoided editors that doesn’t have this.
    They have it right with the application switcher (cmd+tab) so why not in their editors ? Don’t the Apple developers talk together and find a common strategy for these things ?
    That has allways been a dissapointment since I switched to Mac, all applications have their own way of switching between files (among other things), many of them with cmd+alt+ctrl+godKnowsWhat+arrows shortcuts. No natural movements at all, breaking my fingers here.

  6. z said:

    Kae, no, they do not get together and discuss these things. Compare the difference in MS and apple universes: windows developers strive to make their apps behave in canonical windows ways, whereas apple is all about star designers doing things in different, exciting, new ways. It is all about reinventing the wheel.

  7. Ted said:

    It’s not just visual studio. Every other development IDE (Eclipse, Netbeans, etc) let’s you cycle through source files in stack order with something like ctrl-tab. Ctrl-‘ is useless in Xcode – why in earth would it ever be desirable to cycle through source windows in round-robin order? When is that
    going to come in handy? The typical use case is
    switching back and forth between two or three source files while having 10 or 20 source windows open (and for any non-toy project you will typically have 10 or 20 source files open).
    Xcode is 10 years behind the other dev environments in usability and productivity.

  8. Joshua said:

    I am also a visual studio developer that started using x-code recently for iphone apps.
    I just found out digging in this post that there is a key combination for moving page forward and backwards which is pretty close to the heavenly vs ctrl-tab. Not the same behavior but not so bad either.
    Anyway, i agree usability in VS is far better in many aspects than x-code. I hope apple will improve

  9. Kevin said:

    I am pretty new to Xcode and am finding it VERY annoying. I want tabs to get to my files. I want to be able to move my files and have them appear in the new directory AND keep SVN in sync. Does Apple hate SVN since they did not invent it? Why do you just have to leave the darn files where Xcode created them? Why does HOME = top of file and not start of line?

    Why when you read most Xcode websites they tell you everything is perfect just because Apple did it that way? There are plenty of issues with various IDEs in Windows but at least we fess up to it and don’t paint everything rosy. I find Apple people to be liars in a big cult. Apple does a lot of cool stuff but not everything they do is cool, get over it.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s