Thursday 18 September 2014

Emacs evil mode

I decided to have a look at Emacs evil mode (the Vi mode for Emacs). Vim is not really suitable as an IDE. It's an editor and anything else tends to be a bit of a hack. Debugger is one such issue, it's not very convenient to use gdb inside Vim. As an added bonus I can use Lisp instead of Vimscript to write scripts.

But I like Vim's editing better than Emacs's endless control-meta-this-and-that approach. It's faster and more convenient. I might try Emacs without Evil mode at some point, I'm a pragmatist after all but at least this way I don't have to learn the entire Emacs editing thingy just to get started. I'm familiar with M-x, C-x C-f, C-x C-f and the like which should suffice for now.

Installing was almost like a breeze. Had I figured out Ubuntu 12.04 uses emacs23 instead of emacs24 which all the help I can google points to I would have had an easier time. But here's how I got started:

sudo add-apt-repository ppa:cassou/emacssudo apt-get updatesudo apt-get install emacs24git clone ~/.emacs.d/undo-treegit clone git:// ~/.emacs.d/evil

Then I added the following to .emacs:
(add-to-list 'load-path "~/.emacs.d/evil")  (require 'evil)  (evil-mode 1)
(load-theme 'wombat)

Last line loads the wombat colour scheme. I use wombat256 in Vim.

Now I just need to figure out how to get the same functionality as my favourite Vim plugins have. For instance, CtrlP. Someone suggested ido mode, but I can't seem to get it to do recursive search. In CtrlP you don't have to know where a file is to find it.

No comments:

Post a Comment