Batteries included with Emacs (2020)

Batteries included with Emacs (2020)


·November 25, 2021

Mikeb85 · 9 days ago

Honestly, I never really had that much love for Emacs until relatively recently. I've always dabbled due to it generally having good support for most languages (including esoteric ones) but recently I got into it a lot more due to the fact that many of the new-ish OSS editors but Emacs has always been there and likely will always be there.

A few years back I got into Atom quite a bit since it checked all the boxes: extensible, open source, and it was very nice. Then VSCode killed it. And it seems more and more that VSCode is taking over, all the while inserting more proprietary code to the point where half the 'big' plugins don't work on Codium, only the proprietary MS distribution.

So I got back into Emacs but really worked on my environment. Stopped dabbling and started just forcing myself to use it. And it's honestly amazing. It checks off every box available in VSCode and more. And it's nice knowing that it'll always be there. I'm not against proprietary software per-se, but I definitely don't have a lot of trust in Microsoft.

throw10920 · 9 days ago

One of the (several) unfortunate things about Atom being killed by VSCode was that its extension model was much closer to that of Emacs - everything ran in the main editor process - far more flexible than VSCode, but also with the mass-market appeal of JavaScript.

(yeah, that model led to poor performance, but afaict that's a combination of (a) just JS things and (b) not putting any effort into the design)

> I definitely don't have a lot of trust in Microsoft.

Very wise, given the user-hostile stuff they've been doing in Windows recently...

smallnamespace · 9 days ago

> (a) just JS things and (b) not putting any effort into the design

This feels a bit self-contradictory, since one might argue a properly designed extension API must include process isolation, so naively-written extensions can't mess up the main loop. VS Code extensions are also in JS.

This is the same problem that, say, preemptive multitasking solves, and why Windows 3.1 crashed much more than '95 and XP.

quotemstr · 9 days ago

And thanks to recent developments in cross-editor infrastructure projects like tree-sitter and LSP, editors like VSCode, Emacs, Sublime Tex, and even public nuisances like vim can all advance at the same time and benefit from each other's development work in areas where the editors aren't differentiated.

We're very close to a world in which we don't have N implementations of finding the start of a C function or figuring out what parts of a Python buffer are keywords.

pronik · 9 days ago

Somehow, Microsoft managed to invent LSP for VSCode and then abandon some parts of it just a couple of years later -- e.g. python language server is dead, pylance is there instead, closed source, VSCode-specific and with prohibitive license. Most language plugins in VSCode don't use LSP anymore IIRC.

pitaj · 9 days ago

While it may be true that pylance is closed source and vscode specific, pyright[1] is MIT. Pylance does appear to still be a language server as well. As far as I know, most language plugins still use LSP, including Typescript/Javascript, Rust, and Go.


lc9er · 9 days ago

> even public nuisances like vim.

I love vim (err… Neovim), and this was great.

agumonkey · 9 days ago

we all love vim, especially to mock it absurdly

nocman · 9 days ago

"public nuisances like vim"

Others here seem to have taken this as tongue-in-cheek. On the first read I took it as "I think vim is ridiculous". I'm honestly curious to know which it is (or if both are inaccurate).

quotemstr · 9 days ago

Of course it's tongue in cheek. Vim is venerable high quality software that a lot of people love. Emacs people dunking on vim (and vice versa) is just an old traditional joke with no actual animus behind it.

rvieira · 9 days ago

I'm also a recent Emacs enthusiast. Many many years ago, I never felt productive with the navigation and keys.

Then, recently, I _really_ wanted to try org and thought "I'll force myself to use it". I started with Evil mode and Doom. I was blown away tbh. What I thought to be an "old" tool that would slow me down, is actually a massive booster (and fun!). My personal experience, of course.

rolandog · 9 days ago

I had a very similar experience, but I started with plain Emacs, and little by little adding what I needed. I was afraid of getting something really bloated, or not understanding how it all bundles together. I think it has paid off a bit, but the learning curve has been steep.

rvieira · 9 days ago

IMO that's the proper way to learn Emacs.

Doom seemed right to me at the time because I just wanted to uncomment `;; org` in `init.el` , not learn a lot of keybindings and get started.

I think I'll start an "Emacs from scratch" someday too.

Spivak · 9 days ago

Evil/Doom never really clicked for me and I went back to Neovim because of it. There were always gotcha's or packages that didn't have evil support and the when the walls broke down it was kinda clunky. Now that you can script Vim with Lua (or Python/Ruby) I don't really think I care too much about Emacs' infinite extensibility.

ripe · 9 days ago

For people who ask, "why use text-only editors like vim or Emacs, when I can use a full GUI IDE?":

One of the reasons I haven't seen mentioned much is: I'm a touch typist, and I hate having to switch between mouse and keyboard! I have to take my attention off the screen. Slows me down. Disturbs my concentration.

With Emacs, I can work for hours without ever having to hunt for the mouse, or without even having a mouse plugged in. That's particularly nice for using my Ubuntu laptop on a lap desk, leaning back in my armchair. The best mouse is no mouse at all.

Yes, I know many IDEs have shortcut keys for some commands, but the basic assumption with GUI applications is that you have a mouse. Even if you learn the shortcuts, somehow you always end up having to use the mouse for some common task, e.g., to select a paragraph. That's why I never got to like a GUI IDE, despite having had to use Eclipse for years.

sirsuki · 9 days ago

I found I am unique, I never learned to touch type but at the same time reaching for a mouse really slows me down. I realized years into using Vim that the reason I love it so much is that I can do all my editing from the keyboard and because it is a deterministic state machine (modal) I can have a mental copy of the editor running in my head while I'm not looking at the screen. This is important to me because I look at my hands while typing. When I use GUI editors like VSCode it pops up all kinds of fancy bells and whistles that when I return my eyes to the screen it no longer matches the mental model I had in my head and I have to do a huge context switch to re-sync; just like how I have to context switch when I reach for the mouse. Am I the only one has this method of typing/editing? Praise the creators for Vim and Emacs editors.

jeofken · 9 days ago

When I was implementing a toy editor I read the neovim source code and to no one’s surprise the modes are just long switch statements - when in mode M and input key is K, do some action. It’s a simple program and your mental model is probably close to the vim source code!

For learning a lot of cool stuff about implementing my best book is The Craft Of Text Editing

hibbelig · 9 days ago

All these friendly gooey things want to help you by popping up this kind of stuff. But luckily, some of them let you turn it off.

I've told IntelliJ and Eclipse and VSCode to please stop popping up suggestions, and let me type Ctrl+space to summon them.

Aaaah. Much better.

radarsat1 · 9 days ago

Drives me crazy that these types of programs always want to fill in the closing bracket for you. Like, as soon as you type an opening bracket, it sticks a closing bracket there. Completely interrupts my train of thought, why would I want the editor to assume it knows what I want and write things for me? Maddening. Especially something that messes with my internal thought process around the syntax "tree" that I'm trying to work out. I always disable it, but I have no idea how people put up with that. In Emacs on the other hand, it just highlights the matching bracket for you, so you easily know to type when you need it. Accomplishes the exact same goal without being so intrusive. I think there's a UX lesson to be learned there.

psandersen · 9 days ago

I also find moving hand to mouse is a really frustrating context switch, so I ended up getting a roller mouse ( to use along with my main mouse. The idea is for lots of small things my hands stay at the keyboard but my thumbs can move the mouse so I don't incur a context switch.

mellavora · 9 days ago

You are unique, but not in this respect. I write the same way, with a mental model of the editor state an integral part of the coding process.

derekjdanserl · 9 days ago

Honestly stunned. Thanks for sharing.

ziftface · 9 days ago

I'm afraid you are the only one

lawn · 9 days ago

I find it amazing how common it is for programmers to not be touch typists (I mean typing without looking at the keys). Like, isn't that something you pick up by the sheer amount of keyboard time?

mabub24 · 9 days ago

Most people get by with pseudo-touch typing. They have most of the speed down, and look down at the keyboard occasionally, but they do not have the accuracy that is displayed in true touch-typing.

lakkal · 9 days ago

That describes me. I described it once as 'highly advanced hunt-and-peck'. I did learn to tough-type in school, but I didn't touch a computer until the following year and simply forgot it all. That was 40+ years ago. I get by well enough.

bitexploder · 9 days ago

That sort of blows my mind. How can you not learn to touch type? It will take you a month at most and it greatly improves life at a keyboard.

BeFlatXIII · 8 days ago

IRC chatrooms got me much more comfortable with touch-typing than programming. There is too much time spent thinking when programming to feel slowed down by looking at the keyboard. IRC chats mean you have to be fast if you don't want the conversation to have moved on before you finish your message.

lokedhs · 9 days ago

I don't touch type in the sense that I don't hold my fingers on the home row the way I was taught back in school. My home position for my right hand is shifted by one column, and I never use the little finger for typing. My hands move around the kit more than what a touch typist would be do.

However, I still type easily without looking at the keyboard, and I'm about as fast as the average typist, perhaps faster.

Could I speed up more? Possibly, but I don't feel that I'm slowed down by typing speed, and I find my way to type better when one uses a lot of special characters, as is common when doing programming and accessing Emacs keys.

edgyquant · 9 days ago

I can type without looking but I still have trouble placing my fingers over the keyboard in the right initial place so I’ll often start a little off and I type so fast that I’ll type half a dozen characters before I realize and have to correct.

Mikeb85 · 9 days ago

Most keyboards have a little raised bump on the F and J keys ;)

Mikeb85 · 9 days ago

I'm not that old (30's) but we were forced into learning how to touch-type throughout grade-school. Pretty much any white-collar work requires it. Getting through university basically requires it (even humanities courses; good luck writing long essays without it). It's shocking that anyone who went through school in a developed country can't touch-type.

epolanski · 9 days ago

Which developed countries have courses in school to learn touch typing?

I have never, ever heard about it.

Edit: by touch typing I mean having your index fingers on fj and from there using ALL keys without ever leaving the starting position, and yes that includes shift, alt and control and special characters.

I know very few people who are really touch typists (I am a proficient one), and I don't believe for a second people are taught touch typings, it's a skill that requires consistent training.

BlueTemplar · 9 days ago

You're assuming that most of the writing is done on computers - but depending on the discipline - it isn't : computers aren't nowhere nearly good enough to compete with paper / chalk (/ even whiteboard !) when it comes to mathematics-heavy domains.

themadturk · 9 days ago

I suppose it depends on your definition of touch typing. Back in the early 70s, before many people had heard of personal computers, I was planning a career in journalism. I had to learn my way around a keyboard, so I took a quarter of high school typing. It didn’t teach me to “touch type” in the sense of achieving 100 word per minute or whatever, but it was the solid foundation I needed for typing in college, in my (too brief) journalism career, in office work and systems admin work. I’m reasonably fast, and I don’t always look at the keyboard, and no one has ever complained about it.

Keyframe · 9 days ago

I can type at warp 9, but never in my 30+ years with various computers and keyboards have I felt lack of typing speed or lack of laser focus on screen would be a drag on peogramming 'speed' or abilities even. However, it is a bit odd for someone spending few years behind keyboard not to pick up touch typing.. prime example being MDs.

2ion · 9 days ago

It is simple, really: There are also many piano players who cannot make confident and accurate movements on the keyboard without looking at their hands! My process learning how to type on a computer keyboard without looking was very much like the process I experienced while working on my piano skills over the years: You graduate from fumbling with your hands and exhausting switching between looking at your hands and the sheet music to sight reading to playing with your eyes closed (if you want to). Though a lot of advanced players can and do play without sheet music and sight reading at all, interestingly, a lot of those players then keep looking at their hands instead! because the music progression is strictly following their mental model of the piece.

chlorion · 9 days ago

It's worth mentioning that Emacs is not a text-only editor, but is able to function in a text only environment if configured to. I think many people never consider giving Emacs a shot because they think it's purely a terminal based program.

Modern Emacs can be (and mostly is) compiled with GTK support and features a GTK interface, but can be launched in text-mode with a command line argument. If you don't mind using bleeding edge versions, there is a branch called "PGTK" that allows the GTK interface to run natively on Wayland!

Mikeb85 · 9 days ago

> If you don't mind using bleeding edge versions, there is a branch called "PGTK" that allows the GTK interface to run natively on Wayland!

The two biggest Linux distros (Ubuntu and Fedora) are Wayland by default now. And the 'standard' Emacs distribution you install through the Software 'store' in both is GTK (which of course works). Wayland support isn't really a big deal anymore. I haven't come across any apps that don't work on Wayland.

d_tr · 9 days ago

Yeah, it is GTK but not pure GTK! It uses X11 drawing calls for some elements so it needs XWayland on Wayland. Pure GTK might be coming with Emacs 28 by the way.

vegai_ · 9 days ago

At least on Sway (with the scaling settings I use), fonts are a bit crap (blurry) on xwayland and perfect on native Wayland.

b3morales · 9 days ago

Also a keyboardist, and you can pry my emacs from my cold dead fingers, but I still think it would benefit from a bit more ability to incorporate platform-appropriate keyboard-driven GUI widgets/arbitrary drawing. For example, if the minibuffer could look like a regular GUI text field + a drop-down menu, or a floating command palette, I genuinely think it would be a nicer experience (and would make it "look more modern" which is not a terrible thing)¹. Similarly for the mode line and fringes. If some of the peripheral elements could be enabled to escape the "everything is a grid of characters" paradigm I think it would be a net positive.

¹I've tried mini-frame, and it's fine, but it's still just a utilitarian grid of text.

arkaic · 9 days ago

On your last point, in terms of absolute speed, pointing your mouse to the paragraph and dragging to highlight is usually faster than the fussiness of multiple key presses and/or chord combos needed from a full keyboard setup. That is, unless you've macro'd a custom single key shortcut for just that particular action

tikhonj · 9 days ago

Emacs has a standard shortcut for moving around in terms of paragraphs, so you don't need to customize anything. It's these semantic(ish) movement commands that really let keyboard navigation shine—moving around in terms of paragraphs, code blocks, matching delimiters is not only productive but also combines well with other commands and keyboard macros, which makes a lot of repetitive things easy to automate in Emacs but difficult anywhere else.

spicybright · 9 days ago

I have no problem going keyboard to mouse, but mostly because I use a macbook with touchpad exclusively. Reaching my thumb down right below the space bar to use the mouse is really not a big deal.

arkaic · 9 days ago

+ and basically I would generalize this across to all the common actions people typically use that are often easier with a mouse. And can even be faster, even with the extra hand travel to the mouse.

FpUser · 9 days ago

Never mind being "touch typist" I completely suck at typing in general. I think my cat could do a better job.

Still I hardly ever use mouse when using IDE's like Visual Studio C++ coding for example. It has shortcuts for everything.

xhevahir · 9 days ago

I just started using VS Code a lot last weekend and I didn't find myself using my trackpad much. The Vim plugin, whatever it's called, allowed me to do the same things I do in Vim itself. I can't speak to the Emacs emulation, though, now that I think about it.

__jem · 9 days ago

IntelliJ has a M-x equivalent and IdeaVim covers text editing. I literally never touch my mouse when using the IDE. I really don't think this is a compelling argument.

justinhj · 10 days ago

Great to see lists like these. I’m a long time Emacs user and recently learned to use neovim. I made the same mistake many new Emacs users make in that I installed a lot of plugins at once and lost control of the editor. Only by installing packages incrementally after you have discovered a real need, can you keep mentally on top of what your editor is capable of.

bloopernova · 9 days ago

This is a very good point. I first tried to jump in Emacs by using Spacemacs, and was overwhelmed trying to manage the fairly huge and complex init.el that Spacemacs produces. I also had lots of trouble before realizing that Spacemacs and vanilla Emacs package configurations should really be treated as separate and not mixed together.

I'm sure if I went back to Spacemacs now, I'd understand things a whole lot better, but as a new user, it was far too much to figure out at once.

So I went Vanilla, and haven't looked back. I do think that there should be some more articles out there like "so you've decided to try Emacs? Here's what to do beyond opening and saving documents". With a heavy emphasis on, as you said, incrementally adding to your configuration. Something like "here's why you split your config file into 2, with automatic changes going into one file, and manual going into another" followed by "here's use-package" and "if you want to X, here are Y packages that do it" with comparisons between each different way. But broken down into small chunks so things can be done incrementally.

epolanski · 9 days ago

I second this, I started with spacemacs, and then reinstalled clean emacs to get a good grasp of it.

inetsee · 9 days ago

I love emacs because of org-mode. I have sometimes wondered whether emacs can do something I have often wanted. I write poetry. If you write with pencil on paper the edit marks (line through, move text, insert) let you see the evolution of a work. It's hard to get the same effect with a text editor. After reading this web post I went searching for "emacs edit history" and I discovered "undo-tree". This is a perfect functionality for my use case, and another reason for me to love emacs.

submeta · 9 days ago

After spending endless hours in learning the ins and outs of Emacs and starting to learn Elisp, I come to realize that Emacs‘ tinkering-to-doing ratio is too high. I need tools that get out of my way. Emacs can get a hobby or an obsession. If you have nothing else to do, fine, spend your time sharpening the saw instead of cutting wood.

I turned to VS Code + PyCharm for coding. And use Emacs for editing text only. And for that, it is excellent.

What I love about Emacs most is the macro recorder. Whenever I have to transform text, I record my steps in Emacs‘ macro recorder and replay the steps. That’s like magic. I wouldn‘t even bother writing a Python script for these one-off transformations.

BeetleB · 9 days ago

> I come to realize that Emacs‘ tinkering-to-doing ratio is too high.

You are in full control of how much tinkering you do, though. Strange to blame a tool for this.

tom_ · 9 days ago

But most of the things you do require a certain amount of tinkering, even basic stuff like setting up C indentation, making Emacs not use tabs, and configuring keyboard shortcuts - especially in the early days, when you might not quite understand how things fit together.

Compare and contrast with Visual Studio Code, which has a much smoother onboarding experience.

BeetleB · 9 days ago

Agreed about the onboarding experience. However, the person I was replying to seems quite well versed in Emacs.

ordu · 9 days ago

Much more strange when a tool blames its users for their unsatisfying experiences. It is tool is made for user, not the other way.

clircle · 9 days ago

BTW, the author is using the Modus Operandi theme for Emacs. It's really easy on the eyes (high contrast) and comprehensive. Oh, and it's beautiful.

Shout out to Prot who maintains it.

justinhj · 9 days ago

I use it too, highly recommended

NeutralForest · 9 days ago

True, Prot is the man

animal_spirits · 10 days ago

Sometimes I wish I initially spent my time learning emacs. Vim has been great to me. I don't value programming workflows as much as I used to so I'm not going through that steep learning curve again

dotancohen · 10 days ago

  > Sometimes I wish I initially spent my time learning emacs. Vim has been great to me.
Try SpaceMacs, or even just Evil. I've found that Emacs (the text editor environment) and VIM (the language for interfacing with a text editor environment) skillsets are actually complimentary and together form a terrific text editor.

srcreigh · 9 days ago

If spacemacs or evil seem too inauthentic or complicated, I suggest boon-mode. It's a very simple, modular, minimal modal editing package with verbs and motions.

jb1991 · 9 days ago

And if you like modal editing but want to stick to a more emacs-centric interaction, there is God mode which I eventually found to be better than evil if you are working solely within emacs.

hvgk · 10 days ago

Conversely I feel I wasted my time learning emacs and moved to vim eventually. I also only religiously use a subset of vim functionality which is fulfilled by most of the vi equivalent editors. This turned into a massive advantage for me as I spent most of my career dotting around random Unix and Linux machines doing admin work. Vi derivative is always there and the muscle memory was ready to go.

One of the key things I found though is that I learned to compose tools outside of vi rather than rely on the editor functionality. This was applicable to much larger problem domains than just editing. The Unix philosophy of using lots of small well defined things to solve problems applies to editing text.

cyberbanjo · 9 days ago

FWIW if I can ssh I can use emacs tramp to edit remotely, if there's latency lag, it seems similar to using local editor.

spicybright · 9 days ago

I've done SSHFS to fairly good success for this too.

kovek · 9 days ago

I really like to use code-server instead

zingar · 9 days ago

I think you get a lot just out of knowing modal editing. Sometimes I don't even realise what is emacs and what is vim because of evil keybindings.

rthomas6 · 10 days ago

You may like Doom Emacs. It has really really good Vim keybindings. Some people like Spacemacs too, but I found it too bloated and too abstracted (hard to fix when it breaks).

I still find myself reaching for Vim when I want to just write a simple script. Emacs, VS Code, etc. can just be too much sometimes.

zingar · 9 days ago

I had a pretty full featured vim setup (creaking under the weight of all those plugins) and then switched to spacemacs. You're exactly right that debugging was a pain sometimes, but once I started to figure out what everything was, I wanted to replicate everything I had in vim.

I realised that if I'd started minimal I would have reinvented so many of the spacemacs wheels, but done it worse.

Spacemacs could do with being slightly more user friendly. It gives you a lot of friendliness already, but to prevent people from being frightened off by emacs' formidable reputation it really needs to "work" out of the box. For me that would be one click install and a reasonable suite of IDE-like features for working with a given language pre-configured. That would include scripting to install the command line tools that they shell out to, e.g. ag or rg.

dfinninger · 9 days ago

Have you looked into emacsclient? If you have emacs running you can connect to it in the terminal so that there’s (practically) no startup time.

It replaced vim on the cli for me.

Y_Y · 9 days ago

> I still find myself reaching for Vim when I want to just write a simple script. Emacs, VS Code, etc. can just be too much sometimes.

I used to do this too. What stopped me was that I often use emacs as a terminal multiplexer with vterm, and it becomes super difficult to control vim if you have evil-mode capturing those same inputs. In the end oh-my-zsh (more crappy bloat like spacemacs which I love to bits) has an alias called "e" which will open a file for editing in your current emacs.

(If only it worked through docker! Or maybe it does and I just don't understand TRAMP well enough yet.)

hwestiii · 9 days ago

As far as I know, pure vanilla emacs from GNU comes with multiple vi emulations. I’ve been using viper for 20 years. It’s the only reason I use emacs at all. I had a co-worker many years ago who swore by emacs, but I found the key bindings completely counterintuitive having learned vi while getting my degree. Having made that discovery I was off to the races with emacs, and have never looked back.

jb1991 · 9 days ago

Amazing that I have not used emacs in years but I wanted to see this artist mode with my own eyes, so I opened it and was surprised I could still remember how to get all around with the m-x commands... my muscle memory even remembered the combo to exit emacs correctly, and even as I type this, I couldn't tell you what that key combo is! It's all in my finger muscles' memory. Incredible.

pantulis · 9 days ago

This is what Emacs does to your brain. Dont know if that's a good or a bad thing, mind you.

My first serious Emacs engagement happened in 1996, with XEmacs. Then it became my editor of choice for basically two decades. I can confidently say that I can open your Emacs setup and manage my way around it (unless you happen to be an evil-mode infidel, that is).

mlaretallack · 10 days ago

I really respect people who can use emacs (and vim, vi etc...) they wiz around doing allsorts and make it look effortless.

The only reason I have not tried is I seem to spend most of my time thinking about the change, and the time saved is easily wiped out by the time taked to re-write the line 5 times.

reddit_clone · 9 days ago

You don't really have to. Try DoomEmacs or something similar, very little tinkering needed to get going.

Blackthorn · 10 days ago

Oh damn, I had no idea about undo-in-region. That's so convenient and it comes with Emacs stock. Wish I knew about that years ago.

bloopernova · 9 days ago

I've been using Emacs for about 4 years now, and some of the stuff on this list was news to me. Thank you, OP, for sharing this; I found it useful!

Kototama · 9 days ago

Same, more than 10 years and I really should have known M-\ earlier :-) (or remembered it, I think I read about it earlier).

The thing is with Emacs, you can really optimize every key stroke if you want, but usually I'm too busy using it to program so I optimize the workflow only time to time.

pama · 9 days ago

Some of the very recently upgraded batteries in standard emacs include describe-bindings (C-h b gives a neatly organized, foldable output that greatly enhances discoverability) and emoji-insert that uses a neat selection interface.

Y_Y · 9 days ago

For discoverability I love using helm with M-x (or SPC-SPC). I just think of a function I might like to call, like "git fetch" or "sort lines" or "render latex inline" or anything else, and pretty quickly I can figure out what it's called and what its shortcut is for next time. I take for granted that it exists.

pama · 9 days ago

Helm is great and I still use it occasionally even after I recently transitioned to using orderless, marginalia, consult, vertico, etc. for most things like that. C-h b has become my recent goto for inspecting the keybindings on various modes; I used to do C-h m, but the new interface of describe-bindings is neat.

wrycoder · 9 days ago

326 lines long!