
Emacs v. Vi Is Rooted in the Love of Lisp - gnosis
http://stevengharms.com/blog/2005/07/24/emacs-v-vi-is-rooted-in-the-love-of-lisp/
======
samdk
I basically agree with the final conclusion, but I don't think the example
given--deleting five lines of text--actually supports it at all. The author is
claiming that vim's way of doing it is cryptic (normal 5dd), and then says
this about emacs' way:

    
    
        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.

~~~
tikhonj
Yeah, that example is not particularly good, especially since you can do C-#
(where # is the number) in Emacs, which is qualitatively the same as vim.
(It's just as magical.) I always use that instead of C-u because it's easier
to type.

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.

~~~
Arelius
You've just made my day with C-#

------
tsm
My favorite programming language is Common Lisp. My favorite text editor is
vim. I have no cognitive dissonance about this.

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."

~~~
krichman
And I would be absolutely thrilled if the main scripting language in vim was a
Lisp.

~~~
tikhonj
Consider trying evil mode for Emacs.

------
mrmagooey
I actually don't give two hoots about elisp, in fact I'd prefer the language
was python. I use emacs for three reasons:

\- 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.

~~~
cheez
This means you're not writing enough elisp and if you amortize it over a year,
then you are spending as much time as you should.

FWIW, I have about 1KLOC in elisp custom code.

~~~
maigret
Not that I disagree much with your point, but I remember Richard Stallman
himself told to have almost no customization in his Emacs (can't find a
reference now but feel free to prove me wrong). This tend to be very useful
while using the editor on lots of different machines (and yes, I know of
remote editing).

~~~
reeses
Now, when I am annoyed at what I believe to be an absurd default setting, I'm
going to clench my fists and grumble,"Stallman!"

~~~
cheez
I do that all the time!

------
charlieflowers
I've thought long and hard about this for a few years, and I've reached the
conclusion that the best of all world is to use Emacs with Evil (vim
emulation). So I get Vim modes and keyboard efficiency with the ultimate
configurability of Emacs. (Ironically, though, I've been doing a lot of C#
lately, and of course there I'm using Visual Studio, lol).

~~~
gnosis
I have to agree.

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.

------
linuxhansl
I use vi and emacs all the time, and it appeared almost random which one I
pick. For code editing I also use Eclipse.

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

~~~
fusiongyro
Have you tried eclim? I'm trying to hook it up to Emacs, but since I use
Netbeans rather than Eclipse it's been less perfect going so far.

------
narrator
One good thing about Emacs is all the key-bindings work by default in the bash
shell. If one remaps control to Caps Lock it makes it a lot easier on the
hands.

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.

~~~
niggler

        set -o vi
    

sets vim bindings for bash (and there's a similar thing for the libreadline)

~~~
krichman
you have changed my life

------
justinrstout
I'm not sure it's very constructive to explain the editor wars in a short,
non-technical blog post. This article provides little useful technical
information and a lot of extraneous verbal fluff. The comparisons to various
philosophical works were particularly pretentious and painful to read. It
doesn't seem like this article contributes anything substantial to the debate.

~~~
mturmon
You're totally correct ("little useful technical information").

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.

------
rsl7
I'm so happy to see that this article is old. There is no reason to continue
the ridiculous editor wars. emacs and vi have really held back innovation imho
with their slavish devotion to the tty paradigm. this problem is that they are
good enough so that innovation has slowed. Feels like we're stuck in the 70s
but with web browsers.

~~~
greggman
I completely agree with you. I believe there are tons of things that could be
done better, many I'm sure I'm not creative enough to imagine, if the editor
wasn't tied to tty.

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.

~~~
greggman
And now we see IntellJ using graphics to show you inline references to icons
and colors as just one example of what graduating to a graphics can provide.

Yep, Text only forever!! :-(

------
pjmlp
I do prefer IDEs to Emacs/vi(m), specially for large codebases.

However for Lisp users, Emacs can be configured to achieve parity with what
Lisp Machines used to offer, which is quite nice.

<http://www.loper-os.org/?p=932>

------
crymer11
This is definitely a nitpick, and I catch myself saying the same thing as
well, but Mac OS X (since Leopard) is a Unix. Certified Unix 03. There is no
need to say "Unix / Linux / Mac OSX", just "Unix/Linux" or even better,
"Unix/Linux/BSD".

~~~
Arelius
> "Unix/Linux/BSD"

How is that better? BSD is at least as much Unix as OSX.

~~~
crymer11
FreeBSD (and Darwin) are not UNIXes, despite being compatible, since they
aren't certified. Unless you fork over some change for the certification, the
best you can be is "Unix-like".

------
kirinan
This is actually folly: both vimscript and lisp are both turing complete
language (read can both make a computer do everything a computer is capable of
doing), so even know LISP might have nicer syntax/cooler paradigm, what have
you: it doesn't matter, you can achieve the same thing in VIM Script. I am a
VIM user, although not a fanatical one, I see the merits of having a language
like eLISP for emacs, but honestly I think they are both outdated. If I wasn't
so partial to using a command line editor (I use the terminal a lot), i'd
switch to Sublime text 2 because it uses python, and I'd rather use a modern
scripting language than either vimscript or eLISP.

~~~
graue
Python scripting inside Vim has been supported for a while. I've never seen a
Vim plugin written in it, though, which seems odd given the gripes about
VimScript.

~~~
Zakharov
The default vim shipping with Ubuntu (12.04, not sure about newer versions)
doesn't have Python support.

~~~
graue
Are you sure? My VPS runs Ubuntu 12.04.2, only has the vim-common, vim-runtime
and vim-tiny packages installed, and `:python echo "Hello world"` works fine.

