A Journey Through Code Editors

By default I’m a Vim (MacVim) guy. I made the jump to MacVim and the keybindings have stuck with me, so much so that any time I’m typing anything I end up with :w at the end of lines. But it always feels like it’s missing something.

Update May 16, 2014: I’ve put a bunch of time in to a WordPress specific Vim configuration. I’d love if you’d check it out.

Adding to MacVim

I tried many times to get in to Vim. I started with a few basic movement commands so I could get around on my server. But it always felt way more laboured than TextMate 1 (you know back when TextMate was cutting edge).

Then Janus came out and I installed it. MacVim became something I could use regularly, and I did. MacVim was my full time editor for a year. Long enough that any new editor needs to have fairly solid Vim bindings for me to ever look at it.

Then I took a full-time contract and heard more than once:

I think that any programmer not using an IDE isn’t being as efficient as possible.

We could debate the merits of that statement forever, the fact is when it comes from your boss in sly reference to your code, you decide whether you keep getting comments or you make a change.

Enter an IDE

My next stop was PHPstorm (a PHP tailored solution the same as RubyMine). It’s a proper full fledged IDE. It will do code completion across your project, or any directories you add as libraries. A single click can take you in to the original declaration of a function. It has some pretty good Vim bindings.

PHPstorm also deals really well with LESS files. Include files at the top of the main stylesheet to get completion on variables and classes. It’s way faster than not having it.

Yes you’re missing some of the more powerful things like grabbing all the text inside quotes with ci". That’s the big one that gets me all the time. If we’re talking about an editor that’s got Vim keybindings PHPstorm and Sublime Text 2 are the best, but still have their own little quirks, which of course are different quirks.

The big drawback to PHPstorm is, it’s slow. Yeah I shouldn’t be surprised that a Java based IDE is slow, and I’m not but it’s frustrating. Java apps are often pretty ugly as well. Sure they are straddling platforms, so making it exactly Mac like would make it really terrible on Windows, and of course the reverse also applies. I like my pretty Mac apps though. Like Coda 2, which looks like the OS and is beautifully designed. PHPstorm is not plain ugly, but it’s not winning any beauty competitions. MacVim isn’t winning any beauty competitions either, unless they were held 30 years ago. They’re both decently designed for an application working across multiple OS’s but that’s all you can say.

Window Splitting

One thing I’ve never found likeable in any other code editor (IDE or text editor) is window splitting. I’ve spent a few weeks with Sublime Text 2, and I still have no real idea how to get splits to behave in a way I can predict.

MacVim takes the window splitting cake hands down. You can so easily split anyway you want in one tab, then have a totally different set up in another tab for the same files.

PHPstorm does splitting, but it’s not very flexible, and then all that UI is in the way. If you have too many tabs open, they just stack in the top of the one split. This tab stacking (and really all the UI) simply makes the splits feel less than useful. You can’t have multiple splitting settings in different tabs, just one set of splits and it includes all the tabs. Sure it works, but no where near as nice and clean as MacVim.

Configuring MacVim

I’m told that CTAGS are awesome and will give me most of the code completion functions I want. I’ve tried CTAGS more than once, and I’ve never been able to get them working in a fashion that allows me to predict the outcome of my own actions while typing. I rather have nothing happen than what feels like waiting for something odd to come up on Chat Roulette.

So now that I’ve been using PHPStorm for a almost a year, I simply miss the code completion available across projects and libraries and in LESS. I miss it enough that MacVim feels handicapped without it.

Cowboy Coding FTW

One thing I miss from both of the above options is editing on the live server. Yes I hear the cries about how terrible it is to edit on the live server. 99% of the time I don’t do it but sometimes it’s totally fine to edit on the live server. Take today as an example, I moved a site on my server from the dev domain to the live domain. I needed to change 2 file paths in the project (legacy code that can’t be abstracted from domain dependency). So I used Coda 2 (AppStore) to edit the files live on the server. Coda 2 is simply the easiest tool to edit live on any server. Yes a ‘proper’ server has SSH access, but some clients simply have crappy hosts that don’t allow it.

Coda 2 is broken for me in the lack of Vim keybindings and lack of project completion. It’s pretty but only real useful for live editing.

Other Stop Along the Road

While I haven’t talked about all the options out there I have make more stops along the way. Sublime Text 2 had decent Vim bindings, but moving to a line of code took more keystrokes than I wanted and it didn’t have full project code completion and it took lots of configuration.

TextMate 2 you say. I think it’s going to end up dead.

Emacs, hate the keybindings (remember I’m broken on Vim).

Aptana Studio, bloated, slow and ugly.

BBEdit, no Vim keybindings so it only lasted an hour.

Chocolat never felt right, and there is that whole project awareness thing.

My Ideal Editor and Yes I’m Damn Picky

So ultimately we’ve learned I’m damn picky and I should be. I sit in my code editing application 6 – 8 hours a day. When you use something that much you want it to be just right. Currently I’m using the ‘least personally offensive’ option out there not the best code editor hands down. I’ve got things I think are fairly heinous about all the options out there.

My ideal editor would be as fast to start up as MacVim, have code completion project awareness and test awareness like PHPstorm. Splits would function like MacVim, and of course we need Vim keybindings. It would look like a proper native Mac app, and have decent live editing for the few times you need to do it.

Totally a dream, but if you have something that you think fits feel free to suggest it.

To get a head start, join thousands of other men and Stop The Struggle.

Get my free eBook to help you stop working all the hours without traction.

You’ll also get a weekly email with good resources to help you do family with the same intention you do your work. Both need to run well if you want to win.

%d bloggers like this: