Why didn't anyone tell me emacs was so great?

I was writing Scheme code for comparison & debugging my library (and following along with the Wizard Book), and I discovered that Emacs is SO much easier to write code in than VIM. Heck, I'm writing a school project in it right now b/c It's easier to go faster than Google Docs. Seriously, I know Brian likes it, but it is SO MUCH faster than any editor I've used up until now.

Ironic, given what "vim" means. :~)

(And note that Emacs is implemented on top of a Lisp interpreter.)

But speed is the least of it. Its big wins are that

  1. It doesn't have command mode vs. insert mode. You don't get surprised by what your keystrokes do. (It's not an answer to say "That's the same as you holding down the control key." Yes, you hold down the control key, and so you know whether you're doing that or not!)

  2. It's implemented almost entirely in Lisp, and the code is there to be read and modified. If you invent a new programming language, you can make an Emacs mode for it. If you just don't quite like how some command works, you can write your own version. And it has a ton of hooks you can set to run your code when a file opens, when a buffer changes mode, when... zillions of things you can customize.

It's not just "Brian likes it." Bill Joy, who wrote the original vi, edits in Emacs now. It's just better. So there. You've been told! :~)

Really? Wow!


Now, I just need to make an emacs lisp (.el) program to edit Snap! xmls in a buffer as Snap! code.

... so you can drag a smart script pic into Emacs and have the blocks appear in a buffer, editable both drag-and-drop and using Lisp-mode keystroke commands! That should keep you busy for a couple of months...

First, I've got to finish SICP.

emacs is easier than vim if you don't like modal editing, but every normal text editor is? nerds use emacs and vim because they customize them a ton, and almost always use plugins to make emacs behave like vim. you shouldn't be jumping into using either from them from google docs. you should never be writing any code in google docs.

neither vim nor emacs are even close to reasonable for coding at the default settings, their configuration is absurd, and in general they just don't make sense unless you're really going to learn how the entire editor works. neither even use normal keyboard shortcuts that every other text editor defaults to.

i would suggest if you want to just start programming stuff that you get vscodium. it's the most normal and reasonable code editor. default settings are fine, has a plugin system, etc. look into other code editors after you know what to expect.

(i could also explain why emacs is by far the worst software i have ever used but i don't think you would find that useful)

No. Wrong. People who want vim run vim. People who run emacs want emacs.

I wasn't I was writing school writing assignments in Google Docs.

I'm not sure about that.

I've used VS Code, and I didn't like it. (Personally, I don't like electron software.)

Emacs has fine defaults. (In fact, Navigating with Ctrl+U num Ctrl+n/p feels pretty fast. (I keep overshooting the line I want, but oh well.))

You're spozed to search.

i did type that a bit fast without thinking about it, "almost always" is certainly a stretch. evil emacs is quite popular though, plenty of emacs users are using vim bindings.

fair, i switched away from it for that reason too. the original post sounded as though you started writing code in google docs, at some point heard of vim as what people use to write code, and then later heard of emacs. i can imagine some poor kid getting that experience, i certainly didn't have a good time trying to learn to program as a kid. if you like emacs and know the other options then that's neat, go ahead and use emacs.

i can't quite remember most specific issues i had with emacs, it was some time ago, what i do remember is:

  • every basic thing a code editor should have needed to be set up manually. for example, different keybindings, code highlighting, autocompletion, etc.
  • all of these things are time consuming to set up and often need to be done individually
  • most advice online does not explain how to set these things up well
  • some advice online gives instructions on setting up old and bad versions of these things (why would anyone ever use ctags?)
  • many of the two trillion minor modes will override user set keybinds, so keybinds need to be written multiple times.
  • the config files will always be absurdly difficult to read and use unless you actually go and fully learn lisp
  • fixing issues often requires reading the emacs source code

i used emacs for probably around a month and i think that was somewhere around 70% trying to configure it. i think i struggled to just get a config file in the first place.

i use kakoune now, it still requires setup but the documentation is reasonable, it's much easier to configure, and the modal editing is even better than vim

I'm using it for Scheme, and the siytax is highlighted by default.

I think, like all of us, you have expectations based on what you've experienced.

What I expect of a code editor: A single-keystroke (control-meta-U) command to move Up one level of parentheses, i.e., to the open paren starting the expression. A single-keystroke (control-meta-F) command to move Forward one balanced pair of parentheses, ditto Back. A single keystroke to Uppercase (meta-U), Lowercase (meta-L), or Capitalize (meta-C) the word starting at the cursor. (If the cursor is mid-word, leave the part to the left of the cursor alone.) A family of commands to move Forward a letter (control-F), a word (meta-F), an expression (control-meta-F). A family of commands to move to the End of a line (control-E), a sentence (meta-E), or a procedure definition (control-meta-E). Regular expression search and replace. Keyboard macro definition (remember a sequence of keyboard commands). Word abbreviation, separate dictionaries per mode. Ability to customize the operation of a command by writing Lisp code. Modes for every programming language. Extended command to animate towers of hanoi. Extended command to play Space Invaders. Extended command to run Eliza.

You forgot doom and bad apple.

Yeah well we all have our own expectations of editors. Luckily Emacs satisfies all of them! (Supposing you enable the right mode.)

I was just making a joke, because people make doom and bad apple play on anything. If it can display at least 2 colors and can receive user input, it can play doom (audio is optional). If it can display at least 2 colors, it can play bad apple (again, audio is optional).

Ah. Whereas what I really want is meta-X futoshiki, which doesn't seem to exist, alas.

And tetris, a web browser, and a (useless) psychologist.


Doesn't BASH use most of the same keybindings as Emacs (I.E. ctrl b/f/n/p or cursors, ctrl a/e for jumping the start/end, ctrl k/y for kill/yank, esc/alt as meta, etc.)?

That's Eliza!

Yup. Not just BASH; anything that uses the Gnu line editing library, which pretty much means anything that uses a command-line-like interface, does that.