Top
Best
New

Posted by weakfish 3 days ago

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

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!

214 points | 117 commentspage 4
pradyun_ 3 days ago|
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.
MangoToupe 3 days ago||
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.
dswilkerson 2 days ago||
I will just add a comment on an aspect of using emacs that no one else mentioned: (1) I find that I must bind caps-lock to control, and (2) as far as I can tell, no operating system does this in a way that really works besides OSX. So now I am stuck using OSX because I use emacs. When I use a GNU/Linux machine, I do it by ssh-ing in over the network from an OSX machine. I think you may find this to be something you have to deal with as well.
avtar 2 days ago||
> as far as I can tell, no operating system does this in a way that really works besides OSX

AFAIK this is an easy setting in desktop environments such as Cosmic, Gnome, and KDE. But I've been using keyd on Linux distros for a while:

https://github.com/rvaiya/keyd#quickstart

Using the config in the above example results in Caps Lock acting as Esc if used on its own or as Ctrl if it's held down.

kwoff 2 days ago|||
Not sure if it counts as "really works", but on Windows with PowerToys you can enable Keyboard Manager and 'Remap a key'. (Might want to remap right-Ctrl to CapsLock, in case it turns CapsLock on.) There's also old Registry hacks to do the same thing.
johanvts 2 days ago|||
Get a kinesis advantage, you won’t regret it.
teddyh 2 days ago||
> I must bind caps-lock to control, and […] no operating system does this in a way that really works besides OSX.

What? This has worked for me in X11 for at least two years now:

  setxkbmap -model pc104 us -option ctrl:nocaps
(If you still need a Caps Lock key, there’s -option ctrl:swapcaps)
nasduia 2 days ago|||
Yes, and that option is in most desktop environments' keyboard configuration dialogs.
bjoli 2 days ago|||
I always use "two shift keys activates caps".
porcoda 3 days ago||
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.
auslegung 2 days ago||
I suggest trying out Doom and maybe some other configs to see what's available, and if you want to roll your own you can choose the things you like most from them. I came to emacs from [n]vim and using evil-mode was _very_ helpful in making the switch easier so I recommend that
eviks 2 days ago||
If you want to fully own your config you can learn what Doom does and tweak it and simplify instead of getting only part of those improvements stretched over a longer period of time
wwarner 2 days ago||
i run a basic emacs configuration within docker, so it has all the underlying executables & binaries installed where emacs looks for them. runs exactly the same on linux & macos. https://hub.docker.com/r/wwarner/emacs-native or https://github.com/wwarner/emacs-native-dockerfiles
belden 3 days ago||
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.

Iwan-Zotow 2 days ago||
Emacs nano https://github.com/rougier/nano-emacs
spit2wind 2 days ago|
Open Emacs and press <return> to read the tutorial. This gives you the basics to be productive.

Understandably, some people complain that it shouldn't need a tutorial or the defaults are bad. There's validity to that angle. There's also validity to Emacs pre-dating GUIs, the IBM keyboard, and the x86 instruction set. Once you get past the history of windows and killing, you can explore. The history is also super interesting!

https://www.emacswiki.org/emacs?EmacsHistory

https://dl.acm.org/doi/abs/10.1145/3386324

After you've read the tutorial, go wild. Try stuff out. Break things. Fix them. Learn your limits. Learn that there are very few limits imposed by Emacs itself.

Hands down, the best resource for Emacs is Emacs itself. Especially, the Emacs manual and the Elisp manual. The "An Introduction to Programming in Emacs Lisp" is also excellent if you're not familiar with Lisp. Learn to read Info files and learn the help system (basically C-h f and C-h v)

https://www.gnu.org/software/emacs/manual/

Emacs really is a flagship of Freedom, with all its pain and glory. It lets you exist at the threshold of your zone of proximal development. Every bit you put into Emacs, you get a return on investment.

Welcome to the Emacs community! It's full of weirdos and wizards, as well as regular folk. Stick around and I'm sure you'll make friends in no time.

flimflamboi 2 days ago|
[dead]
More comments...