Emacs for Vim Users with Evil, Part 1

Near the beginning of my Internet career, I experimented with Emacs. I soon switched to Vim and stayed with it. I recently started getting curious about Emacs again while going through some Lisp tutorials. I can’t leave Vim behind completely, so I’m trying “Evil“.

The installation instructions are not very clear, and it was a bit frustrating to get the package manager working so that it could find Evil. Here’s what did work:

Activate the Package Manager

I’m using Emacs 24. I put this in my .emacs file, which is located at ~/.emacs:

Getting Evil

Note: the letter C refers to the ctrl key and M refers to the alt key. So C-x means ctrl-x and M-x means alt-x.

I restarted Emacs and and typed M-x package-list. M-x puts you on a command line and the rest is the command. Press enter at the end.

The result will be a list of available packages something like this:

Emacs Package Manager
Emacs Package Manager

I found Evil and the other packages I wanted to install and pressed the i key to mark them. Then I pressed x to install them.

To see a list of installed packages, type C-h v package-activated-list. The output of that command for me is:

package-activated-list's value is
(evil-leader evil-matchit evil-nerd-commenter evil-tabs elscreen evil figlet goto-chg org undo-tree)

Configuring Evil

I then put this into the .emacs file below the stuff mentioned above:

Here is a screenshot:

Emacs config file for Evil
Emacs config file for Evil

There may be better ways to do it, but now it works, and I can use Vim commands as soon as the program starts. I’ll create a part 2 if this works out!

Related posts:

Leave a Reply

Your email address will not be published. Required fields are marked *