
From Vim to Emacs - javinpaul
http://juanjoalvarez.net/es/detail/2014/sep/19/vim-emacsevil-chaotic-migration-guide/
======
bch
I used to be all vi all the time. One day I figured I ought to learn emacs. I
don't remember what the exact impetus was, but I gave myself an 8 week
challenge to use nothing but emacs. For the next ~7 years, I pretty much used
nothing but emacs, and it was enlightening to work with text in the emacs
concept, and to witness emacs' implementation of its concepts, and all the
excellent modes that authors developed within its framework.

Fast-forward to about 4 months ago, and I thought: "My vi-fu isn't at the
level of my emacs-fu", so I gave myself an 8 week challenge...

If anybody were to ask me "should I learn emacs or vi?", an appropriate answer
would be "yes." They're both awesome, and you can learn both. Go for it.

~~~
qnaal
I think it was Alan Kay? who said it's expected to learn a new editor, as well
as move into a new house, at least once every 10 years.

------
dlau1
Bravo man, I tried to make the switch from vim to emacs evil and failed
horribly. I would eventually throw emacs into a state where it wasn't in any
of the evil modes, then bash my keyboard with C-X C-C. Is it possible to use
emacs+evil without knowing emacs inside and out?

Emacs with evil, without a doubt, runs so much smoother while editing large
projects. The biggest point is that asynchronous operations are a lot easier
to perform in emacs. You can get close to it with plugins like vim-dispatch or
vimproc, but they always felt like a second class solution to me.

You get cool stuff like search/replace preview and super smooth async
operations in the background (like on the fly linting with flycheck).

In the end, I'm still using vim. Unite with vimproc is "good enough" for me.
For me, the only real place where async operation is a huge problem is with
file search operations. Every few months I try to use emacs for a day, maybe
next time it will stick :)

~~~
hsitz
>> I would eventually throw emacs into a state where >> it wasn't in any of
the evil modes, then >> bash my keyboard with C-X C-C.

I think the snippet of code in linked article in section 'Escape . . . escapes
things' fixes most of the situations where you'd get stuck in a non-Evil mode
in Emacs. It's a must have for me, otherwise I too got frustrated with getting
stuck in Emacs minibuffer/command line and <esc> not getting me back to Evil-
mode in main buffer. I also turned off the bell in Emacs, which helped
psychologically.

~~~
dlau1
I think the main problem is that in vim everything works like a buffer. When I
browse files or any sort of search results, I can use the standard vim key
bindings to navigate through or even dismiss the window.

With emacs, it seems like I have to learn the system to even use some plugins
like projectile effectively.

------
erikb
I always have a hard time figuring out why people would switch from one tool
to another just to start configuring the other to behave like the original
tool. Can someone name some reasons to switch from vim to a vim-like
configured Emacs?

The reason I've seen mentioned by the author is to learn the other tool, in
this case Emacs. But for that I think the smarter way would be to learn to use
Emacs like Emacs users do it. There's a reason why things are implemented
differently, right?

~~~
Sirenos
Emacs isn't superior to Vim in every possible way. I personally find Vim's
modal editing hard to let go of. On the other hand, vimscript is an atrocity
compared to Elisp. Vimmers have certainly managed to make some amazing
extensions to the editor despite that fact, but no tool is perfect; the whole
point of an extension layer is to make the tool work the way you want. The
defaults aren't necessarily what everyone likes (or ought to like).

~~~
mercurial
This may change with Neovim, though, since add-ons will, as far as I
understand, exist separately and do IPC through JSON.

------
endlessvoid94
I was a vim user for years. I accepted a challenge from the programmer who sat
next to me (an emacs user): we'd swap editors for a week. Every time either of
us swore or complained about the editor, we'd pay the other a dollar.

That was 2011. I've been an emacs user ever since.

~~~
paufernandez
What about the other guy?

~~~
endlessvoid94
Good question! He switched to vim due to RSI I believe.

Conclusion: neither is better. I think.

~~~
notfoss
And you switched to emacs due to RMS ;)

Jokes aside, during the 1 or 2 weeks that I forced myself to use emacs (a few
years back), I felt that I _would_ get RSI because of the painful default
keybindings. Of course, I didn't know of evil back then, so I returned back to
using vim.

~~~
GeneralMayhem
Map caps lock to control and it gets a lot better.

~~~
Attic
Or use god mode!

------
cnp
I began using Vim about a month ago and it has been totally revelatory to me,
and believe quite honestly that it was the best career decision I've ever
made. The one thing, however, is its speed. MacVim gets _very_ slow sometimes,
particularly with buffers.

So my question: How does Emacs and Vim compare speed-wise? I come from a
Sublime Text background and really miss the ability to __quickly __navigate
between tabs (buffers in vim), and sometimes it takes a full second.

~~~
brandonmenc
> it was the best career decision I've ever made

I hear this a lot, and I'm not debating whether it's true or not since ymmv.
I'm curious if anyone here has gone the other way.

I used vi in my teens then switched to emacs, which I used for over a decade.
A couple years ago I switched to JetBrains IDEs and have never been happier. I
hadn't used an IDE since Borland Turbo C, and forgot what I was missing.

Are there any other former vi/emacs users (like, hardcore - I used to browse
the web in emacs) who ditched it for an IDE?

I found that the mouse really wasn't a productivity killer for the few times
you need to use it in a modern IDE.

~~~
throw_away
I only started using intellij because it was the first IDE I'd ever used that
had a decent vim keybindings plugin.

~~~
girvo
One of the reasons I adore Komodo IDE (apart from it's excellent Python and
Javascript APIs, and the fact that it's XUL based so building plugins is just
like building them for Firefox) is the excellent Vim-mode it has built in.
It's super extensive, one of the best emulations I've ever used.

------
unhammer
"With Vim I had defined a keybinding that selected the last pasted text. It
was useful when you wanted to reformat or indent text that you've pasted from
somewhere. At the moment I've been unable to reproduce this in Emacs."

\- in non-evil-mode at least, C-x C-x will reselect what you last pasted if
you haven't moved. What really happens is that when you paste, the "mark" is
set there (equivalent to doing C-SPC), and C-x C-x will switch point (your
cursor) and the mark.

However, if you want a function that works even after you've moved around a
bit you could do e.g.

    
    
        (defadvice yank (around advice-yank-set-vars activate)
          (setq yank-last-start (point))
          ad-do-it
          (setq yank-last-end (point)))
        
        (global-set-key (kbd "C-c C-y")
        		(defun select-last-yank ()
        		  (interactive)
        		  (push-mark yank-last-start)
        		  (goto-char yank-last-end)
        		  (activate-mark)))
    

although this'll fail if you've inserted text before the yanked text (I
suppose you could do it more correctly by setting text-properties, but that's
getting rather advanced)

~~~
klibertp
No need for text properties, just make "yank-last-start" and "yank-last-end"
markers instead of simple ints
([https://www.gnu.org/software/emacs/manual/html_node/elisp/Ma...](https://www.gnu.org/software/emacs/manual/html_node/elisp/Markers.html))
- they will be moved automatically with every edit.

~~~
unhammer
Oh, nice, I suspected there was a better way :-)

------
hello_asdf
As someone who has always used vim, what are the benefits of this system over
a standard vim installation?

~~~
michaelsbradley
You get a computing environment which "breathes" Lisp[1] and is itself mostly
built up from a fully hackable Lisp codebase.

I can highly recommend Bozhidar Batsov's _Emacs Prelude_ [2] as a nice
foundation for building a personalized configuration. Just fork it and put
your personal .el files under the "personal" subdirectory; then "git fetch ...
&& git merge" to keep up to date with improvements committed to the author's
repository.

[1]
[http://en.wikipedia.org/wiki/Emacs_Lisp](http://en.wikipedia.org/wiki/Emacs_Lisp)

[2] [https://github.com/bbatsov/prelude](https://github.com/bbatsov/prelude)

~~~
mahmoudimus
I disagree re: forking it, I think there's a lot of stuff that continues to be
a bit of a pain to manage, but it's a good first start.

I think my approach re: prelude is a bit cleaner. See this:
[https://github.com/mahmoudimus/.emacs.d](https://github.com/mahmoudimus/.emacs.d)

This allows an easy to back up to github while still maintaining easy update
access to prelude.

------
SmileyKeith
I love seeing this on the front page. I've been a Vim user for a few years and
feel like there isn't a ton of help out there for switching to emacs + evil.

~~~
euid
Here's my migration guide from early September, if you're looking for more
resources:

[http://nathantypanski.com/blog/2014-08-03-a-vim-like-
emacs-c...](http://nathantypanski.com/blog/2014-08-03-a-vim-like-emacs-
config.html)

Bling, who I've linked to in that post, has repeatedly made quality posts
about making the transition:

[http://bling.github.io/](http://bling.github.io/)

------
huehue
The "problem" with vi is that you'll outgrow it very fast. People tend to work
around this by installing a dozen of plugins but I think you should use Emacs
for that.

I'm quite proficient in both editors and while I resort to Emacs for 95% of my
coding (and mail, and notes, and agenda, and...) sometimes nothing beats the
simplicity of firing up vi for a quick edit in a remote server.

Using vanilla vi with a minimal to non existent .vimrc can be liberating.

~~~
chongli
Huh? vi does not have any plugins; only vim. vi is even more bare-bones than
vim, lacking a lot of features (macro recording and text objects being the
ones I miss). It is extremely common to find vi pre-installed on countless
servers, however, making it extremely convenient if you're an expert with it.

What's amusing to me is how many people don't know vi very well and use
plugins in vim that vi can handle as well or better through macros, ex scripts
or external commands.

~~~
clarry
This bothers me. People should just call it vim when they mean vim. I suspect
most people here haven't actually touched Joy's vi or its closest derivative,
nvi.

I don't know where this practice comes from but it feels exactly the same as
when people say Unix when they are very obviously talking about GNU/Linux.

~~~
falcolas
It probably comes from the fact that most people alias vi to vim. And from the
fact that when you type vi, you're probably not getting vi, but vim in full
compatibility mode.

These actions make the two interchangeable in people's minds.

------
callesgg
If you want to use emacs as if it was vim why change?

Personaly: I try to use my console editors as vanila as posible so that I can
feel right at home directly. Kind of the exact opposite of this :)

~~~
rtpg
The only thing I really like in vim is the modal editing. Evil replicates all
that stuff really well in my opinion.

Plugins in vim are usually pretty poor compared to emacs, and vimscript is
frustrating. Emacs Lisp is at least a consistent language, and one that I can
figure out how to use much better.

~~~
vsbuffalo
I thought this was the case too, but YouCompleteMe is really terrific for Vim!
I wish emacs had something similar.

~~~
michaelsbradley
Have you tried company-mode?

[http://company-mode.github.io](http://company-mode.github.io)

~~~
vsbuffalo
This looks great! I can use Emacs again!! Thanks!

------
Animats
Having used EMACS all the way back to the original Stanford SAIL machines
(with a physical META key on their custom keyboards) I still don't want to use
it.

------
mariocesar
I'm vim guy and I started to watch
[http://emacsrocks.com/](http://emacsrocks.com/)

There are another similar sites?

~~~
noelwelsh
I don't know of any. However the Reddit community
[http://reddit.com/r/emacs](http://reddit.com/r/emacs) is pretty good for
linking to any videos / tutorials / interesting new packages that come up.

------
sriram_sun
I used Emacs for 4 years in school and was pretty comfortable with it.
Couldn't use it when I was logged on to some server at my first job. Picked up
vim .. use vimperator on firefox. Been using it for over a decade now.

------
DAddYE
I'm a vim (loser[1]) and terminal (power) user for 7+ years.

Two things comes to my mind when we talk about emacs and other editors.

The Terminal! In particular iterm.app

Basically with iterm and vim, I'm on osx close to a i3 on linux.

Vim works perfectly inside a terminal (no need to remap meta). We have
terminals on android, ipad etc...

I love working in a terminal because... well, is where I spend most of the
time. Running ruby, compiling go, js, logging on a server, running a script,
tailing logs...

[1] loser because my vim is "modern" so with mouse, arrows and so on...

~~~
aerique
It's not quite the same but since Emacs is primarily an OS it has window
managements build in, so by running it fullscreen and making a bunch of
horizontal and vertical splits you get pretty close to i3[1] as well.

The only problem is terminals. You can run them inside of Emacs, but there's
always issues. You can run eshell[2] which is wonderful. Myself, I prefer to
use terminals outside of Emacs.

[1] my development OS is Linux and I run i3

[2]
[http://www.masteringemacs.org/articles/2010/12/13/complete-g...](http://www.masteringemacs.org/articles/2010/12/13/complete-
guide-mastering-eshell/)

~~~
b3n
But Vim has window management built in too, with splits, tabs, buffers, etc.

------
bnolsen
vim is already too slow (i typically code edit with elvis which is good but
not for huge text data files). evil's lagginness is utterly maddenning. and
emacs isn't typically installed everywhere. i'm a multi terminal user who
typically works remotely via ssh, remote usually being over a gigabit
connection. I can probably burst 120+ wpm and yeah watching other people code
is typically very painful. And I don't use plugins, thats what a posix shell
is for.

~~~
colbyh
If we're being pedantic, Vim isn't installed everywhere either. Vi is, of
course, but if you're evangelizing the benefits of the posix shell over vim-
specific plugins I can only assume you didn't mean to :%s/vim/vi/ before
hitting reply ;-).

------
m45t3r
I made a similar switch to SublimeText, at least for programming tasks (non-
programming tasks I still use vim since it works with just a terminal).
Vintageous has a much better vim emulation than Vintage (the default vim
plugin to ST), and ST has lots of interesting plugins. And I can use both
modal and non-modal shortcuts (I use, for example, Ctrl+S to save rather than
Ex-mode's :w since I find it less disruptive for my workflow).

------
unclebunkers
I firmly went the other way a few years back, and haven't regretted it.
Looking at this how-to, I have no real urge to back, though it is a good
writeup.

------
lcedp
> I don't miss any text command, operator, motion or work flow from Vim.
> Marks, paragraph reformatting, visual mode, visual block, macros, registers,
> text objects, splits (vertical, horizontal, :normal, folding, etc)... it has
> almost everything.

Tried for 10 minutes and found out it has not g-/g+. (still awesome)

------
ojbyrne
"I'm totally addicted to modal text editing to the point that I feel crippled
when I've to edit text in a non-modal editor...but if you can imagine somebody
programming on an on screen keyboard on a tablet, you know how modal editor
users feel about non modal edition."

And _vice-versa_.

------
naner
_By default, most themes look like shit on terminal Emacs (emacs -nw if you
don 't want the window to open)._

Since he appears to be on Linux, another way to solve this issue is to use a
terminal that supports 256 colors. urxvt and Xterm both have 256 color
variants.

------
odc
You guys need to start doing some real work instead of playing with your
editor all the time...

~~~
sornaensis
That's kind of a poor attitude to have on a forum about -hacking-. :P

------
geoffc
An age old debate and both are great! I used Emacs for a decade plus and on a
whim spent a vacation re-programming my fingers for Vim and stuck with it as
it felt slightly faster, not sure it really makes a difference :-)

------
msoftware
If anybody would ask me "should I learn emacs or vi?" My answer is "lern vi!"

------
TallboyOne
Impossible.

------
mattvvhat
yo why is anyone reading this kind of shit

~~~
mattvvhat
-_- seriously how much can we talk about vim and emacs

~~~
Tenhundfeld
I think you're just trolling, but I'll respond as if you're sincere.

Software developers spend hours every day writing code, dozens of hours each
week, hundreds of hours each year. It's only natural to care about the tools
you spend hundreds and thousands of hours using.

We talk about vim and emacs so much because they are the most powerful popular
editors, in terms of being flexible and customizable. There's a limit to how
many "editor workflows" one can use with Sublime (though Sublime is great) or
Visual Studio or XCode or whatever. Not so with vim and emacs. They both also
have decades of plugins and hardening. It's only natural that developers who
prefer OSS and jump around amongst different languages and platforms would
gravitate towards vim and emacs.

Those of us who love one of those two editors (vim, in my case) are often very
curious to see how the other side lives, what workflows they use, etc. That
curiosity is a great thing. Trying to improve your skills is a great thing.
Stop complaining about it.

If you don't care or maybe used to care but are now soooooo over it, then just
don't freaking open the comments, right? This topic is totally germane to HN
and interesting to many of us.

~~~
mattvvhat
You know, I agree that I shouldn't care. That was a momentary sentiment.

Either way, I use vim, and, as a result, I have to listen to pro-and-con
debates unwillingly... all the time. At the time, this was an example.

In actuality there is no right answer to what browser is best. Personally, I
think vim is fast and easier-on-the-hands than emacs. In particular, I never
have to lift my hands from the main row, where in emacs I too-frequently have
to press combinations of keys and shift my positioning.

This all comes from someone who _originally_ used emacs, then converted to
vim.

~~~
Tenhundfeld
I hear ya. I actually hate listening to pointless _debates_ about vim vs emacs
too – especially if it's among coworkers or some situation I can't just
ignore.

