Emacs v. Vi Is Rooted in the Love of Lisp
stevengharms.com
stevengharms.com
Define a function for a ‘universal’ n-many operator
( Control-U ), pass that an iteration count integer,
have that perform the pre-defined global
kill-line-of-text operation ( Control-K ).
Vim's solution is conceptually the same: you're in normal mode because that's where you do text manipulation, prefixing commands with numbers is the standard way of repeating an action a fixed number of times, and dd is the pre-defined global delete-line-into-a-buffer operation.They're both cryptic until you understand what's happening--the only real difference is that vim is less explicit, because this kind of action is exactly what vim is best at.
I suspect that there's a better example for demonstrating emacs' power, but I don't know emacs well enough to provide it. Vim is probably my favorite piece of software, but there are certainly things emacs does better.
And yeah, I consider vim to be almost sacrosanct. Especially with the fugitive.vim plugin.
Ultimately, the magic of Emacs is not in the key bindings; this is why Evil mode is not fundamentally against the Emacs philosophy. The magic is with how the editor feels just like an extension of the underlying elisp.
More to the point, the extensibility of an editor and the core editing functionality are orthogonal. As they say, "Emacs is a great operating system--all it needs is a decent text editor."
- I like the default keybindings for pretty much everything
- I like that the concept of a buffer is not connected to the concept of a window or frame or anything. That I can have the same buffer open twice in separate windows is useful.
- It's cross platform & I can be productive on remote servers if necessary.
My least favorite days are when I need to customize something and rather than it taking 15 minutes it takes 3 hours as I refresh my memory on elisp. I would prefer to spend this time being actually productive.
FWIW, I have about 1KLOC in elisp custom code.
After over 20 years of very happily using vim and other vi-clones, I'm in the process of making emacs+evil my main editor.
Making the switch is slow and painful for this veteran vim user who has perfected his vim environment, but I can already see that the emacs environment that I build will be superior... eventually.
Plus, I get the joy of scripting my editor in elisp and eventually guile (I hope). No more vimscript for me!
That said, vim is a wonderful editor. Even if vim ultimately isn't as flexible as emacs, it's still incredibly powerful; and there's a lot of cross-fertilization going on between the two editors, with vim users getting inspired by emacs features and packages and writing vim equivalents and vice-versa.
After I read an article like this a few months ago I started to keep track of which editor I use for what. Here's what I tend to do (not always, but most of the time):
- code editing of big code base: Eclipse
- casual code editing (of a few files): Emacs or vi
- Single file code editing, config file editing: vi
Org-Mode is nice. So is the minibuffer. I can start a regex by yanking text from the main buffer and then un-yanking text into the mini-buffer where the regex is being edited.
Another nice feature is that Emacs is very fast when handling very large files and files with very long-lines. Most text editors choke on these kinds of files.
set -o vi
sets vim bindings for bash (and there's a similar thing for the libreadline) echo 'set -o vi' >> ~/.inputrc
And you no longer need to have it in your bashrc at all any longer because bash uses readline.However, at this point, the editor wars have become a stage on which to explore viewpoints about how things should be, and how we got to where we are.
In particular, it's not about resolving the question of which to choose.
There may be room for innovation in the text editing market, but I don't see vim and emacs holding anything back just by being good text editors.
Here's one idea which I'm sure sucks but....I wish a code editor could show images inline where appropriate.
I'd personally like to see HTML style comments inline, where by default the comments are shown styled and you can press some hot key to edit them as html, and maybe by default they edit in wysiwyg mode.
I know some programmers will complain they won't then be able to read the comments in their editor of choice but that's exactly the point. tty only = stuck in the 70s. How is that any different than if HTML never supported colors, fonts, images, svg, etc? Sure, it's code but some code is better explained through diagrams. I shouldn't have to go find a manual to see the diagram, it should be in the code. And no, text based digrams with +----+ etc are not a full substitue for real images. Heck, I'm sure some of you would like to see MathML displayed in it's rendered form inline in a description of some math function instead of only it's source form.
Yep, Text only forever!! :-(
However for Lisp users, Emacs can be configured to achieve parity with what Lisp Machines used to offer, which is quite nice.
Or just "Unix", because there is no functional difference between the OSes that legally get to call themselves "Unix" and those that don't which derives solely from their rights to a name.
Or, to put it another way, how is z/OS more similar to MacOS X than NetBSD is?
How is that better? BSD is at least as much Unix as OSX.
Even vim is just bearable for me and if I'm not using Sublime Text 2, I'm probably using nano.
I hear what you're saying about having a CLI at the ready though. If SublimeXiki worked any better (or is it just me?), I'd say you could easily switch. I'm hoping maybe something coming down the pipe in ST3 will make our situation a little better.
Just because two different things, like two different languages, have the same potential doesn't mean they're equal.
But does this does not an equivalence between systems make, for at least two reasons:
1. Different languages encourage, and make easy, different modes of thought. Lisp promots a certain view of building hte world out of recursive, replaceable pieces.
2. Different systems provide different levels of access to their internals. The vast majority of Emacs is written in Lisp, and can therefore be hooked and rewritten. Its C code is an Emacs interpreter and text editing/rendering engine. Vim provides a great deal of scripting capability and many hooks, but that's still hooks on a system rather than a system that can be freely rewritten on the fly. It feels very different, and can allow different things if Vim is missing the hook you need.
Sincerely, the guy who writes stuff like
execute a:method . resolve(expand('%:p:h') . "/" . tolower(a:entry) . ".ext")
(Yes, vimscript is insane, too)- Alan Perlis