I've been using Emacs for about a year now
What I've been doing with it and which packages I've been using

02 September 2016

I still think of myself as an Emacs newbie. I’ve been using it for about a year now. At times I still feel like I’m not sure what I’m doing, but I’ve reached the point where I can comfortably look up help online, and I have some workflows that I feel pretty good about.

In this article, I’d like to share some of my favourite packages that extend Emacs and have made it a much better experience for me overall.

This could be considered a follow up on my previous post on Emacs, where I explained why I started using Emacs and some of the reasons why it appealed to me.

Ido, Smex, and fuzzy matching

One of the pain points I felt early on in using Emacs is actually one of the core features: changing between multiple open files. Ido (Interactively do things) gives you autocompletion suggestions for this while you’re typing.

Like with everything Emacs, you can swap out Ido’s matching function with another package, such as flx-ido, which makes the matching more fuzzy. So even if the buffer I want to change to is called something long and difficult to remember like 2015-10-10-so-ive-been-learning-emacs.md, I can press C-x b to start looking for the buffer to open, type emac into the search, and choose the right one.

Smex is the same thing as Ido, but for doing autocomplete on M-x commands. For those who don’t know, M-x is the Emacs shortcut for “this function doesn’t have a shortcut, or I just don’t know the shortcut, so I’m going to type its name”. The fuzzy matching makes it much easier to find the function I’m looking for when I’m not sure exactly what it’s called.

Projectile

This was a game changer for me. My primary way of jumping around files in a project with other IDEs was to hit a keyboard shortcut, then kindof sortof type the filename of the file I wanted. The IDE would then suggest what I might be asking for based on the mess I typed in. Projectile gives me that, including the fuzzy matching I have with Ido.

Projectile also has other project related functionality, like calling grep over all the files in the project.

##YASnippet

I don’t do code templating much, but when I do YASnippet is a good option. It makes it quick to define and test a template, and limit it to the language where it makes sense.

This is really convenient for code where the structure is going to be the same every time, and the content will be different. For example, in JavaScript where you might want every file to follow this layout:

(function() {
    'use strict';

    //actually start writing here
})();

rust-mode, js2-mode, lilypond-mode, and others

There are lots of language specific modes. Rather than talking about this specifically, I’m going to suggest that you just Google around and see which packages people are using for the programming languages you’re already using. It will typically give you syntax highlighting, and a bunch of the shortcuts will be better customised so that they make more sense in the context.

I’ve found that Emacs has packages to customise it for far more different programming languages and markups than most of the other IDEs I’ve used.

Google

I got to most of these packages by hitting a problem, and then taking a look on the Internet for a solution. It even worked well to start with a feature in a different IDE that I wanted, and researching how to get it into Emacs. You need to be working with a certain presence of mind to identify the pain points in your tools and figure out how to ask the Internet for help. This has paid off countless times while working with Emacs, and saved me huge amounts of time overall.

Final thoughts

So those are my current favourite Emacs packages. If you have others that you think other people would enjoy, please mention them in the comments.