Ask HN: Any fun ways to learn Emacs?
I’ve been using vim for years, but after a traumatic brain injury my muscle memory for typing got a bit scrambled at the same time my need for something that was always installed everywhere dwindled. I’d kind of like to finally see what the deal is with emacs, but as holding down multiple keys simultaneously is now more than a bit hard (and so is memorizing all the chords) I’m looking for a game or typing tutor or similar sort of experience that can help me pick up emacs gradually and help me build a new muscle memory without having to actually work on anything important.
Over the years I’ve seen a bunch of games aimed at getting used to vim-style navigation, but not come across anything emacs-centric.
Alternatively I suppose I could just got evil, but as I’ve not used emacs practically I’m a bit confused how you don’t end up with a hybrid of home row touch typing plus having to wander about for whatever chords remain, which seems more like the worst of both worlds rather than the best.
53 comments
[ 4.3 ms ] story [ 75.6 ms ] threadinstall it:
play it: movement (control key optional): bigger movement across the field: step on unit: step on all surrounding units: mark a mine:or
C-h t
How fun it is probably varies by person, but I found it kind of enjoyable, also coming from vim. One of my favorite things emacs had that vim doesn't is a simple default bind to scroll the "other" window, good if working on two text files or if you have documentation open in the other one. I'm back on (neo)vim these days, but I learned a lot of neat stuff using both spacemacs and emacs with my own config, and they influenced my vim config later on. I have a bunch of custom binds using space as the leader key in vim now. Both duplicates of default binds like saving the file, and new macros/functions I use a lot (such as deleting the second line from two side-by-side files and saving both).
If you're into streams or stream recordings, watching Xah Lee can also be insightful. I learned about M-x describe-char from him and I consider it a killer feature. One of my very few neovim plugins I use is to get a similar thing outside of emacs. Nice for identifying emoji you can't see clearly (or want to know the shortcode for) or checking if some weird zero width stuff is in your text or if that colon or period is actually a unicode lookalike.
[1] : https://www.youtube.com/watch?v=1ZWm8B5t8B4
[2] : https://www.spacemacs.org/
Also, consider using god-mode. It's an Emacs package that allows you to reduce the number of key chords you use by entering a command mode where single keys correspond to commands, similar to Vim.
Regarding your concern about using evil-mode, it's true that it might feel like a hybrid of Vim and Emacs. However, many users find it to be a good balance that leverages the strengths of both editors. You could customize it to your liking and gradually add Emacs keybindings as you get comfortable.
Remember, the key to learning Emacs (or any editor) is gradual practice. Don't rush yourself, and take the time you need. Best of luck on your journey!
I was pleasantly surprised that the message started empathetically because none of the other responses did. But it makes more sense now, an LLM would do that.
I guess the only way to identify ourselves as human is to adopt a measure of rudeness, some grammatical mistakes and snark that those stupid AIs still try to avoid at all costs.
ChatGPT: Greetings fellow hackers, …
As others say, begin with the built in tutorial. It should be as simple opening Emacs and pressing enter. If for some reason it's not that simple, open Emacs and press Control+h followed by 't'. The tutorial walks you through the basics. The tutorial mentions C-h v. There is also C-h f for functions.
Next, when you're ready, learn Emacs Lisp. You can read An Introduction to Emacs Lisp online or within Emacs (using C-h i eintr).
Otherwise, hack and extend it. The joy of Emacs is that it presents you with programming problems at the threshold of your understanding. You decide whether to dip in. It provides you amazing resources to do it.
I hope you find a speedy recovery to your injury and have fun with Emacs.
Well, I guess Emacs is many things to different people. After using Helix for quite some time the single thing I missed was exactly the Emacs keybindings. Not plugins, although I've used quite a lot of them.
I'm curious, what do you like about the Emacs key bindings? Is it the GNU system integration, like with Bash?
At some level the keybindings are arbitrary. Some were designated before the contemporary keyboard existed. Of course, they may fit you better just because and that's great.
Nah, I actually don't use them I'm Bash that frequently.
It may be just due to the non-modal way of the hot keys. With Helix I frequently press Esc far too many times to be sure I'm in a right mode (just like I press C on a calculator a couple of times to clear it).
I've got caps remapped to control and somehow most of the shortcuts that I use quickly got into my muscle memory in a way that Helix's don't. I guess it's just hard for me to put into words why is that.
The muscle memory transfers well.
Also, if you decide to use evil (I like it), use evil-collection as well to make it play nicer with other functionality.
For navigation, i like devil-mode, avy, eglot/xref, transient, hydra.
I don't really like starter kits like doom, but they're popular and i guess people like them.
package.el is fine for installing packages, but i use straight.el or elpaca.
And as other people mentioned, the big part of emacs is on the extensibility of the system itself, everything is manageable by the lisp engine as emacs is the lisp engine more than a simple editor.
So my recommendation to learn emacs in a fun way is to install evil, open a buffer, bind `eval-buffer` and `eval-last-sexp` to something you feel comfortable, and write your own game to learn what emacs can do.
Mapping control to caps lock is the first step to Emacs enlightenment.
TBH, I prefer just plainly vi like motion on the editor, vi-like object selections, ex commands for common editing tasks, M-X with fuzzy matching for commands, and macros for repeating commands. If something more complex is required, I can always open a scratch buffer instead of using complex chords that I will never remember after having defined and would likely depend on which key.
Use the emacs keybinds to play it.
You learn one chord: Ctrl-h m, to describe the keys on the mode you are.
For instance, run Alt-x eww (intro), now you are at Emacs' web browser. Press ctrl-h m to show the keys for eww.
Also, basics to navigate with multiple windows:
ctrl-x 0: close the other windows
ctrl-x 1: set the current window as a single, enlarged one.
ctrl-x b: switch between buffers
ctrl-g : cancel, everywhere.
Get together with experienced users in person and have them watch you edit. That's it.
https://stackoverflow.com/a/11464768/3529997
Additionally, there's something called "Easy mode", started from vim -y or evim. It's a more radical departure than just starting in insert mode: it has some key bindings matching other editors', and normal-mode commands are done by hitting Ctrl+O instead of Esc. As a consequence of that, being in insert mode is the rule rather than the exception.
I'd recommend trying to write small programs in elisp to get familiar with emacs. - Message the current buffer's path - run an async command - copy the line in the center of a buffer and restore position - make a simple transient for command dispatch
I'd start with doom-emacs and if you feel your config is too cumbersome, you could move to a custom setup with elpaca and evil. Doom is good enough for most people and has config for most languages. The leader bindings in doom are pretty decent, SPC f f is much more preferable to <esc>:e.
Making your own transient menu will be very helpful if you're planning on picking up Emacs IMO.
If you need something that works everywhere, then unless you're okay with the default settings you're going to have to lug your config around with you. Evil can be installed through package-install trivially, so that's not an issue.
https://www.youtube.com/watch?v=urcL86UpqZc
Interview with a GNU/Linux user - Partition 1:
https://www.youtube.com/watch?v=lE4UXdJSJM4
Deldo - Vibration Control and Teledildonics Mode for Emacs:
https://www.youtube.com/watch?v=D1sXuHnf_lo
I personally love Emacs and have lost interest in learning anything else, but “fun” isn’t the right word for the learning curve. “Pain” might be closer to the mark.
It's pretty wonderful. Does a lot of the work for you.
https://www.spacemacs.org/
17 small length video tutorials of great quality (as informative as fun)
I’d suggest, in order:
1. Do the tutorial
2. Read Mastering Emacs (for some higher level design philosophy stuff)
3. Install Doom
https://www.amazon.com/Land-Lisp-Learn-Program-Game/dp/15932...
I keep a journal in Org Mode, and that's how I've learned to use emacs.