Ask HN: Where to begin with "modern" Emacs?

228 points by weakfish ↗ HN
Hi all,

I’m a longtime Neovim user who’s been EMacs-curious. The hold up for me has been that I’ve been unable to find a source of truth for what’s top-of-the-line as far as plugins are. With Neovim, it’s a safe bet to look at what folks like Folke are doing, but I have struggled to find a similar figure in the Emacs community who gives insight into what’s-what. I know Doom exists, but I want to fully “own” my config and not over complicate it.

Thanks!

62 comments

[ 1.7 ms ] story [ 79.4 ms ] thread
(comment deleted)
I saw what was possible with emacs via systemcrafters: https://systemcrafters.net/emacs-from-scratch/

And I should note I have been using it for about 25 years, and was mostly in the dark about what it was capable of, though many of those years were in environments where I was using versions 5-10 years out of date, and completely locked down/out of things like melpa.

As far as keeping up with whats latest and greatest, I think the real answer is there isn't a good online resource. There are emacs meetups and conferences and some are virtual, and you can ask around other power users and see what they are doing. I even find emacs packages to be pretty poor at selling themselves on why you should use them.

As an example, Ivy and Counsel are kind of game changers to the UI, but I don't think you get any idea of that from their manual or main github page: https://github.com/abo-abo/swiper

You didn't say which platform you're on. For Linux, just use the emacs that comes with the distro. For Windows, download the official build for Windows. For macOS, I used to use emacsformacosx.com's version but now I use Homebrew's emacs-plus. It has a native-compiled version and is hella fast.

I use the regular package manager for emacs (package-install).

Been a user since the first version of GNU Emacs, back when RMS was trying to reproduce Gosling's emacs (which I used for a couple of years). That was the early 80's.

I recommend starting with vanilla Emacs and just adding things as you find the need for them. Emacs comes with a lot of things OOTB. After a decade, my only essential package addon-ons are magit and yasnippet.

I have other packages installed, but they're esoteric for my own purposes.

Doom is still a good reference for which packages people find interesting; don't dismiss it out of hand. I do think it's quite heavy handed in terms of altering core input behavior, tho.
I’ve been an Emacs user for more than a decade and I would recommend just using Doom especially if you are coming from a Vim background.

I started before Doom existed but ended up in a configuration similar to Doom but more brittle. I ended up just declaring .emacs bankruptcy and started over with Doom and was pleasantly surprised that my over 2000 line configuration became less than 30 customized lines.

If you want to do it the hard way I’d start with figuring out elpa and going from there installing the specific plugins that you want. Likely, evil being a first.

I think the usual advice is to try the vanilla Emacs, maybe use better-defaults (either directly or just for inspiration), as it is a relatively light customization. The setups people use tend to be quite different, as do their opinions on packages, so I doubt there is a single satisfactory and agreed upon "source of truth". Others' setups may be useful to check out, possibly pages of emacswiki.org, chatter on the #emacs IRC channel at libera.chat.

Edit: As for heavily customized versions (Doom, spacemacs), I have not tried those myself, but occasionally saw people having issues with those, and others not being able to help them, since it was not clear what sort of magic is going on there. So I would not recommend those to new users, at least not if you would like to learn the basics and get a better hang of it, to be able to debug it, though some seem to be happy with those.

I've been using emacs for a decade by now.

I'd look into spacemacs (what I use).

It's similar to doom, in that it makes some decisions for you, but you can very much have a customized experience.

I for instance have a lot of "stock" sections, and other things that are very customized that I've made myself.

Look into the "layers" (sets of packages that work together). I'd particularly recommend checking out the compleseus layer, which is a composition of consult, orderless, vertico, and embark.

They're all built to be composable (selection, pattern matching, selection interface, and context menu respectively), and they each add up to a brilliant emacs experience while reusing emacs' built-in frameworks (completing read). It's an alternative to helm and ivy (I've used each before).

The reason I recommend spacemacs (I'm sure doom could be the same, I just didn't know it) is because it is an easy way to see what packages other people find useful and how to use them, and it has similar conventional across different packages (so you can run tests in the same way no matter whether you're using rust, or python or whatever other language).

Org-mode. But it's already part of the package...

...because Emacs is a mature ecosystem: Meaning many and probably most tools predate developer-gets-famous-on-internet thinking, have been refined over decades, were built by people to get their job done, and often that job was something where programming was incidental to the task at hand.

There is no such thing as top of the line.

There are preferences.

Asking where to begin with 'modern' Emacs is like asking where to begin with 'music'.

Just use stock until you find something you like better. It is one of the few pieces of software left where taste is king and there are no right answers.

+1 to just use Doom. Even if you disable all of Doom's extra modules/plugin configurations, it still includes a lot of emacs black magic that makes emacs much faster. It's very slow without that.
I’ve rebuilt my emacs config a few times for exactly this reason!

Some of the things I’ve found work well for me:

- it’s pretty obvious, but it took me a while to figure it out: make your `~/.emacs.d` into a git (jj, hg, whatever) repo. You don’t need a remote but as you try things out it’s nice to be able to step back in time.

- know what you want to build. For me I’m generally trying to make emacs do something that I’ve seen a colleague’s editor do: integrating language servers for source navigation; integrating a debug server for a nice visual debugging experience.

- some people manage their emacs configuration as org-mode files. This is neat because you get an experience similar to Jupiter notebooks: you can intermix commentary and elisp. I haven’t ever gotten to this point but it looks neat when I see others do it.

There are some good YouTube channels and blogs that talk about configuration, or that test different packages. I’ve found “Emacs from Scratch” and “Emacs Rocks” to be really useful.

There’s a lot to customize and select from. Without steering you one way or another, here are some changes I’ve made recently or packages that I use:

1. For language servers, I find `lsp-mode` to be easier and more full-featured than `elgot`.

2. `dap-mode` plays nicely with `lsp-mode` and makes debugging straightforward.

3. I’ve tried, and use, a few different plugins for AI coding: `greger.el` is the first one I tried, but I’ve started using `xenodium/agent-shell` more. If you want to write (or hack on) an AI agent written in elisp, there’s `steveyegge/efrit`.

4. You’re probably accustomed to some sort of “tab completion” from neovim. Within emacs you’ll need to set up a “completion framework”; there’s a bunch to choose from. Watch some videos and experiment. You’ll probably find one that feels a lot like you’re used to (whether that’s completion-as-arrow-navigable-dropdown-at-cursor, or completion-in-side-panel, or whatever).

Your muscle memory of how to move around in a document and how to tell your editor “I want to do something new now (see a list of open files, go to a new file, etc)” isn’t going to translate into emacs very well. It’s like shifting from a laptop keyboard to some weird split keyboard with thumb paddles: muscle memory won’t be satisfied, and you might just “not like” emacs due to that. There’s `evil.el` (“Emacs VI Layer”) which teaches emacs to recognize vim-style commands. I think vims have fantastic macro recording and replaying functionality - emacs has it as well, but making a recursive macro is harder for me, for some reason - and evil makes emacs’s macros feel on par with the vims.

Another tripping hazard coming from a vim-like is that “undo” operates differently in emacs. I think the vims have a fairly linear undo: like a browser history back button. emacs stores an undo tree, which can lead to surprising behavior at first.

If you’ve written or tweaked plugins for your editor and enjoy tinkering with your tools, then a vanilla greenfield approach to emacs will probably be very satisfying for you.

If you want something that “just works” which you can experiment with and gradually learn more about over time, then you might get more mileage out of spacemacs.

I think vim-style users tend to launch vim many many times through the day. cd here, edit a file; save, quit, edit the next file. emacs can act like an editor, but if you think of it as a highly customizable IDE, then you’ll get more use out of it. My uptime on emacs is generally measured in months, whereas for me vim is in seconds to minutes. I mention this because the startup time for emacs can be quite slow compared to vim; just don’t pay that cost over and over.

I'm a vim user, using orgmode. I've noticed the blog of Sascha Chua. She posts Emacs News and in these posts there are some orgmode gems. But she is posting more on Emacs. Maybe interesting to look these posts up: https://sachachua.com/topic/
Vanilla emacs to start, and then the approach I take to finding interesting packages and config is to read the Emacs Weekly News from Sacha Chua (which often links to articles and videos describing packages and configs). There sometimes are articles or videos linked from there that talk about configuring from a vanilla setup that are likely what you are looking for.
I maintain a pretty popular Emacs starter-kit called Bedrock. [1] I suggest starting with it, or at least taking a look at it to get some ideas!

Bedrock differs philosophically from Doom et al. in that Bedrock is meant to be as simple as possible. There's no magic, no extra package management system (looking at you Doom) to break or confuse. By default, it doesn't install any 3rd-party packages—it just sets better defaults. Recent versions of Emacs can do a lot, but the defaults are painfully outdated. Bedrock fixes that. It's basically a vanilla Emacs experience without some of the cruft carried over from the previous century.

Bedrock also comes with a curated set of packages to enhance Emacs beyond better defaults. You can load these into your config as you begin to need them. List here: [2] If you are looking for a set of "modern" packages, this is it. I do pretty well keeping up in this space, and a lot of these (esp. Vertico, Consult, Corfu, etc.) seem to be accepted as the de-facto best replacements for older packages like Helm, Ivy, etc. (That said, I should add some config for Casual—very neat package to help with seldom-used features of Emacs.)

Bedrock is meant to be understandable: clone it once, and then tweak from there. You'll find a lot of forks of Bedrock on GitHub as people have forked it and then built their own config on top.

I'm working on updating Bedrock for Emacs 31. There won't really be that many changes, so like, don't wait for 31 to start your Emacs journey, but know that Bedrock is actively maintained and that the packages I've curated for it are the best I could possibly find. :)

Oh, also, if you search "best Emacs packages", my blog post [3] will come up on the first page on basically every search engine I've tried. ;)

Happy hacking!

[1]: https://codeberg.org/ashton314/emacs-bedrock

[2]: https://codeberg.org/ashton314/emacs-bedrock#extras

[3]: https://lambdaland.org/posts/2024-05-30_top_emacs_packages/

+1 for emacs-bedrock! It helped me get started with reasonable defaults out-of-box. From there, I started adjusting it to my own needs.
> started adjusting it to my own needs

Yay! That's 100% what it was made for. Any suggestions on how to make key features more discoverable welcome.

I used spacemacs in the past primarily to drive org-mode. Fell out of love with it after a few years and moved to pen and paper bullet journal.

Interested in trying emacs again with something simpler, will give bedrock a try!

Start by just opening it up and clicking on 'tutorial'. After that check out Options->Manage Emacs Packages and see if anything interests you. After that check out Melpa (<https://melpa.org>). Finally you can check out what other people do, for example Prot (<https://protesilaos.com/emacs/dotemacs>), you can look at Doom's source,...

You're basically about to go on a journey to a country you've never been, so my recommendation is to just read up about it and see if you find some things you want to experience.

Don't use doom etc, just standard emacs, otherwise you won't have any understanding of what is happening and how to fix it. Here's a list of what I think is important, roughly more important to less:

    - corfu+marginalia+vertico+embark+orderless is the standard completion stack now
    - magit (maybe also see also the "casual" the transient front end for other modes)
    - avy
    - (fset 'yes-or-no-p 'y-or-n-p)           ; 'Y' or 'N' instead of 'Yes' or 'No'
    - (setq confirm-kill-emacs 'y-or-n-p)
    - evil (optionally if you like vim keybinds, you still need to know basic emacs))
    - if using evil: evil-collection, evil-args, evil-goggles, evil-traces, evil-escape, evil-nerd-commenter, evil-lion, evil-surround, etc are not "standard" but still useful 
    - configure melpa source
    - which-key
    - helpful
    - undo-fu
    - gptel
    - projectile
    - eglot
    - saveplace
    - desktop
    - uniquify
    - dired/wdired
    - flycheck/flymake
    - treesitter
      
Stuff that is nice but less essential:

    - general (for making your own keybinds)
    - some kind of multicursor mode (I use iedit but it's simple)
    - yasnippet
    - org (usefulness depends on the person)
I haven't switched to corfu+marginalia+vertico+embark so I don't know what the equivalent is but helm-swoop is nice.

Also, very important, learn the help system (C-h <key>), especially C-h f, C-h k, C-h w, C-h c. And the info system

I think I made a similar move about 6 years ago now. Started on Doom Emacs for the first 2-3 years, and honestly, for most users I think Doom Emacs is all you'll ever need. If you ever decide you want a bit more control over your config, which is what the case was for me, then it maybe makes sense to start writing your own configuration and learning about more of the native features. Would definitely recommend system crafters' emacs from scratch series that others have linked here -- extremely helpful.
Most comments here are giving you fish instead of teaching you how to fish.

The emacs subreddit is pretty active. Search reddit for recent-ish threads for whatever you want to do.

The question is about Emacs configuration, but the keybindings might also be unfamiliar if you're coming from Vim. When I was learning I printed https://www.gnu.org/software/emacs/refcards/pdf/refcard.pdf and taped the two pages to my desk right in front of the keyboard for probably a 3-4 weeks. It was useful and also felt great when I didn't need it any longer.