Our Fave Code Editor: vi

From vi To Emacs, It’s All About Your Philosophy

Based on our experience, we haven’t found a huge difference between Emacs and vi code editors. We’ve switched between Emacs and vi a few times, and find that vi is more in sync with our thinking style, because it’s easier and faster to get familiar with.

We originally used Emacs for Lisp, because Emacs is supposed to be the best Lisp-based language editor. Now, we find vi better, because it’s ubiquitous across all UNIX platforms. Emacs is now too of course, but vi was originally smaller, so it would load faster.

vi Shortcut Commands We Love

vi is an easy-to-use modal editor that allows users to type commands without removing their hands from the home row of a keyboard. Everything in vi has a mini language, and we like that a lot. The code editor has basic commands, and also allows you to jump around text very easily. vi also allows you to use numbers with certain commands, which means that you can run that command several times. For example:

4dd – Delete the next 4 lines

2y – Paste 2 lines

$ – Brings you to the end of the line

G – Brings you to the end of the file

You can use all kinds of combinations in vi after you learn the commands. These combinations make sense, and fit our flow better than Emacs. We learned both code editors extensively, but found that the Emacs commands weren’t as intuitive, so we just kept going back to vi. 

Other Code Editors On Our Radar

Atom

Atom is the new hot editor from GitHub. This desktop app lives in your dock. Its open dev tools let you tweak its look and customize it. With Node.js support, you can start servers within it. Atom’s modular design boasts 50 open-source packages.

Sublime Text

Sublime Text 3 is currently in beta, and is available for OS X, Windows and Linux. Sublime Text’s “GoTo Anything” panel allows you to easily filter, rank, preview and locate your files. Feature requests are welcome.

TextMate

This Mac-only editor has been referred to as a combination of Emacs and OS X. With project management tools and a minimalist GUI, search and replace in a project, clipboard history and foldable blocks are just some of TextMate’s features.

Another reason we prefer vi is that we like a cross-platform editor. We may have vi on a Mac, but when it comes to working on our UNIX servers, we’ll also use vi instead of switching from the GUI of one editor to another. We find that it easier to stick with the same code editor.

Customizations Make Life Easy

We’ve also hit roadblocks with some of the editors when it comes to not being able to do something we need to. Because vi is open source and customizable, we can either do it ourselves or 99% of the time, it’s already been done.

An example of a customization we used is Paredit. Also available for Emacs, it lets users jump to the beginning of parentheses, or manipulate pairs of parentheses and any kind of bracket like double quotes or single quotes. This is very important for things like lists and languages where you need to get around code fast. A similar plugin is Surround.vim. Available on GitHub, it lets users easily delete, change and add “surroundings” in pairs, like parentheses, brackets, quotes and XML tags.

Overall, we recommend vi. It’s got the shortcuts we want, and with customizations, it works like a dream.

Read More →