Emacs has a notoriously steep learning curve, but even after all of these years there are advantages too numerous to name!
A few:
- Open source
- Can run in a remote terminal
- No AI unless you add it
- Key bindings are useful in other programs (and sometimes at the OS level)
It is also, by design, extremely configurable. Lately I've given over most of that work to the Doom Emacs configuration framework.
As far as the basics, these are the commands I use 90% of the time:
Opening and closing files
| keys | action |
|---|---|
| ctrl-x ctrl-f | open a file |
| ctrl-x ctrl-s | save the current file |
| ctrl-x k | close the current file (kill buffer) |
| ctrl-x ctrl-c | exit Emacs |
Moving around
| keys | action |
|---|---|
| ctrl-a | beginning of a line |
| ctrl-e | end of a line |
| ctrl-f | forward one character |
| ctrl-b | backward one character |
| ctrl-d | delete one character forward |
Selecting/cutting/pasting
| keys | action |
|---|---|
| ctrl-space | set a mark |
| ctrl-w | cut marked region |
| ctrl-k | cut to the end of the line |
| alt-w | copy marked text |
| ctrl-y | paste |
Bonus keys
| keys | action |
|---|---|
| ctrl-c p ? | find references in a project |
| ctrl-c p s | search for a string in the project files (requires ripgrep) |
| ctrl-c p a | switch between the currently open .c and .h file |
| ctrl-x b | switch between open files |
| ctrl-c p f | find file in current project |