Skip to content

Instantly share code, notes, and snippets.

@roryokane
Created September 8, 2012 09:31
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roryokane/3673039 to your computer and use it in GitHub Desktop.
Save roryokane/3673039 to your computer and use it in GitHub Desktop.

I had a pretty elaborate vim setup https://github.com/mbriggs/dotvim, and now I am using emacs with evil. I’ll go through the reasons why, with a giant caveat being I actually don’t care what editor anyone who reads this uses, so long as they learn it and it works for them. As someone who has used both, vim shines for people who aren’t in to heavy customization. You can heavily customize vim, but it is so easy to make it dog slow, and even with a ton of work you won’t hit what you can accomplish in emacs. Here are some examples, and also essentially why I am no longer using vim, YMMV

If I want to run a command and have it pipe to another buffer AND not completely lock up the editor, I can do that with a few lines and compilation-mode. This is next to impossible in vim. I can split my editor window and have a shell running on the other side, that i can use all the keys and tools on that I use to edit code, again, not possible in vim. I can have a repl connected to my editor that the editor uses for auto-complete targets, and to pass code to to evaluate it. You can fake some of this in vim with a bunch of hackery, but it is nowhere near as nice.

There is also a pretty wide range of modes that are possible to do in vim, but for whatever reason just aren’t there. Some I use constantly all day:

  • smex lets me fuzzy narrow a list of all commands in the editor to find what I want (kind of like sublimes command pallet)
  • auto-complete will put up a light grey outline of text as you type if it finds things you can complete, if you want to select it you hit tab, if you ignore it it won’t intrude on your life.
  • magit is sort of like fugitive, just way more full featured, and the UI is quite a bit nicer. I have tried a bunch of git gui tools, and even those costing ~80$ really don’t hold a candle to magit (once you learn how to use it)
  • flymake tells me about syntax errors as I type
  • js3 mode has some of the best js indentation I have seen, and does full AST parsing, which means it can tell you things that are wrong with the code as you type. Linting on save works as well, but this is nicer.
  • org-mode is an amazing tool for many things. I use it for notes, team brainstorming sessions, todo lists. Lets say I am testing a csv output, if I paste it into an org mode buffer, I can c-c |, and it becomes a tablle that I can navigate, modify, sort, etc. Haven’t used any general purpose structured text tool that even comes close. If you pair it with deft, and store your org files on dropbox, you can have an amazing searching interface to a directory of your notes/todos/etc that auto-backups/replicates.

This is just scratching the surface. calc-mode is the most advanced calculator app i know of on my computer. regex-builder i use regularly. IDO mode is so sweet it is really painful to watch vim people use :Explore

Finally, the last piece is elisp vs vimscript. I got to the point with my vim usage that I needed to learn vimscript to do what I wanted to do, and I hated it. elisp has its own quirks and baggage, but it is so far ahead of vimscript in every way that you can barely compare the two. vimscript is a giant hack tacked on to a massive existing set of commands, compared to emacs which is an elisp platform that happens to have implemented editor functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment