danielde.dev/blog/what-emacs-got-right
What Emacs got right, or how I wish modern apps were more like a 50 year old text editor
The key combinations make a lot more sense if you use the keyboard it was designed to work on.
To be fair that is a keyboard for people with 15 fingers.
Incredible that it had the like and dislike button integrated. /s
RUB OUT 1
nice
The rare cognitive dissonance button!
Super and hyper buttons!
I still don't know a good way to type out things like unicode fractions. It's endlessly annoying
Vim users can use digraphs
e.g., ctrl-k 1 2 gives you ½
Holy crap. I've been using vi (not vim) since the early 80s (I'm old) and never knew this.
To be fair, there was no unicode then.
there was no unicode
Sometimes I'm in awe of the hardships that our elders had to live through.
all praise Rob Pike
That’s nothing, the ancient developers would type their programs on punch cards.If you dropped the deck you might get a whole different program.
I've done that as well. The secret to unscrambling the deck was sequence numbers. I think they were in the last 8 columns (1-72 for code, 73-80 for sequencing) depending on what language, OS, etc. Depending on your organization there were a couple of options for a dropped deck.
Some places had a mechanical card sorter, though it wasn't as simple as dropping a scrambled deck in at one end and getting a sorted deck out at the other. To simplify, you'd sort the deck based on one of the digits (I think you started with most significant, maybe it was the other way around), then take the result of that and sort on the next digit, and so on. (Sorters had at least 10 stacking columns, but pretty sure it was a lot more). Eventually you'll pick up the pile of cards from each column starting at one end of the sorter and going to the other and you'd have a sorted deck. I had a job as computer operator and we'd have to sort around 10K cards every 2 weeks for the payroll system. They weren't punched in sequence, but were done by a room full of keypunch operators, and they had to be sorted before they could be used as input. I recall it would take more than one shift to do this.
The other way to sort a scrambled deck was relatively high-tech. You'd feed the cards into a program that would sort them by computer, then it would send them to the card punch. That required a card punch device that could be driven by the computer (not just an IBM 029 punch), and the ability to be able to run the sort job.
You young whippersnappers have it easy today. Do you know how it was to leave a comment on reddit using punched cards?
I didn’t actually work with cards. My first computer class used them. Then they went to terminals with a long roll of a paper, then crt terminals.
The first computer I used was an HP 2000C. It was a timesharing system that was shared among a bunch of the high schools in the area; none could afford their own system. We access it using a teletype (ASR33, to be specific) which has those long rolls of paper that you may be thinking about.
I've hand-assembled and toggled in assembler into several different systems, including an IMSAI 8080 and an IBM 360. You could kind of edit if you had to change something but if you had to insert anything you had to manually re-enter anything below that. Deleting was easier, you just used a NOP (no-op opcode) which says "do nothing".
Does that count as a good way, though? In terms of the memorization involved just for one editor…
Configure a compose key.
I use Right Alt.
Then it's compose, 1, 2
Yen symbol: compose, Y, =
Cent symbol: compose, c, /
It's dead easy and almost all the keys can be guessed without memorization.
i use right super
There's ways to setup a keyboard layout, often with 'dead keys', that allow fairly easy composing of Unicode characters if you're OK with having one of the keyboard keys turn into another toggle (Shift-style) key. Usually it's assigned to the right Alt key.
Then you can type Right-Alt, 1, 2 in sequence and get ½
That sounds nice, but I don't know how to use it. It's something I think should be supported by text editors tbh, although I guess it's not something IDEs ever need.
Dead keys are usually supported at OS level, is how non-English people usually type their symbols when using an English keyboard.
Keymap US International.
There are basically two ways to do it: - either with dead “accent” keys that automatically combine with the next “letter” key, but give the usual character when the next key doesn’t match a known combination (so apostrophe e will yield é but apostrophe t will yield ‘t) - or with Compose where you have to use the Compose key to get the accent key to work as a dead key.
The second one has the advantage of being a perfectly normal keyboard as long as you don’t use the Compose key, but the disadvantage of having to use more keystrokes to get the special characters.
compose key
wow I been using emacs for 20 years and didnt know that. Thats why the functions are called hyper, meta, super and all that. Those were the names of actual keys on the keyboard where it was designed. Duh.
I really want to build a fully functional modern version of it, but I don't really have the hardware skills for that.
You can buy new ones, but they are expensive.
They have some keycaps on ebay. But the physical spacing for the keyboard would be a custom build I guess. Still really cool to know though.
r/mechanicalkeyboards has grreat info
It really doesn't. What combinations are hard in Emacs? Most of them use control which is a very good button for just about any keyboard. Things like C-x u are pretty easy to memorize since a lot of them are grouped logically and all of them start with C-x.
There's many basic functions that require even three modifier buttons - e.g. C-M-@ (ctrl+alt+shift+2 on normal keyboards) for query-replace-regexp. I've been using Emacs for 5 years, and got an ergonomic keyboard just to make this doable.
To be fair, there's combinations on a modern mac that require 4 key cords (3 modifiers) that I use every day. The most frequent one is "screen capture to clipboard" (or whatever it's officially called), which is <whatever the windows key maps to on a mac>-Ctrl-Shift-4.
Ummm.... Why is there a
RUB OUT
key??
Have you ever used a pencil and eraser? In some charts of the world, an eraser is called a rubber (you rub it on the paper). E.g. In the UK, you "rub out" (erase) mistakes.
DING DING DING 😅
It can mean two things: https://www.youtube.com/watch?v=vS3kC6yJdZY
clearly its a shortcut to onlyfans
that's what modern backspace would be the equivalent to. Even a bunch of videogames of the 80s/early 90s have "RUB" instead of "DEL" in their text inputs
Rouge is probably based on the same keyboard as vi: https://www.reddit.com/r/vim/s/tydr42L68g
Rogue uses vi-keys, right? I don't know if vi had any particular influences.
The "rub out" term is from traditional typewriters, where "move the cursor back one character" and "remove the current character" were different keys. Since many typewriters couldn't actually erase a character, if you made a typo you might correct it by moving back and typing the correct character over the incorrect one, or by moving back, marking the incorrect character to be ignored, and typing the correct one at the next position - so the two operations had to be separate keys. High-end typewriters might actually erase the current character on "rub out", while more mainstream ones would just overprint it with an X or similar.
You're probably right that it's targeting punch cards on this keyboard. The punch card equivalent to "remove the current character" was to punch all of the holes at the current character, which signaled the computer to skip that character when reading the card. That made it into ASCII, where code 0x7F - binary 1111111, all positions punched on a 7-bit punch card - is the "delete" character. (0x08 "backspace" is more commonly used on modern systems.)
It definitely helps to keep some extra pinkies around as hot spares!
The joke I always heard back in the day was that it was a great OS, just a shame they forgot to include a text editor.
(E)ight (M)egs (A)nd (C)onstantly (S)wapping.
From a simpler a time :D
Also, (E)scape (M)eta (A)lt (C)trl (S)hift
Generally Not Used Except by Middle Aged Computer Scientists
I feel so seen ☺️
I still use emacs, and my feelings are now hurt
GNU/Emacs
They ported vim to it ages ago, it's called evil-mode. When I used emacs, I only used that and it was a better vim than vim.
Ergonomic keyboards like the Kinesis definitely make command/macro focused work at lot easier
Or just swap caps lock and control, it’s a massive improvement.
After wearing out the remapped caps lock key on two keyboards, I bought a Happy Hacking Keyboard (they're stupid expensive unless you find them on sale) to solve this problem.
Yeah, programmable keyboards are also a good option, just expensive. I’ve got a ZSA Moonlander that I never go without, even when I travelled for work I brought it with me.
Me moments ago: they're not THAT expensive.
*Looks at $400 custom keyboard.
Me: ok but this was an exception
Why? You can choose any keyboard layout that you want. You can have everything or you can be minimalist. Completely configurable and you could have it flip configs according to file type.
Starting from scratch is hard. I used a layout based on an old character editor I knew called EDT that used the numeric keypad. I used that also to get her with some successor editors such as EVE and LSE.
Then I then kept adding additional stuff to it. It was great.
I stopped using it when I stopped coding so much and had issues taking my environment with me.
Fortunately, Emacs will also be the first to tell you that no one should be forced to use the default Emacs keybindings if they don’t want to
Heck, you probably don’t even need a keyboard
I never understood this joke. You can literally access every feature with a single shortcut, Alt X, which displays the list of commands.
Keybindings are very customizable in Emacs. If you prefer a Vim-like experience, Evil will do the trick.
Its great if you use a split keyboard with thumb keys like the kinesys ones. Hit ctrl with your thumb
Luckily there’s evil https://github.com/emacs-evil/evil
luckily there is vim
Escape Meta Alt Control Shift
I would actually say the opposite. How am I supposed to reach Home/End/Page Up/Page Down? That is for a third hand. With emacs keybindings, I don't have to move my hands from the standard position.
EMACS - Escape-Meta-Alt-Control-Shift
YES you said what I am thinking. For years, I was using emacs for everything. When I switched to a Dvorak keyboard layout 25 years(!) ago, my primary difficulty using emacs was the chording. It wasn't a easy transition, because the "x" and "c" chording with the "<CTRL>" couldn't be done with one hand anymore. Sure, I can reconfigure keymaps, but I even found that to be impractical.
I was using emacs less and less. Vscode was replacing emacs for programming. I didn't exactly like doing that, but I was impressed with some of its features. I was also using vim more and more, mainly for simple stuff. I do like the general philosophy of minimizing keystrokes while maximizing efficiency. Vim does this well with less chording.
However, emacs was so much better at customization. I think elisp is great (being a lisper myself). Vimscript is just "meh". It wasn't until last year when I started using Neovim when I am actually thinking about putting emacs out to pasture. I think embedding Lua into a vim clone was not a bad choice at all. It provides that customization level I think vim proper really needed.
I've got 20
Hmmm..... Emacs is great, period?
I've been forced into vim, so using that a lot lately. But came from emacs, and was always able to do everything with it. And I only sport 10 fingers!
What's not working for you? Genuinely first time hearing this type of criticism.
It's just a mindless joke people repeat, emacs came from an era where keyboards were different. They came with a Meta key and an Option key and a Super key and a Hyper key and so forth. https://en.wikipedia.org/wiki/Space-cadet_keyboard#/media/File:Space-cadet.jpg
So now that keyboards lack those features emacs key commands can seem bizarre to people, but it wasn't always such a leap for people, they just hit another key and kept typing.
Awww. I'll admit that it's an old joke, from the days of DEC VT100 terminals, but it's based in truth.
Wow that keyboard looks like it's actually useful for programming.
I heard about some later keyboard, where the control key is placed where caps lockis now, and thought it was the one for whivh emacs was designed for. Haven't seen the Space cadet keyboard, thanks for showing it. It looks fascinating.
perhaps you are thinking about Sun workstation keyboards, like this one
https://deskthority.net/wiki/Sun_Type_4
the space cadet keyboards are legendary, i've never seen one in the wild. would love to have one.
Thanks for sharing, a new thing I learned today!
I grew up on emacs myself and about five years ago started learning vim finally as I realized how common vim key bindings are in common "modern" applications.
I uh am a convert.
I much prefer smart IDE editors for developing code. IntelliSense in Visual Studio saved me so much time.
But when I was using text-only editors I used vi.
Fortunately, you can configure VSCode (and, in fact, all modern text editors) to control just like vi.
Emacs is great esc : wq
Any time you want to use :wq you could probably use :x
Cool tip. Didn't know about :x
Did more with vms than unix/Linux. So lots of "do" key save
He he he
I chuckled loudly. Thank you.
The risk of RSI is why I don't use emacs.
Yes, I know there are ways to bolt on vim modes but none of them work well, and configuring modern emacs is a nightmare. You can find countless posts about how to do something that no longer work, or break everything else. Yes, I know about spacemacs, it doesn't help it just makes the abstractions leakier the moment you do something not directly on the happy path (which you already aren't by using a vim mode at all).
Vim modes in more modern editors + neovim for the terminal are more than adequate, and considerably more stable / straightforward.
I agree with the author’s points - that everything is a command, everything is editable, and there’s a scripting console for you to run things immediately - isn’t that all true for VSCode as well? I don’t use VSCode completely mouseless, but I get the impression that you could.
Not exactly. In emacs, you can run basically any elisp function as a command from the UI. In VSCode, you can only run specifically defined commands. If something is not exposed as a command, you’d have to write an extension to expose it.
On the point of extensions, with emacs you can always write some elisp in a config file to add something. With VSCode, you have to create an extension project, use bundlers to compile and bundle it, etc.
And if it doesn't work, sometimes it just doesn't work and you have no feedback?
Looking at you, terraform from 2021-2023, who just didn't autofmt that whole time with no errors.
There are generally descriptive errors, logs, etc to troubleshoot issues. Emacs is so transparent about what it is doing, you can narrow problems down pretty quickly. And at that point /r/emacs or chatgpt can help pretty reliably.
If something is not exposed as a command, you’d have to write an extension to expose it.
But you might not be able to, because the VSCode API is significantly more limited than the elisp API.
you can run basically any elisp function as a command from the UI
No, only those marked as interactive functions.
This is useful since if you want to bind a function to a keyboard shortcut you only want the completions to be for those that make sense (eg. not show string-join)
In any emacs buffer that is not read-only you can type and evaluate
(global-set-key [f2] 'string-join)
When you type f2 you get: Wrong type argument: commandp, string-join
Make it interactive to call string-join
(global-set-key [f2] (lambda () (interactive) (string-join)))
Press f2 to have it complain about missing arguments
Indeed, but just to mention you certainly can also evaluate any elisp anyway at a whim with M-:
(eval-expression) etc.
There's also IELM nowadays - that's a REPL for ELisp itself within Emacs, if you want to use it that way i.e. works a bit more like various Common Lisps and Schemes (and python/ipython) etc. Sometimes useful for extended exploratory interactions.
i know this for a fact thanks to evil-mode
Haha! Funny story about that -- back in the '90's I worked a job at Data General auditing the AT&T C standard library and some relates apps they licensed and were modifying for a B2 secure platform. I was a fairly solid Emacs user and a coworker of mine started using it. Then he audited the vi source code and started to prefer vi. Not vim, mind you, old timey vi. I told him about evil mode, and he started going through and documenting the differences between how that worked and how vi worked.
Even though I preferentially used Emacs, you kinda had to know vi if you did a lot of work with the various proprietary UNIX variants, as it was the only thing that was pretty much guaranteed to be installed anywhere. I still bust it out every once in a while and my fingers still kind of remember how to do regular expression global search and replace with it.
I bet you can still fast-dial your home number on a rotary phone just by knowing how long it took for the dial to spin back to position 0.
Well, I remember the AT&T monopoly breakup from back when I was a kid, but rotary phones kind of stopped being a thing almost immediately after that happened. I seem to recall that phone companies all stopped recognizing rotary signals in the late 80's or early 90's as well -- I was finally able to stop configuring our modems to work that way in my first job, as DTMF was unreliable at some of our remote offices before that point.
Your post made me remember all of those ads on TV that used to talk about "touch tone telephones". https://www.youtube.com/watch?v=SzL6j4m0M9c
or by tapping quickly on the hangup nubs
And most modern IDEs have some sort of vim mode. All the JetBrains ones for instance.
yeah, but that's not vim. As someone who's primary dev environment has been tmux, vim, and bash for decades, vim mode on any ide is severely lacking.
I hear this a lot, what's missing? I would assume lots (all?) plugins are out?
It's not (just) about the plugins. To a "native user", "Vim/emacs modes" feel only like "remapped hotkeys". They bring nothing of what the posted article espouses about these editors.
I've used vim motions on vscode and pycharm for years now and never used vim or neovim directly except for when something like git throws me into it. I really can't think of what the IDEs can be lacking - to me it seems that vim motions are the only truly useful part of vim, and the IDEs have that.
never used vim or neovim directly...to me it seems that vim motions are the only truly useful part of vim
No offense, but your opinion is kinda worthless then and entirely wrong.
There's a lot more to vim than just the motion movements that IDEs sort of halfway implement. There's macros, autocommands, ftplugins, custom mappings, abbreviations, and then all the custom scripting you can do to customize the look, behavior, and actions of vim.
I have a lot of custom filetype dependent scripts that are mapped to custom key bindings. For example, I have a single key mapping (Space-L) that will insert a logging call specific to the filetype I'm in... eg. in a php file it will be an error_log() call, in a js file it will be a console.log(), in a bash script it will be an echo, in a python script it will be a print()...etc. It will automatically format the logging call to include the line number and file name of where I'm making the call and will add a key/val pair of the variable that my cursor is on when I run the mapping. In some files, it will include specific data for that filetype...eg. in a php file, it will also include the pid of the php process that is running the script. It's very useful as a quick debugging method.
I have other mappings that will convert camel to snake case, snake to camel, kebob to camel, kebob to snake...etc.
I have a mapping that will save my current session (ie. every file i have open, my current locations in each file, the current configuration of how i have each file open (eg. tabs, windows, panes..etc)) to a file named after the current local branch I'm on. So context switching between branches is quick and easy. I just start vim by loading the session file for the branch I'm on and it will put me exactly where I was when I created the session file with everything open as I'd saved it.
I have abbreviations that are filetype dependent. For example, typing forr<SPACE>
in a php file will insert the boilerplate for a foreach ($ as $)
and leave my cursor on the first variable so I can start typing the name of the iterable I want to loop over... in a js file it will do the same but with a it will be a for ( in )
structure...etc. Likewise, I have similar abbreviations to insert if
, if/else
, if/else if
, switch
...etc blocks in the correct syntax for the filetype I'm in.
I frequently use macros to record a series of keystrokes and replay it as many times as needed on the current buffer. And then I have a mapping that will run a given macro on every file in my buffer list. Quite useful when refactoring.
I also have mappings and autocommands that run scripts that interact with tmux and git in various ways.
This is all vanilla vim, and I've not discussed any of the plugin functionality that I also use.
Maybe IDEs can do this kind of stuff, I don't know. I haven't really used an IDE since college 18 years ago. Maybe both of our opinions are kinda worthless then.
Edit to include registers! One of the features I use all the time. You have a lot of different general purpose registers that you can yank text snippets into and then access those saved snippets via macros, mappings/scripts, or just plain old commands.
Half of what you mentioned can easily be done in VSCode or Jetbrains, and the ones which can't don't sound particularly useful or worth giving up all the IDE pros for. If you've been using vim/tmux for decades and your most recent development is just changing vim for nvim, then maybe you just lost touch with modern advancements in IDEs. I really mean it that it is trivial to do half of what you mentioned.
the IDEs lack the same approach to text editing. you claim the "motions" are the only useful part but it's akin to saying you can get by speaking a language by only using subjects & verbs.
vim is a language for manipulating text, so most emulation layers can't incorporate everything without basically re-inventing vi/m
The big problem ime is that VSCode is slow as hell because of the javascript backend. Basic vim emulation feels really bad because of how long it takes to react to your inputs, and if you try to start doing anything fancy it just gets worse.
Edit: I don't use emacs so this comment was comparing to vim which has many of the merits the author mentioned in the post
It's only a superficial vim emulation anyway.
Trying editing a column, then use .
to repeat the action on another column, and it all goes haywire.
IntelliJ's columnar editing with their Vim plugin works much better than in VSCode.
I was assuming IdeaVim was just the much more mature project and it is technically: 14 years old. But vscodevim is almost 10 years old at this point so there's not much of a reason to not have full parity or close to it. Especially given that vscodevim has 3 times as many contributors
VsVim is also kind of trash. IdeaVim and jVi are the only really good ones I've encountered.
Have you tried neovim-vscode? I hated VSCodeVim for the reasons you describe, but neovim-vscode works really well for me. Somehow it embeds neovim into VSCode so it's actually doing vim things, not faking it.
This is a native feature of Neovim — it is meant to be run in server mode for exactly this reason
embeds neovim into VSCode
😱
We must go deeper.
Yo I heard you like editors so I put an editor inside an editor that's actually a browser.
I've found that vscode-neovim gets confused by VS codes auto indent. Where neovim thinks the cursor is, and where it actually is, end up not being the same place and the file gets corrupted.
The big problem ime is that VSCode is slow as hell
Compared to what? I've never had issues with speed in VSCode. In fact, last time I did any sort of benchmarking, I was beating most people's startup times for vim.
It's not startup times, it's the input lag. When I use the vim emulation it feels like walking theough molasses, and the constant popups and hints break my train of though.
Edit: Also what do you mean it beats vim startup times? Vim is basically instantaneous, whereas VSCode has to load all entities on first boot. Once you are up and running is fast enough, but on first boot it takes probably a second to get everything configured.
Yeah people love saying VSCode is slow but in my experience that’s just not the case. There’s reasons I don’t use it but being “slow” isn’t one of them.
I think it's just part of the "lol electron slow" meme. I've realized that a lot of people don't really know very much, they're just good at regurgitating memes.
Nice way to derail what I said lol. I'm talking about vim emulation which feels like walking through molasses. I understand some people don't care or haven't experienced faster editors, but it feels incredibly slow and cumbersome.
Uh, which Vim emulation plugin specifically were you using? I remember using the most popular vim plugin and everything was sluggish like you said, but then I switched to the embedded neovim plugin and it's been much better. I only use the javascript-based vim plugin as a clutch when neovim isn't available on the computer for whatever reason.
I've heard some people tell me about that here and it sounds interesting. I still don't think it will be enough to win me over but maybe I'll give it a shot.
Compared to vim. Just ran a quick test, 70ms to start and quit, and I'm using lots of plugins too.
As someone who used Emacs for about 25 years, to me VSCode is kind of a spiritual successor.
In what way? They aren't that similar.
Looks like all points in the article fell to deaf ears :( The author even mentions in the end that VSCode (as it's based on Electron) could probably expose an architecture similar to emacs for "extensions" by just letting you define JS functions and call them via keyboard shortcuts (or the Command Palette)... and also expose commands like emacs does for doing literally everything (which is the hard part in the case of VSCode as I'm pretty sure they can't just do that easily)... but people are just ignoring all that and saying VS Code is "so similar" :D when it just isn't.
With vscode you often get too far with this approach.
You type and the editor tries to help and pops up an autocompletion. which often stays after you finished typing as the word is part of that autosuggestion. Now you need to reach for escape to get rid of it.
thats just an example. There is a ton more like tab controls iteration does not make sense and jumps to not really useful control instead of the next edit box in for example replace dialog.
Modern editors are often half baked and left in that state for ages...
I don't think it is 100% there, but an interesting app that does at least a fair bit of this is Blender. There's a command palette, you can script stuff with python, and get it to tell you the script version of the command you just ran with hot keys/etc.
The feature that I haven't found anywhere else is undoing specific areas of text.
Makes it easy to undo functions even if it was hours ago.
Yes! I SO badly want this in other apps I use. Such a brilliant feature.
that's clever
winnum, occur mode, (undo tree?)
so many great features seem to have started in emacs and been adopted into other editors.
neovim explicity lists emacs as an idea farm.
Does Emacs have the vim command :earlier 8h
to set a file back in time 8 hours? That would be nice.
But by far my favorite vim command, which increases my productivity more than anything else, is the :later 8h
command, to automatically complete 8 hours of work. I'm really annoyed that no other text editor has thought to implement something similar.
It has M-x butterfly
The nicety of emacs has nothing to do with the commands, the ability to change and customize things, etc, for me. It's the editing. The editing is simply better than every other text editor I have ever encountered. It's the collection of small features that are difficult to implement in your programs that are all just "correct" in emacs. You can go your whole time using it and not even notice how correct everything is, and how many things just "work" correctly. If you paste rtl text into the middle of ltr text and you start at the beginning of the text and hold the right arrow key down your cursor moves to the correct parts of the text when the rtl text is encountered, and when you get to the "end" of the rtl text the cursor continues where it should. Effectively zero other applications I've ever used get that correct, and it's just "one more thing" that emacs does correctly. And it's hard to get right in code -- it takes a lot of effort to handle text editing correctly and the contributors to emacs put in that effort. It's simply a superior text editing program on most fronts, and it really bothers me when people mindlessly joke about keybindings and so forth because they have no idea how monstrously difficult a thing it is to get text editing correct... It's absolutely stupid how difficult handling text correctly is, and how much mental effort it takes even to understand all of the intricate problems -- much less to solve them well.
If you are a professional writer – i.e., if someone else is getting paid to worry about how your words are formatted and printed – Emacs outshines all other editing software in approximately the same way that the noonday sun does the stars. It is not just bigger and brighter; it simply makes everything else vanish. - Neal Stephenson
Can't you make paragraphs with emacs?
I'm a professional writer, and I use Emacs to write everything I deliver, books very much included. Next deadline is Monday, then Tuesday, then Thursday. Two magazine articles and a scientific paper, all written in Emacs.
I'm also sometimes a developer, and I use Emacs for Java, Python, and C++ code as well. Configuration and documentation, too. Plus, using Git from Emacs is easily the best Git experience possible.
Please tell us you wrote that comment in Emacs!
Wish I could.
If you're serious, check out atomic-chrome :)
Does this mean that you're writing LaTeX with emacs? Or do you submit raw text files and someone else formats them?
It varies. For magazine articles I usually just write plain text with no formatting at all, then send the plain text. For scientific articles and books I write LaTeX. When I'm sending the text out for review I usually send PDF, but final submission is Word. I use Pandoc to convert to Word at the end.
My condolences about your field requiring submissions in Word.
A-men.
I was forced into vim by my Co, and got used to it, so not as much of a hater anymore. Some stuff vim has is also just great, like progressive search. But I'll go back to emacs at some point. Maybe I'll need to change jobs first though lol.
In my own mind there is no "vim vs emacs" dichotomy. They're simply different tools. I use vi, vim, emacs, hell I'll use nano. It just depends on the context of what I'm doing and where. I don't hate on vi because emacs is a good program, I just use vi for different tasks than I use emacs for. They're both great programs.
Don't disagree at all nowadays. In the past I was certainly partaking in the emacs vs vi feud, but got over that. They're both good, though my preference is still with emacs, if I was forced to choose one. Call it emotional attachment.
no love for ed?
Chuckle. I made a concerted effort to learn ed as a lark a few months ago and spent a couple of weeks where that was my editor instead of vi (I primarily use emacs but use vi for quick edits). While I mostly went back to vi for quick edits, I did keep ed for two usecases:
- editing files in scripts. This one's typical but under-utilized.
- git commit messages. It'll sound absurd but I like that you keep the terminal context.
I usually just use a second terminal and alt-tab between them to keep up state, but if you're just slapping in a quick update, remember
git commit -m "
you are not limited to a single line
for a -m argument
"
I was rather pleasantly surprised when I tried that out on day and it worked without complaint.
None. That ship sailed a long time ago for me.
None. That ship sailed a long time ago for me.
I heard it hit an iceburg.
edlin forever!
ed is the standard text editor
They're simply different tools
Different tools which both serve the exact same purpose. The only thing different, really, is the ergonomics of their shortcuts. If you have and are fluent with Emacs you have zero use for Vim.
That doesn't make either of them better or worse but it's just plain wrong to claim that they are nothing alike.
I am a mostly Emacs user. But I will say that once you understand the composabiliity of Vi--especially text objects--Vi can be just as efficient, and sometimes even more efficient. That's not reeally me, mind you, but if you watch someone who is a real Vi power-user, they are amazingly fast and efficient. Of course the same is true with Emacs.
(I say Vi, but that applies to any of the Vi family of editors: Vi, Vim, Neovim, etc. I expect it is also true of the other Vi-adjacent editors like Zed, but I'm not positive.)
In terms of straight text editing vi is amazing, thanks to the composable commands. Emacs is a better environment. I prefer Emacs overall, but I do miss the composability.
I’m interested by your answer and curious to know more about the types of of editing actions that emacs just “gets right”. rtl text is just not something I ever deal with so it’s hard to appreciate how nice that detail is (but I don’t doubt it is nice)
I just tested your RTL example on Notepad++ on windows and it gets it right. No shenanigans when trying to move the cursor with the arrow keys like in VSCode.
I find myself wishing for the Emacs or Vim architecture in almost every application I use.
Sometimes, it easier to just give up and use Emacs.
You use MySQLAdmin? I use Emacs for that.
You use Outlook? I use Emacs for that.
You use Obsidian/whatever? Well, there's Emacs Org mode.
Play tetris or snake? No problem, Emacs comes with both.
Visit a therapist? Guess what Emacs comes with ...
This sounds like an excerpt from that youtuber guy who makes videos like "Interview with an Emacs user". Spot on!
That was my first thought as well!
I sleep in a big bed with my wife I use macOS
in the past that "all is a command" ideology was present in arexx, microsoft recorder (predecessor of visual basic) and few other interfaces. It was good thing.
And then the ball was dropped and many of those interfaces disappeared.
Sounds amazing! Can I edit code in it or do I need you use gedit or vscode?
the visuals of today are impressive, but functionally we've regressed.
For some languages stuff like intellisense is a pretty big functional leap.
Emacs has that via LSP (eglot or lsp-mode)
You don't want a 300Mb advertisement taking cheap shots at your harline, virility, mental health or career every two paragraphs? What are you, some kind of ludditte?
my bad, i shall revise my point of view
I still use Emacs today to run macros on text files. There is no modern editor I could find where I could do that (which of course follows from command-centric architecture).
Yeah, macros are a feature I really miss from vscode and other editors. You can get some of it via multiple cursors, but when you've a repetitive edit to to, nothing beats just being able to do C-x ( <do the operations for a single line> C-x ), then C-u <number of times to repeat> C-e, and instantly be able to do the same operation on 1000 lines, even if it requires complex search-and-replace handling etc. Everything being a command means you can chain complex operations together and it'll play out the same way each repetition.
I thought my browser was having trouble. Turns out it's just that your font color is such a pale grey that my poor old eyes can hardly read it :( Please, black on white is fine, really. Hoping to read you!
This is something a lot of projects lack.
Having a DSP that implements a lot of "project goals" as smaller "commands". Then offering a way to compose these, with a little bit of configuration & flow control, gets you surprisingly far to implement a lot of future feature requests with zero effort.
Word to the wise: This can easily be extemely cursed. When done half-decently (have a half-assed type system and use a real parser combinator) it works surprisingly well and can be extremely pleasant. Stuff like syntax checking & dry-runs are mostly "exit early" on the normal program path. Everything that isn't "implement a new macro from the existing language" is generally "implement 1-3 new 'primitives' to wrap in a macro".
Edit: You can even save time by making your core "program" just be a LUA/Python module. Then you don't even have to implement a domain-specific-programming-language (but that's the fun part).
I'm pretty sure sublime does all of this.
Cursor manipulation may not be a command (although it probably is) but certainly everything is available via the API.
VIM FTW!
I also prefer vim but I've been around long enough to know that it's because that's what I learned in college and gained strong familiarity with first. If someone would have taught me emacs first there's a good chance I'd prefer it.
At least we can agree that nano fans are paste eaters.
Edit: I'm not talking about nano users. It's okay not to be passionate about text editors or just needing to get the job done. Nano is a popular, dead simple and lightweight text editor that is the default in many scenarios.
Yeah, we were forced to use vi on old sparcs and dec alphas in college. I think the dec alphas didn't even have working arrow keys. Had to use ghjk instead I think it was. Still my preferred text editor to this day!
Loved emacs. I did software documentation for CAD, embedded system compiler, FEA, BIM. I was also an Adobe Frame Maker wizard. I did a lot of conversions from Word to Frame (20-30 k files - this is number of files, not file size). With emacs (used mostly to 'cleanse' files) my productivity was unreal. Another person in the department (never a co-worker) was asked to convert a 350 page manual. Dude told boss to give him 3 months (2 weeks to finish current project, 2 weeks for project estimate, then 2 months with no other projects). Annoyed boss not happy with that answer. I was told, "''Bob', see what you can do." Completed the project in 1.5 days, 60 times faster.
I’ve got a few old GNU Make C projects for which I still use Emacs as the development environment because there’s no benefit in migrating them to anything else. They don’t get changed very often as they are at the “happy with the set of known bugs” stage. Always really cheers me up when I have work on one of them, though, coz I get to use Emacs again. Like going from cotton to silk.
“Emacs is not just an editor; it is a way of life.” -Overheard in a college CompSci lab
One of the amazing things about emacs is elisp isn’t a config language (like lua is), but it’s a programming language that the editor is written in!
Elisp is highly dynamic, introspective, and changeable at run time. It’s been like that for decades. Programming environments like python are still catching up to lisps run time dynamism - and it’s still not comparable, when I was doing python coding I had to restart the repl often to accommodate changes to my python classes for example. Even reloading tools weren’t quite enough either.
There’s a lot to like and learn here. Now that language servers are here, multi-lingual support is better than ever. And hacking elisp is both fun and easier than you’d think!
Plugin architectures for programming editors feel so deficient and poor in comparison. It’s really nice to be in a programmable environment all the time. It’s really the equivalent of going from gui computer use only, to command line. This is the next evolution imo.
One of the amazing things about emacs is elisp isn’t a config language (like lua is)
Lua is a programming language?useskin=vector).
Lua is a Turing-complete language, you would be surprised at the amount of games completely programmed with it. It's just used for configs because it's quite handy and easy to integrate.
Having learned Scheme a long time ago, I think the Lisp family of languages is quite fun and quirky, but they aren't suited for complex programs unless you're a masochist.
Having learned Scheme a long time ago, I think the Lisp family of languages is quite fun and quirky, but they aren't suited for complex programs unless you're a masochist.
Scheme is the least convenient of the LISPs as it tries to be more ideologically pure. Common Lisp isn't that painful for large programs, for example.
Hear hear!
This is the next evolution imo.
As much as I agree with your desire for this, I'm not as hopeful that this will actually become widespread. Most software seems to be moving further from this ideal rather than closer. I suspect that instead AI will be the mechanism by which we script our apps, as demonstrated by Apple during WWDC on Monday.
People have been obsessing about using generative ai to reduce code written (never mind that the real cost is maintaining lines of code!) and have entirely forgotten that we used to reduce lines of code by increasing the strength of our abstractions!
It’s a pendulum and it’ll swing back.
In the mean time I’ve been doing Common Lisp and it’s shocking how helpful and ergonomic it is for interactive coding! It doesn’t have the fully comprehensive library support like go or python has, but you’d be surprised at times! Besides which with the language power and macros a lot can be done easily by yourself!
Emacs is a great text editor for people with 15 fingers