Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: Any fun ways to learn Emacs?
93 points by yawpitch 6 months ago | hide | past | favorite | 52 comments
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.




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.


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

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 miss the bindings, too, when using applications that don't support them. In those situations (and other situations beyond simple key assignment), I reach for the extensibility to modify the system...and find nothing that compares.

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.


> I'm curious, what do you like about the Emacs key bindings? Is it the GNU system integration, like with Bash?

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.


Using meow:https://github.com/meow-edit/meow I actually got keybindings in Emacs that are helix-like, so I use helix for certain projects and Emacs for others.

The muscle memory transfers well.


I personally like the Emacs keybinds because they are also supported in Cocoa Text framework, which means native Mac applications respect them. It's not just the terminal that follows these keybinds, but every graphical program in my system. You can actually use S-c / S-v and C-k / C-y to maintain two clipboards at once. This is a feature I miss every time I have to use a computer that is not a Mac. I also like being able to use C-a, C-e, C-k, and move between words with M-<left> and M-<right>. In the case of Emacs, the proper keybinds are M-f and M-b, but Mac also uses meta key as a sort of compose key, so this is the keybind used in graphical applications.


For me, it's being able to do much, much more than the "standard" editor keys, and the (mostly) coherence. And the ability to easily add more to do what I want.


I like how I can use my Emacs-learned keybindings to navigate native text fields in the OS (e.g., CAPS(ctrl) + a, or + e, to get to line beginning and end; also +h instead of 'delete', keeping my fingers on the home row).


Thank you; extensibility in a lisp is one of the draws for me, I just wish it was easier to re-teach my brain’s relationship with my fingers.


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


Ahh, brilliant find, thanks!


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.


Thank you for pointing out which-key, that sounds extremely helpful.


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.


Thanks for the breadcrumbs, I’ll check out Xah Lee.


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/


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.


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.


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)


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.


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.


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.


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.


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

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

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


Thanks. I do like the idea of best of both worlds, but I also feel the draw of starting from a blank slate in terms of configuration. I’ll check them out.


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.


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.


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.


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.


Thanks for those recommendations, all sound useful.


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


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.


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.


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


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/


M-x snake

Use the emacs keybinds to play it.


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


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.


I understand that the comment above doesn't answer your actual question. I deliberately decided to split my answer into two parts - first about learning Emacs. Now, let's talk about Vim, etc. Vim navigation is amazing, fantastic, and a highly practical model. As someone well-versed in both vanilla Emacs and vim-style, I highly recommend not abandoning it in favor of Emacs' built-in way. Yes, it is beneficial to learn Emacs native keybindings because they are ubiquitous - on Mac and Terminal, readline, etc. Some Emacs key-combinations are nicer than Evil's, but in practical sense, overall, they are inferior to vim-style navigation.

The biggest pain about Vim navigation is that there's no "true vimming" outside of Vim and Neovim. Every single editor that tries to simulate it to a fuller extent has repeatedly failed. Every single Vim plugin for VSCode, IdeaVim plugin for IntelliJ, Sublime plugins, etc., they all have glaring deficiencies compared to the actual Neovim experience. With only one exception - Emacs. In fact, Emacs can and does vim better than Neovim.

Do try Doom Emacs or Spacemacs, at least for a while. Once you grasp the mechanics of stitching different packages together, learn hooks and advising, fearlessly start redefining the keybindings, maybe then you can decide to build your config. But maybe Doom will provide everything you need. Give it a try, it is really good.


Thanks for the very thorough response(s)… now, a question, what’s the most basic and minimal bootstrap config of emacs (possibly within Doom) that sets a relative lisp-newbie up to effectively work with elisp inside emacs?

I’ve used lisps, I’ve never used lisp REPLs, and while I hear the beauty of emacs is getting to the point where it’s your terminal and your IDE, it’s non-obvious how to get up to running like that even in its own language.


alias vim emacs


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.


> I consider emacs bindings awful

Mapping control to caps lock is the first step to Emacs enlightenment.


Yeah, tried and no cigar. I also tried different input styles like xah's but I still come back to evil (plain evil, not collection).

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.


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!


Was this comment by any chance written using an LLM? It really sounds like it was, but I could be wrong…


It looks like it was. Ghostbuster.app reports 93% probability and gptzero.me reports 100%.

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.


Indeed, LLMs have that distintive and slightly revolting quality of friendly, helpful and inoffensive tone that reminds me of American customer service ideals. Also the user's profile is equally toeing this line of uncanny valley.

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.


‘Hey, ChatGPT! Write me a witty bio for my new Hacker News account. Make me talk like a real hacker.’

ChatGPT: Greetings fellow hackers, …


Hey, but at least it values equality and diversity.


I think it has to do with who trained them, and how, and not the technology itself. Just wait until the capability of training on large corpuses is more widely available…


Thanks for the advice, god-mode sounds like it could be a big help for me. Main thing for me is just learning what chord-style combinations are, practically, used most often and also conflict with my more-distorted-than-prior ergonomic needs.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: