
How a Vim user converts to Emacs - gnosis
http://bradbeveridge.wordpress.com/2007/06/21/how-a-vim-user-converts-to-emacs/
======
julian37
I've always thought that the whole vi(m) vs. Emacs "war" is a false dichotomy.
I'm an Emacs guy myself; I haven't used vi(m) a lot, but from all I gather
it's a fine editor. The real "enemy", if we need to use war-inspired
vocabulary, are editors like nedit, Kate, ScITE, and maybe even Textmate (boy
am I going to get told off for this!)

Emacs and vi(m) are great editors today, but imagine how much even greater
they would be if all those people pouring hundreds and thousands of man-hours
into projects like Gedit, JEdit, KWrite, Medit, etc. would have instead put
their efforts towards improving the true editors!

Disclaimer: I haven't really used those other editors a lot and I'm sure that
each of them has something going for it.

Also, I know how much fun it is to work on something challenging, like a text
editor, even if (or exactly because) there are already established
"solutions".

Finally, a few alternative editors are genuinely useful, such as nano - it
might be inferior in pretty much every regard to Emacs, but it's not possible
to shrink Emacs to nearly the size of nano so it does seem to serve a valuable
purpose for when disk space or memory footprint is an issue. Cue the Eight
Megabytes And Constantly Swapping jokes.

EDIT: and yes, Emacs/vi(m) are not necessarily the be-all, end-all of editors
for all time to come; maybe one of those alternative editors will one day
prove to be superior. All those other editors just remind me of the phrase
"Those who don't understand Emacs/vi are condemned to reinvent it, poorly"...
err, or something like that.

~~~
kanak
> Finally, a few alternative editors are genuinely useful, nano - it might be
> inferior in pretty much every regard to Emacs, but it's not possible to
> shrink Emacs to nearly the size of nano so it does seem to serve a valuable
> purpose for when disk space or memory footprint is an issue.

I'm an emacs user too, and I now use zile (
<http://www.gnu.org/software/zile/> ) instead of nano. The ability to use the
same keyboard shortcuts that i'm used to is a godsend.

~~~
sigzero
You don't need nano when you have vi on every install anyway.

~~~
weaksauce
The gp is an emacs user and zile is a bare bones emacs. If you are a
proficient emacs user going to vi is going to be torturous even on small
projects. I am a vim user and I see why the gp would want to skip vim and use
something comfortable.

------
eterps
There is a difference between Vim 'the concept' and Vim 'the program'. I like
the first one, but I couldn't care less if I am running vim itself, emacs with
Viper mode, Vimperator or what have you. To me a person who is running emacs
with Viper mode is still a vim/vi user.

~~~
gfodor
How far off is viper mode from vim, anyway? Anyone who uses it regularly care
to share how close it gets you to vim-level speed?

~~~
gnosis
From what I understand, viper is not intended to be a vim emulator, but rather
a vi emulator (if you could even call it that).

As a long-time vim user switching to emacs (just to edit lisp code), viper
mode does not feel very comfortable or familiar.

Sure, the basics are similar. But to get a good handle on how to use it and
configure it to your liking, you have to read a ton of documentation. Also,
configuring it effectively seems to require being familiar with many emacs
concepts and ways of doing things.

A vim user is really going to be lost until he does a ton of reading on this
stuff. And even then, it's going to take him a long time to feel comfortable
with it.

And that's not to mention that by default viper only works in a very limited
number of emacs modes. You can configure it to work in more modes, but then
you'll loose out on a lot of default emacs features that are tightly
integrated in to the regular configuration of those emacs modes.

You may be able to reconfigure those modes to allow them to be used more
naturally in viper, but that's going to be a lot of work (and, again, require
you to learn a lot about emacs).

So if you're a vim user switching to emacs, don't expect viper to make you
feel at home. Vimpulse extends viper to be just a bit more like vim, but it's
really just a thin gloss over the basic viper functionality. Even with
vimpulse, some of the basics may be the same, but you're still going to be
very far from vim.

And even if you do spend the time to learn enough about emacs and learn enough
about viper to customize it to be much more like vim, you're still never going
to be able to replicate one crucial aspect that makes vim such a joy to use:
its thousands of plugins.

Sure, emacs has its own packages and extenstions that probably do many of the
same things (arguably, for some of them, maybe even more). But if you use them
you're going to be essentially just using regular emacs, with a vi or vim
gloss over it.

If you're a vim user and you like, know, and regularly use many vim scripts
and plugins, those aren't going to magically become available for you to use
in emacs, even with vim and vimpulse. If you need any of the functionality of
these extensions in emacs, you're just going to have to find the emacs
equivalent and learn how to use it. This is going to be yet another major
drain on your time.

Of course, if you're committed to really making a complete switch to emacs, it
might be worth your time. But if, like me, you only want to use emacs for a
limited subset of things, you're probably going to have to learn to live
without the ease and convenience you get from your scripts and plugins you
have in vim (unless you're willing to put a major amount of time and effort in
finding, learning and configuring the emacs equivalents).

~~~
ths
Emacs isn't vim. I think vimpulse gives the most essential bits of vim, while
the other bits can be replaced with emacs functionality without a loss of
efficiency. I don't miss any of my vim plugins. The only plugin I use that
brings emacs closer to vim is viper/vimpulse. Vim still feels slightly (maybe
5-10%) slicker when editing text (I'm a long-time vimmer that moved to emacs a
few months ago). In return you get (IMHO) superior indentation, better
integration with external processes (such as debuggers and REPL sessions) and
easier customization.

What exactly is it that you miss from vim that you're not getting in emacs? Is
it only a generally decreased feeling of efficiency? Because that definitely
went away for me once I learned to leverage and customize emacs.

------
hakl
Found an article on switching to Vim after two decades of using Emacs:
[http://pinard.progiciels-
bpi.ca/notes/Thoughts_on_editors.ht...](http://pinard.progiciels-
bpi.ca/notes/Thoughts_on_editors.html)

And another one on converting to Emacs from Vim:
[http://upsilon.cc/~zack/blog/posts/2008/10/from_Vim_to_Emacs...](http://upsilon.cc/~zack/blog/posts/2008/10/from_Vim_to_Emacs_-
_part_1/)

------
narrator
I've read that a few Vim users have switched to Emacs to take advantage of
ENSIME, which is a really nifty Scala development environment.

~~~
rayvega
Org-Mode is another reason I've heard for switching.

~~~
kanak
I'm one of the people who switched from Vim to Emacs due to Org mode, and I've
never regretted the decision. In the past year, I've used org-mode to take all
my notes in class, write documents and as a task manager. All in all, the gain
in productivity due to org-mode massively eclipses the time it took to un-
learn vim and become decent at emacs.

~~~
agentultra
You can also write and tangle code in it for literate programming purposes.
You can also read-in values into the programming code in the org-file and
return results to it as well.. so you could technically run your unit tests in
the file and return the results in a nicely formatted org-table. :)

You just can't do that stuff with vim. I used to be a really hard-core vim guy
but I eventually switched. Now I'm an emacs-or-nothing guy. :)

------
eccp
In my case, I'm learning Emacs after ~15 years avoiding it. I use a
combination of Vim, Eclipse and Netbeans for enterprisey Java, but after that
many years of a fixed mindset, I'm trying to reinvent myself and I'm trying
both Clojure, JRuby and Git; Emacs has great modules to integrate them with
ease.

Currently I don't have the fluency I had with Vim but I think the effort will
pay itself on the long run. The key is to practice and use Emacs as much as
you can everyday.

------
Flankk
Vim has great text navigation features but nothing I can't do with a mouse as
fast or faster. With a mouse I can scroll two pages, highlight and replace a
function in about two seconds. It would take me far longer to do this using
keyboard shortcuts.

Most of my time spent coding isn't spent on navigation of text files anyway.
Most code is very modular and I switch between text files frequently. In an
IDE, you have a navigational tree of your files from which you can find and
switch to a different file in about two seconds.

Does anyone have any evidence that vim is _actually_ faster at these two
things, and not just hype? If not evidence, at least solutions to the above
two problems which you think are faster than using an IDE?

~~~
eterps
For me this is hard to understand. Either I haven't seen anyone who is able to
'mouse' as fast as you can. Or you haven't yet seen someone who is really good
at Vim.

~~~
jason_tko
Just went searching on the internet for a vim demo video and found this:

<http://www.youtube.com/watch?v=QNAXa0W4OFg>

Also, if you have a Mac (or most versions of Linux) you can also access an
instant tutorial by typing "vimtutor" at the terminal.

~~~
unoti
For those of you looking at this video to get an idea of the power of vim in
the hands of a serious user: although this person is using it quickly, he is
nowhere near a master. The key to vi is that any time a user is pressing the
same key multiple times, there is a faster way. In this video I often see the
user using the same keystroke multiple times to get from here to there. Most
notable, he routinely does this to get from his cursor position over to a spot
later in the line (such as when changing the word "test" which was in quotes),
or to get to the end of a section (such as when he was copying then changing
the body of a function).

If you're a vi user or an aspiring vi user that wants to get faster, then
start consciously looking for times that you're pressing the same key more
than about twice. Each of those times is almost certainly an opportunity to
get faster.

So in particular from watching the above video, these are two shortcuts that I
use all the time that the video maker did not use. Let's say you have a line
of text like: Img.save('roberto.png') and you want to change it to x.png. If
your cursor is at the start of the line, you would never arrow over there. You
would type fr (find r, which would move your cursor to the r in Roberto). Then
you would type "ct.x" which means change until we get to the period and
replace it with the letter x. It sounds complex, but after a while you just do
it without thinking, and it's faster to type 5 keystrokes with 2 hands than a
bunch of repeated keystrokes with one hand.

Similarly, the } and { keys should be used to navigate to the next or previous
blank line, which could have been used in this video to change the body of
those functions in a couple of keystrokes instead of the arrowing around and
highlighting we were seeing.

I'm not trying to pick apart the video, the person is clearly fast and
effective. The point is just that vi gives you the flexibility to always get
faster if that's what you're into.

~~~
eggoa
We can shave another keystroke off your example.

Instead of "ct.x", "cwx".

~~~
unoti
Brilliant, exactly.

Another important point here: A big benefit of doing changes like this is that
vi has the special command "." which repeats the last change. With a single
keystroke, it makes the same change you did last.

In practice this comes in handy quite often. Let's say that I have a program
which generates a bunch of images. Let's say it's generating 4 images, and 2
of them are thumbnails and 2 are big versions.

img1.save('x-th.png',100) img1.save('x.png') img2.save('y-th.png',100)
img2.save('y.png')

I want to change the thumbnails to .gif. I can't just use search and replace,
because I only want to change 2 instances. (Technically I could with a regex,
but forget about that for a moment.) I go to the first one I watch to change,
use 'cwgif' which changes the png to gif. Then I navigate to the next one, and
just press period. The period key is one of the monster productivity boosts
you can get from vi.

------
Create
I think this is purely a cultural background issue.

People with systems/sysadmin etc. background have been mentored and thus grew
up to use vi (it is available from any unix terminal prompt and is not an OS
in itself™).

People who grew up in comp/sci/phy used to see emacs as their first editor,
and used it mostly graphically.

I think switching is done either as a switch given because of the evolution of
one's functional role -- be it involuntary or voluntary (latter just for fun
or self improvement).

------
kia
Does anyone here switched from Emacs to Vim? Comments?

~~~
cornedpig
I have, XEmacs -> Vim.

I had a very simple reason. I spend 4 hours a day in front of an editor, so I
need something very powerful. I had standardized on XEmacs, but I had to stop
when the pinky muscle strain got too bad (this was years after having remapped
caps-lock to control). My hand would hurt when I got home.

I usually program in C/C++, Perl, and some XML & text editing, so I wasn't
using Emacs' dynamic or programmable features much.

Vim is attractive because there's not really a need for modifier keys, just
key sequences. Additionally, the great text navigation features are good when
working with large existing codebases, it makes reading other people's code
easier.

I kept going back to Emacs for XML editing for a while, but the mental
overhead of keeping track of two systems is a bit much, and I found Komodo
Edit a nice replacement (that incidentally also has a Vi-mode).

The only thing I really miss from Emacs is being able to "Ctrl-K" 3 times and
pressing "Ctrl-Y" once to move 3 lines. With Vim you have to count the number
of lines ahead of the operation, which is a real speedbump.

~~~
auxbuss
"The only thing I really miss from Emacs is being able to "Ctrl-K" 3 times and
pressing "Ctrl-Y" once to move 3 lines. With Vim you have to count the number
of lines ahead of the operation, which is a real speedbump."

V-jjj-x

If I understand you correctly. I don't speak emacs.

------
stanislavb
He doesn't :)

------
ez77
It's a shame he didn't keep writing: all three entries are from June 2007.

~~~
crazydiamond
He now has RSI :(

------
Create
This reminds me of one of the best real-life history log entries I have seen:

vi .emacs

~~~
prodigal_erik
Around 1990 I went through a phase of using vi for trivial edits, because I
could finish them in less time than it would take for Emacs to start on the
shared(!) hosts available to me. After that, the bounty of Moore's law let me
keep one open all the time.

------
gcb
vim is a text editor.

Now if you are writting html you will open 4 different browsers in emacs?

You have a window manager for a reason.

