Emacs is perfect for the suckless LARP
Recently a reader brought to my attention that I had not made any poasts in a little while. I have no choice but to give the people what they want. Fortunately I already had a couple poasts in the queue, this being one of them.
I have been a GNU/Linux power user for about 6 years now. Most of work is done in the terminal and I have used all the LARPy suckless or suckless-adjacent software. It’s both a preference and a hobby.
Likewise I fell for the meme takes of this or that software being bloat, most notably emacs and systemd. I’ll save the latter for another poast, stay tuned avid reader.
Whilst I won’t directly address whether emacs is bloat or not, I will address the fact that most terminal/suckless cosplayers - like myself - are actually be better suited using emacs over the Luke Smith starter pack.
In general, I think most terminal or power users care less about whether the program is strictly suckless - meaning lacking features but having some way to be extended via patching or separate programs - and more about the functionality and quality of the software. Whether something is suckless or bloat is ultimately a goal-posted opinion where there goal-posts are free to move. Vim is bloat, use vi. Vi is bloat, use ex. Ex is bloat, use ed. Ed is bloat, use cat, sed, and awk. Sed and awk are bloat, just don’t make mistakes.
There’s no real standard, except that in the end software quality will play the biggest role in our decision to use one thing or the other. Vim is full of features that are inspired from heckin-bloated emacs, but because it is so nice to use and the features can stay out of the way, nobody cares. I’ll save the bloat rant for another post.
Key Features of Emacs
- Unified “Terminal” System
- Daemon/Client - tmux not required. Quitting the editor does not kill the buffer, unlike vim.
- Documentation (info pages) and help system.
I’ll cover points 1 and 2 in this post, and save the documentation for another post.
Inconsistent System Experience
One of the problems I have after falling for the minimal software meme is remembering and deconflicting all the terminal bindings. Bash and other shells use the readline library with emacs bindings by default (I prefer this over vi even before using emacs), tmux has its own bindings mostly using ctrl-b (this conflicts with readline/emacs), weechat has its own bindings using alt/ctrl, vim has its bindings for splits, profanity, newsboat, lynx, etc etc. Plus your window manager keybindings. You really have to think about all of those and be strategic about how you lay out the bindings for your entire system.
Regardless of which window manager or DE (LXDE if anything) I am running, I use sxhkd to launch all programs. The sxhkdrc file is my master-list of all keybindings on my system. Everything is arranged by prefix keys, and I keep everything used by various programs commented out so I don’t override them with sxhkd bindings. For most programs, I think there’s a lot of wisdom in sticking with default keybindings because chances are they won’t conflict as much with other terminal/program bindings.
Consistent and Unified System UI and Experience
Emacs simplifies a ton of this. Everything in Emacs is an Emacs buffer, so Emacs keybindings - whether those keybindings are emacs, vi/evil, meow, or some other editing system - work on every program. There’s no mucking around trying to get scroll support in a terminal or program, or a way to copy text into your clipboard, or having different keybindings for vim splits and tmux splits. It’s all the same.
Likewise because everything is run in an Emacs buffer, all editor commands perform the same operation whether it’s a text file, web browser, irc client, or email message. You can create functions to manipulate text in one type of file/buffer that will work on other buffers. Tsoding had a recent video on the usefulness of emacs, and one of the key points was that emacs unifies programs that were never designed to work together. So trve, king.
Here’s an extremely useful but simple example: scanning for urls. Luke Smith’s st has series of combined patches that allow you scan the terminal window for urls, pipe them to dmenu, and then launch the selected url in the default system browser. Super handy. It doesn’t necessarily work with all terminal programs, though.
But in emacs, this is a very easy function to write that can be easily
extended.
It’s all done in about 20 lines.
I’ve bound this function to C-c g g (for go).
A minibuffer pops up with a list of all url’s in the
buffer, similar to st/dmenu.
I select the url I’m looking for with C-n/C-p, hit enter, and the link opens in my default browser.
If I press C-c g e, it opens in eww (emacs built-in browser).
If I press C-c g c, the same base function is used to show all urls in a minibuffer, hitting return just copies the url to clipboard instead of opening in a browser.
No scrolling through the articles or text (which is also easier than most apps because of unified emacs keybindings).
No highlighting and pressing a copy keybinding.
I can use that url copy function in any buffer - irc, webpage, text file.
It’s all the same in Emacs.
These functions scan for urls in the entire buffer. But what if I just want to select the urls that are shown on screen? Easy modification. No patching sauce code or anything like that.
Programs I’ve replaced with Emacs
| Function | Terminal (old) | Emacs (new) |
|---|---|---|
| terminal | st | vterm |
| editor | vim | emacs |
| multiplexer | tmux | daemon/client + TRAMP |
| file manager | vifm | dired |
| web browser (text) | lynx | eww |
| mutt | mu4e | |
| irc | weechat | erc |
| xmpp | profanity | jabber.el |
| matrix | gomuks | ement |
| git | cli | magit / vc |
| rss | newsboat | elfeed |
| image viewer | nsxiv | image-mode |
| zathura | doc-view |
Most of these are very easy to set up. Elfeed is definitely the
exception if you’re coming from newsboat, and I haven’t taken the time
to completely replicate my newsboat setup which used mpv for podcasts
and youtube vidyo, plus has a number of browser keybindings so I can
open articles in text browsers (assuming a full-feed isn’t provided)
and graphical browsers.
So for now I am still mostly using newsboat.
Which of these are “killer apps”? For my uses, I’m not sure I would call any of them killer apps on their own, though I don’t even view org-mode as a killer emacs app. I can survive just fine without them.
They become killer apps by virtue of being a part of emacs.
I’ve never been a huge terminal file-manager user, cli has always just
worked.
Dired on its own is a good file manager, no better or worse than
vifm, ranger, yazi, lf - they’re all kind of the same in my book.
Where it is extremely powerful is that it integrates with everything
else in emacs, including TRAMP which is EXTREMELY useful when editing
on remote machines.
Not going to cover it here in detail, but TRAMP allows you to edit
remote files in your current emacs environment. Before using emacs I
had in my head that in order to use emacs on a server, you needed to
install emacs on the server (which could add a bit of gbs). Not the
case.
My favourite dired feature is the ability to open two dired buffers in
a split window, and any command done in one buffer is assumed to end
in the other buffer.
I.e. if I copy a file/files or make symbolic link/links in one dired buffer, emacs assumes the target is the other dired buffer.
Very handy.
You can also change the target directory if that isn’t the case.
erc is the best irc client I’ve used.
ement is a very good matrix client, not that the competition is great.
jabber.el has seen recent improvements, it works fine.
magit is the closest to a killer app on its own, not for me, but for anyone who
heavily uses git.
Your git workflow becomes extremely fast with magit and the ability to
quickly do partial commits is a huge qol feature.
Key Difference: GUI vs terminal features
For most of these programs, a big difference is that when run as a graphical emacs session (normally the case), they are gui programs. They do not have the limitations of terminal text. Fonts can vary in size and are not limited to monospace. Images render just fine.
So whilst mu4e and eww are good programs, they are much better than
terminal variants because they render text and images as designed.
So with emacs you get the best of both worlds: minimal and hackable
terminal interface with gui quality of life features.
Edit: Note on Documentation
Whilst I will cover emacs documentation in another post, it’s a key
feature to mention here because all the features and keybindings for a
given program are easily accessible with emacs built-in documentation, usually with simple popup-menus.
Can’t remember how to do a certain operation in dired? C-h m shows
you all of the dired keybindings and mode information. Curious what a keybinding does? C-h k
will show you what the next keybinding you press does. Want to see all your
bindings tied to C-c? which-key makes that a breeze in the
minibuffer.
Recently added help-quick-toggle with C-h C-q is probably
the easiest of the bunch I’ve listed.
No man pages, no creating keybinding tables to track everything.
Conclusion
The suckless/terminal mindset is aimed at simplicity. Use simple programs that generally do one thing well, and stay in the terminal to avoid bloat, distraction, slow, feature creep, etc. Making all this happen can be a complex process though.
In my opinion, you’re better of accepting the “bloat” and “complexity” of emacs - I put complexity in quotes because emacs itself is actually a simple program - in order for simplicity of configuration, less mental taxation, and easier/better extensibility. Admittedly this will come at the expense of an extra gb or two of storage if you can spare it.
We all have fallen for the suckless LARP, why not fall for the emacs meme as well?