Ask HN: Any fun ways to learn Emacs?

yawpitch | 93 points

The thing about Emacs isn't it's key bindings. It's the extensibility and integration of the overall system.

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.

spit2wind | 13 days ago

Minesweeper is a nice Emacs game I like to play. It gets you familiar with the basic Emacs movement keys.

install it:

    M-x package-install minesweeper
play it:

    M-x minesweeper

movement (control key optional):

    n, p, f, b
bigger movement across the field:

    M-f, M-b, C-a, C-e, M-<, M->
step on unit:

    Space
step on all surrounding units:

    c
mark a mine:

    m
foobarbaz33 | 13 days ago

You should look into which-key, which is a popup showing active key bindings in the active context. And maybe start with a configuration-pack like doom-emacs or spacemacs, as they have good support for the vim-bindings, as also come with which-key pre-configured. And as I remember, they also allow deactivating vim-bindings if you want the pure Emacs-experience.

PurpleRamen | 13 days ago

M-x tutorial

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.

opan | 13 days ago

I highly recommend just doing Doom emacs with evil as a daily driver (that's similar of what I did) and then going through the Emacs from Scratch series from Systems Crafters https://systemcrafters.net/emacs-from-scratch/

ews | 11 days ago

I use evil, and prefer it to Emacs' native bindings. Evil overwrites some native Emacs binds, and the rest can still be used. This kind of a hybrid system is very useful IMO. For example, I can hit <F3> to record a macro. Instead of having to remember a register and being careful not to hit q, I can do practically anything. Being able to write your own functions is amazing.

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.

precompute | 11 days ago

The most important factor in my learning Emacs was doing it in a room with experienced Emacs users. I really strongly recommend doing this if you possibly can. A few minutes of an experienced user shoulder-surfing while I worked, and giving advice on better ways to do things, was worth hours of self-directed study.

Get together with experienced users in person and have them watch you edit. That's it.

kfogel | 11 days ago

After a month or so, if you're still curious, try https://emacsrocks.com/

17 small length video tutorials of great quality (as informative as fun)

agumonkey | 11 days ago

This is Emacs, you can just use the menu items for almost any option.

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.

anthk | 11 days ago

I think the only way to learn it is long, slow practice. There’s a how-to linked on the splash page and an extensive wiki, but otherwise it’s just going to be a process.

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.

binary132 | 11 days ago

Having used emacs for over 30 years, I suggest that the first thing you'll want to learn is how to bind keys. The default keymaps for nearly everything in emacs are generally awful. Just search for "my .emacs file" or "dot emacs gist" and you'll find oodles of examples to start from.

chuckadams | 11 days ago

You need which-key for your emacs. This way you only need to know the first keys (like C-x) in a chord, and then you will see what all the keys do. And since you come from vim, like me, you can use evil (and evil-collection). The other thing is you likely need to start liking and learning some basic Lisp.

1ark | 11 days ago

Perhaps doom emacs ( vim & emacs )[1] or spacemacs[2]?

[1] : https://www.youtube.com/watch?v=1ZWm8B5t8B4

[2] : https://www.spacemacs.org/

sargstuff | 13 days ago

As you learn the key bindings keep thinking about how to use Emacs as your operating system and ask questions to experienced users in forums or to LLMs. Read the manual, slowly, over a period of weeks, then reread it. Eventually learn a bit more elisp and learn how to program your own environment. Once your shell is within Emacs, and 50% of your daily interactions with a computer happen through it, you quickly reach nirvana in your journey towards Emacs mastery and you get to enjoy the things you built yourself.

pama | 11 days ago

Use vim in insert mode?

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.

_giorgio_ | 11 days ago

On Windows, I rarely use Emacs because I have never figured out how to get dired to follow the Windows symbolic links that I often use to organise my folders and files. If I remember correctly, the last time I tried, I could only find a rather outdated example without much explanation that I could not get to work. If anyone reading this knows how to do it and has also some talent for writing: It would be very worthwhile to have a tutorial that explains in detail how to do this in a beginner-friendly way.

Archelaos | 11 days ago

I recommend command log mode (tells you what command you just executed with that keypress), ‘embark-bindings’ (what keys can I press now), embark-act (“smart” what can I do at point), and maybe keyfreq (make common actions easier (haven’t tried this one myself yet)).

Also, if you decide to use evil (I like it), use evil-collection as well to make it play nicer with other functionality.

orge | 12 days ago

I started with emacs and then eventually found my way to Doom emacs, which is heavily built around evil. I now far prefer the vim bindings of evil. I’d say there’s value trying vanilla emacs first, but then I’d have no reservations diving into something like Doom.

I’d suggest, in order:

1. Do the tutorial

2. Read Mastering Emacs (for some higher level design philosophy stuff)

3. Install Doom

uniaxialBubble | 11 days ago

really i think the game is:

  C-h t RET
and then

  touch notes.org && emacs notes.org
and then futz around! The tutorial should tell you what C-h v and C-h f do, so those will be handy. I like helpful.el for a nicer/more thorough interface that's not quite info, and I really like vertico/consult/marginalia for making M-x nicely searchable with hints and stuff.

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.

hprotagonist | 11 days ago

here's a fun book called Land of Lisp. It'll give you a reason to work in Emacs, and you can start learning Lisp too.

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.

mr_spothawk | 11 days ago

Interview with an Emacs Enthusiast in 2023 [Colorized]:

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

DonHopkins | 11 days ago

Highly recommend checking out spacemacs! A coworker got me into emacs but it wasn't until I discovered spacemacs that I really got into it.

It's pretty wonderful. Does a lot of the work for you.

https://www.spacemacs.org/

ktm5j | 11 days ago

M-x snake

Use the emacs keybinds to play it.

throwaway148284 | 11 days ago

I do not know any for emacs, but for Vim there is one: https://vim-adventures.com/

mdtrooper | 11 days ago

There is no "learning" Emacs in a traditional sense, as there is no linear, structured, or categorized methodology. Emacs is vast, learning it is similar to learning a human language. Most of the time when people ask how to approach Emacs, it is like asking "how do I learn to move and live in Brazil," to which the appropriate suggestion would probably be "hmm, maybe start by listening to Portuguese?"

Imagine if there were a browser or a graphics editor where you could change any aspect of it, not just the UI - the look and feel of the elements, but the entire behavior of each element. Imagine if you could "screenshot" the current workspace in this "hacky, recursive Photoshop," then erase, repaint, and resize the panels, menus, buttons, etc., apply it, and then suddenly the whole UI transforms. Emacs feels like that, you can change just about anything - how it looks, how it behaves, and even how it listens and speaks. But to get there, you need to know Emacs Lisp.

So, my suggestion to understand Emacs is to learn Emacs Lisp. If you have never used any Lisps before - Clojure, CL, Fennel, or Scheme, there are two fundamental things you need to understand first. This is vital because without these, it's almost guaranteed to get frustrated. First, you need to learn to love the parenthesis, embrace the structure, and learn structural editing. Second, you need to understand the REPL-driven way of writing Lisp programs. Other languages have REPLs, but Lisp REPLs are different. Grasping the way to evaluate any expression at the point is essential.

After that, I suggest starting to write Emacs Lisp. Pick a problem to solve and try to figure out how to do it in Elisp. Start with something small, maybe not even very practical, like uppercasing every second letter in a paragraph. Eventually, you will learn how to use built-in help, debugger, and profiler and maybe even write your own Elisp packages.

The value of learning Emacs Lisp is that it forces you to develop a "hacktistic" mindset, where you are certain that any aspect of your computer workflow - any program, any interaction can be changed. You will no longer have to agree to "the status quo." Instead of helplessly yelling at your computer and hitting the screen when things don't work as expected, you will gain insight into knowing why things don't work. This wisdom might not alleviate the pain, but it will give you the insight.

Don't try to learn how to stay afloat on the surface; learn how to swim deep in the ocean - it will open a world of possibilities.

iLemming | 10 days ago

alias vim emacs

srhtftw | 11 days ago

[dead]

Owenwilliam | 10 days ago

As an emacs fan, I consider emacs bindings awful, so I wouldn't recommend learning emacs style navigation.

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.

licebmi__at__ | 11 days ago

I'm sorry to hear about your injury, but it's great to see your determination to learn and adapt. You might want to check out emacs-tutor, a package that provides an interactive tutorial inside Emacs itself. This could be a good starting point to get used to the basic commands and gradually build up your muscle memory.

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!

BitNomad | 13 days ago