top | item 26423000

From Vim to Emacs in fourteen days (2015)

170 points| Assossa | 5 years ago |blog.aaronbieber.com | reply

175 comments

order
[+] dang|5 years ago|reply
Just for fun, here are some of the larger past threads. Others?

After over a decade of Vim, I’m hooked on Emacs - https://news.ycombinator.com/item?id=16551796 - March 2018 (161 comments)

A pragmatic decision on GNU Emacs versus Vim for programming - https://news.ycombinator.com/item?id=13590944 - Feb 2017 (59 comments)

Why I switched from Vim to Emacs - https://news.ycombinator.com/item?id=13130775 - Dec 2016 (101 comments)

From Vim to Emacs - https://news.ycombinator.com/item?id=8367384 - Sept 2014 (116 comments)

Emacs and Vim - https://news.ycombinator.com/item?id=8084359 - July 2014 (275 comments)

Vi and Vim vs. Emacs Shootout and Deal - https://news.ycombinator.com/item?id=3205828 - Nov 2011 (52 comments)

Some thoughts on Emacs and Vim - https://news.ycombinator.com/item?id=2229040 - Feb 2011 (40 comments)

How a Vim user converts to Emacs - https://news.ycombinator.com/item?id=2036586 - Dec 2010 (66 comments)

On vim vs emacs - https://news.ycombinator.com/item?id=1374916 - May 2010 (28 comments)

Debian's Vim maintainer switches to Emacs - https://news.ycombinator.com/item?id=341492 - Oct 2008 (32 comments)

[+] davidw|5 years ago|reply
Emacs vs Vim is like comfort food for software-related online discussions.
[+] salmo|5 years ago|reply
In college I used Emacs, because I had a romance with lisps and just really enjoyed extending stuff. Also used Sawfish as my window manager, etc. The modal thing in vi(m) was hard for me to wrap my head around and the bizarre config of vim seemed so inelegant.

But when I got a gig as a sysadmin running a few thousand servers w/ a slew of Unixes (Solaris, BSD, HP-UX, Linux) I finally bit the bullet and learned vi, because it was the only common denominator (oh, man and ksh88 because so many bash-es were so broken on those platforms).

Now I find modal editing very natural and productive and don't miss the keyboard gymnastics of emacs. I find I get pissed at every text editor that isn't vi. Outlook, this text box, etc.

I use IntelliJ (and do Python and Go in it) with vi binding for large long-lived projects and just vim/neovim in a terminal for scripts, short-lived stuff, and quick edits. The bindings in IntelliJ are good enough, although sometimes I forget and try to do things, like run a file through awk.

I play with using VSCode with vi bindings from time to time, but honestly just forget to use it much.

I have a smallish vim config with a handful of plugins, mostly for linting. I'm comfortable with it and haven't ever really found it lacking. And I don't feel the need to maintain a codebase for my config like I enjoyed doing in college. I guess I garden in my garden vs my config files and am not so focused on some kind of concept of purity. Heck, I think I have the default background on my mac.

[+] omoikane|5 years ago|reply
> this text box, etc.

I always keep a GVIM window open so that I can type text there and then paste those into other places that are not vi.

It also helps that vi is a lot more stable than certain websites and is less likely to lose my text. It's nice to be able to just copy&paste without having to re-type the same text when browser crashes.

[+] ljm|5 years ago|reply
Funny you say that, because I always find myself reverting to emacs and, even after playing with config distros like Spacemacs and Doom Emacs, I've settled on on a severely minimal config with mostly default keybinds, and magit on the side because it is the best interface to git I've ever had the pleasure to use. I also enjoy running linters and test commands in a compilation buffer and hitting 'g' to re-run/refresh it after making changes in the files I'm working on. And the way emacs handles undo/redo feels intuitive to me in a way I can't really explain.

Essentially, I get modality when I want an interface. And the rest of the time, I type.

I still make sure that I know good-enough vim and nano so I can do what I want outside of my own environment.

[+] andrewzah|5 years ago|reply
This article fails to explain -why- one would want to switch to emacs from vim.

Org-mode and configuring emacs in a lisp-like are cool, but are not worth re-learning everything for me. I put that time in already by reading "Practical Vim" by Drew Neil and other vim literature online. I'm sure everyone is already aware, but vi is available basically everywhere. This has saved my ass at least twice where I couldn't access vim or had internet access to install XYZ editor.

So as a power vim user I see no reason to switch. If I can't use vim, most editors now have support for reasonable vim bindings. So I use that for Jetbrains' products / Joplin / Insomnia / etc.

[+] alex_smart|5 years ago|reply
How many lines of vimscript have you written? No, copy-pasting config lines from someone's dotfiles doesn't count. How many times have you opened the source code of some vim plugin you are using and tried to modify what it does?

If I were to hazard a guess: zero. That was also me during ten years of vim usage. Vim encourages the mindset of mastery = learning a bunch of tricks, remembering them and incorporating them into muscle memory.

Emacs on the other hand encourages the mindset that my editor is a programmable tool, I am a programmer, I can make it do whatever I want. You are always just one click away from the source code implementing any functionality of your editor, which you can, if you choose to do so, modify and evaluate on the fly.

> vi is available basically everywhere

Emacs-like shortcuts are also available wherever you have readline (e.g. many shells).

>This has saved my ass at least twice where I couldn't access vim or had internet access to install XYZ editor.

In those situations, I also still use vim. But 99% of the time, I am not on some remote machine, I am on my personal computer, so I can choose to use a tool that is not installed by default. The basic vim commands I have internalized over the years are sufficient for those odd jobs.

>So as a power vim user I see no reason to switch.

To each their own. Personally, I think that Emacs is a much more rewarding tool to master.

>most editors now have support for reasonable vim bindings

So does Emacs :)

In fact Emacs' vim plugin is probably has the most feature rich of all the vim emulations.

[+] zshev|5 years ago|reply
I somehow find myself commenting on these threads the most on this site purely to bring up vterm. I think the combination of a well-polished Emacs (like DOOM), evil-mode for vi modal editing everywhere and critically vterm/emacs-libvterm make for a great workflow[1].

Sure there's all the regular Emacs value-adds (Org-mode, Magit, TRAMP etc.) and there's no rush to start learning them, but navigating local/remote codebases all the while treating Dired filesystem views, regular files AND terminal ptys as buffers with full modal editing I find to be something of a special power. This has been possible for a long time with eshell/shell etc. but vterm really takes the lag out of it IMO. This workflow was certainly my gateway drug to Emacs. It displaced nearly two decades of vim for editing and tmux for terminals. YMMV.

[1] I wrote a bit about the workflow and continuing to train better with vim bindings using Emacs https://martin.baillie.id/wrote/evil-motion-training-for-ema...

[+] jeromenerf|5 years ago|reply
I just use emacs+evil for org only. Org is feature rich (bloated?) but these dynamic code blocks in documents are just too good.

I prefer vim for everything else and the general "minimalist" approach in particular. Emacs seems to appeal to people who like to do everything within one tool.

[+] boogies|5 years ago|reply
> This article fails to explain -why- one would want to switch to emacs from vim.

In other words it does one thing, hopefully well. The philosophy behind the original vi, and IIRC originally vim too — didn’t it previously have an explicit non-goal of adding an embedded terminal emulator? If it did, those days seem over, so you IMO you might as well use an editor that does many things well (eg. having a proper designed language as the default for configuration, not the bodge that is vimscript with Lua as just a secondary option ), if you’re going to use an IDE and not an actually minimal text editor like vis or sam.

Fortunately you don’t need to ‘re-learn everything’ with evil-mode. I doubt other editors’ support for reasonable vim bindings is as complete as the common base of Spacemacs and Doom, they certainly aren’t as complete of operating systems, capable of being your WM (EXWM) or your init system or shell (http://www.informatimago.com/linux/emacs-on-user-mode-linux....), nor capable of running in a terminal over ssh.

[+] flowerlad|5 years ago|reply
One good reason is programmability. You can write lisp scripts to automate some routine editing.

For me the main reason I prefer emacs is the key bindings are better.

Another reason that emacs (the real thing) is available everywhere. You can install it on Linux, Mac and Windows. And you can run it in console mode (terminal) as well as GUI (even on Windows).

[+] asciimov|5 years ago|reply
For me, I wanted access to org-mode, as well as the emacs ecosystem of packages.

emacs has good vim emulation through the evil package.

Doom emacs, is a decent place to start for a vimmer.

[+] weaksauce|5 years ago|reply
you might find vscode to be a great replacement for vim... using the neovim extension you have a pretty much seamless true vim in vscode (with a few rough edges). some other extensions like magit for vscode are gaining functionality and polish coupled with best in class support for language server makes it pretty solid as a replacement.
[+] drums8787|5 years ago|reply
I went in the other direction about 5 years ago after 20 years of always installing Emacs on every computer I ever used. Vim has had a much bigger impact on my productivity.

Partly because of excellent plugins (VSCode, Visual Studio), partly because, for some reason I bothered to learn Vim shortcuts to degree I never did with Emacs. And I just love that vi and vim is quick and available on my various cloud servers.

Once in a while I toy with the idea of going back and using evil mode (I keep reading about org mode).

[+] nemoniac|5 years ago|reply
> after 20 years of always installing Emacs on every computer I ever used.

You don't need to install emacs on every computer you use. The emacs on your laptop has tramp so you can edit any file on any computer you have ssh access into.

[+] antonvs|5 years ago|reply
I've used vim for years, but a few months back started using org mode with Spacemacs evil mode.

I like org mode a lot. It has a lot of functionality that makes it useful for all sorts of things beyond plain text editing. Using evil meant I didn't need retrain for common editing operations, although certain org-mode specific functionality means learning new Emacs-style key sequences.

Other than that, I still haven't learned anything about using plain emacs, so I only use emacs for editing org files. They're a different enough entity from ordinary text files that switching editors to use org mode doesn't bother me.

[+] gspr|5 years ago|reply
Tangentially related: I've used emacs for coding for a decade, and for email for a few years. I love it. But I'm missing out on its arguably strongest feature: elisp! My config file is a tragedy of stuff I hamfistedly cobbled together. I'd like to learn this skill properly, and thus conquer the world (I assume this makes me able to).

Can anyone recommend a resource? I speak some C-like languages, and Python and Haskell, but no LISP at all. I'm an emacs user, but have only superficial knowledge of how emacs actually works.

[+] loloquwowndueo|5 years ago|reply
It probably took me longer than 14 days to learn vim after using emacs for years, it was worth it - mainly and specifically I switched because vim’s modal nature means fewer finger contortions to reach 6 modifier keys simultaneously as required with emacs - that was giving me RSI symptoms. I’ve been happy with vim since and it tends to be more easily available in remote systems. To each their own though - both editors are ok :)
[+] hirundo|5 years ago|reply
> If, like me, you’re curious enough to give Emacs a try...

So curiosity rather than conversion. Six year later is he still using Emacs? Went back to Vim? Moved on to something else?

I have enough years invested in muscle memory of Vim itself and various plugins that what curiosity I have about Emacs is well controlled. I doubt I have runway left to get to the same productivity in another editor.

[+] dan-robertson|5 years ago|reply
Well the author used Evil mode which is vi emulation for emacs and quite popular. Their last post that was obviously about emacs was late 2019 but they don’t blog much. So I’d guess they still use emacs
[+] zarkov99|5 years ago|reply
An interesting path is to go from regular emacs to emacs with vim bindings, which is what I did, also in around 14 days. Its painful, but good for you brain. And you get the best of both worlds, or so I like to think.
[+] anand-bala|5 years ago|reply
This is a great point. Personally, the only reason I would want to switch to Emacs is Org mode but the muscle memory for custom Vim and Tmux keymaps is hard to give up.
[+] BeetleB|5 years ago|reply
> So curiosity rather than conversion. Six year later is he still using Emacs? Went back to Vim? Moved on to something else?

He was as of Jan 2020.

[+] sigmonsays|5 years ago|reply
I went from vim to emacs for development in go and python. I Went with doom emacs, which is a configuration distribution already prebuilt which is friendly to vimm users (ie, evil mode). It was rough at first, required writing lots of cheat sheets and also changing workflows a little. I feel much more productive in emacs than vim. IMHO, its more straightforward to google "How to do X in emacs" than "how to do X in vim" and actually end up with a productive configuration change.
[+] maximilianroos|5 years ago|reply
For those who use Vim bindings, and would like to try out emacs, I'd suggest trying Spacemacs:

https://www.spacemacs.org/

It has "evil mode" by default — the vim bindings.

I picked this up at Jane Street, where much of the internal tooling is in emacs. I still use it wherever I can't get a good vscode setup, and it has some advantages over vscode.

[+] cwlb|5 years ago|reply
I picked up spacemacs earlier this year but have since switched to Doom emacs: https://github.com/hlissner/doom-emacs it's smaller, faster, and you configure it in a way that's closer to vanilla emacs. The size makes it more tractable to learn. The creator & primary maintainer is more active, funny, and helpful than the spacemacs maintainer who I believe is on hiatus.

I wish someone had told Doom about it before I picked up spacemacs so maybe this post will benefit past-future-me.

[+] jhbadger|5 years ago|reply
Am I the only person who uses Lem? An Emacs-clone written and extended in Common Lisp rather than the weird version of Lisp Emacs uses.

https://github.com/lem-project/lem

[+] andy_threos_io|5 years ago|reply
I tried it, but the underlying Roswell system isn't perfect at least.

Simple Make fails on linux out of the box.

And the look&feel and features are very far from emacs.

[+] bogwog|5 years ago|reply
Vim is my go-to terminal-based text editor, and I used it for a decent amount of time, but when I finally decided to switch to something like Sublime Text, I never felt the need to go back.

Maybe it's because I'm not a "touch typist" who uses a home row and all that stuff, so the keybindings optimized for that don't really help me that much.

I do like Vim though, and it's an insanely useful skill to have because I can SSH into any server and edit config files like if I were straight up programming.

[+] sumnole|5 years ago|reply
You can enable Vintage Mode in Sublime Text to get the best of both worlds.
[+] dfox|5 years ago|reply
Well I'm long time emacs user who switche to emacs from vi(m) in essentially the time it took to go through the C-h t tutorial.

While today I dont't use Emacs as the day-to-day editor (I use VSCode, for a bunch of not entirely good reasons that mostly have to do with macOS) I think that exposing people new to unix to emacs/zile makes more sense than to vi(m). And then there is the "every mac textfield understands default emacs key bindings" effect...

[+] monoideism|5 years ago|reply
I've tried to get into emacs, VS Code, and Sublime (all w/Vi keybindings, of course), but I always seem to find myself back in Vim (or Neovim).
[+] afarviral|5 years ago|reply
I want to love emacs with default bindings but find them unergonomic to the extreme. However I think VIMs bindings and multimodal text editing is a false economy, so I don't want to just use evil-mode (spacemacs or DOOM). In other IDEs and OSs there is a consistent scheme for copy, paste, undo, redo but no consistent scheme for new-line-above/below or movement near the home row keys using modifiers. I've been experimenting with alt+[some homerow keys] for movement and left-hand w/modifiers for changes similar to ergoemacs, in vscode. The realisation I've had is that there is an absence of standardized keybindings for text editing across IDEs/editors and the complexity and lack of interoperability rolling-your-own make that approach universally avoided. This means we are in a rut going back and forth between emacs and vim and OS keybindings, and the editor wars are just a symptom of a greater problem. The real issue is that there is not enough R&D on efficiency and human-oriented design and/or this hasn't influenced current standards to a great enough degree. Aside from in a terminal I'm not convinced (if timed/tested) the average coder using the mouse heavily with left-hand shortcuts would be any less capable than a vim guru. Accuracy with a mouse is something that can be improved too, just look at competitive FPS games. I'd also posit the mouse coder spent more time learning coding and less time fiddling with his tools.

Does anyone know where I could find more info about this stuff?

Does anyone know of any research comparing the efficiency/speed/stress of VIM users to, say, VS Code keybindings or emacs ones?

I am a productive vim user already and have just learned standard emacs bindings and ergoemacs bindings within a few hours. This is not a matter of a vim-naiive person avoiding learning the tool. I do have a preoccupation with tools rather than getting stuff done with them... That's our curse isn't it?

[+] iLemming|5 years ago|reply
Here we go again. Vim vs. Emacs. A decades-old argument that actually doesn't have any merits.

Because Vim and Emacs are two distinct categories. The only thing that makes them similar is that they are both based on something. That something is an idea. And not just an ordinary, everyday concept, but an influential, holy grail type of thing.

Vi and the concept of the modality is an incredible, powerful, fantastic model. People who never hardheartedly tried to learn Vi-model just don't get to say anything about it. Can you respect an opinion about CRISPR coming from someone who has no clue about polynucleotide chains and DNA?

Yes, Vim is not overly intuitive for a complete beginner. Like many, perhaps most awesome tools, it too has a certain level of sophistication. You cannot enter the Suez or Panama Canal gates' control room and suggest removing all those knobs, switches, buttons, etc., and instead, install one colossal touch screen because that would be "a much more intuitive interface".

Vim is hard to learn, but you see, there's usually a strong correlation between something that's not so easy to acquire and simplicity gained later. Conversely, things that are easy to pick up, very often later become cumbersome and annoyingly counter-productive. Rich Hickey's "Simple Made Easy" rhetoric very nicely manifests that.

So yes, Vi-model is an incredible idea. Vim, Neovim, Evil, etc., are just implementations of that idea.

Now, Emacs is based on another mind-blowing idea. The idea of practical notation for lambda calculus, what is known as Lisp. Lisp, probably can be crowned as the most important idea in computer science. It's just hard to think of something more influential than Lisp. Emacs is just a practical implementation (and frankly, not the best one) of that idea.

Arguing what's better - Emacs or Vim is like debating what was more important in the history of health care - the invention of anesthesia or discovery of penicillin.

Both Vim and Emacs are awesome, and one is not better than another. If you can't see that - then probably there's a big hole in your understanding of at least one of the ideas they are based on.

[+] arunc|5 years ago|reply
20 years of vim user here. I learnt Emacs for just one thing. Magit!

Except that I don't have any other use for Emacs.

[+] jhchabran|5 years ago|reply
If anyone wants to give a try, it's worth noting a few things if you come from vim:

- if you are on osx, you'll may find the gui rendering quite laggy if you are using a Retina display. Using the terminal will make it snappy again. Using something like Alacritty will make it even snappier if you're sensitive to it.

- if you are on linux and use the gui, the pgtk branch is worth giving a try, it drops the old extremely outdated Xt code

- LSP can be quite resource hungry, it's really worth giving a try to the nativecomp branch of emacs 28. https://www.emacswiki.org/emacs/GccEmacs

[+] mkl95|5 years ago|reply
I have been using Emacs for several years now, I love how easy it makes it to quickly browse and edit code. The only downside is that coding without Emacs keybindings makes me uncomfortable and kind of sloppy. Fortunately most IDEs have an Emacs plugin.
[+] da39a3ee|5 years ago|reply
I love emacs as a lisp environment to work in and have used it for 20 years but the emacs LSP picture is starting to look seriously sketchy in comparison with what more language-specific IDEs such as VSCode and PyCharm etc offer. Especially now that static typing is becoming standard in languages like Python and Javascript. If you have a lot of spare time you can probably make eglot and lsp-mode work in your favorite language. But if you work in a few languages, you sort of need to be working part time and have no family or social commitments.
[+] brescia85|5 years ago|reply
My experience with lsp-mode is quite the opposite. I was able to configure it with rust-analyzer/gopls/pyright for half a day and I would say that it is very close to "just works". Previously I was using VScode and emacs only for org-mode.
[+] auslegung|5 years ago|reply
My only experience with emacs is doom emacs, and only about 6 months, but I haven’t felt this pain other than getting the right formatter to format. I’m doing frontend react work so primarily tsx and sass, so maybe not a counterpoint but
[+] mrbonner|5 years ago|reply
Does it feel weird that you have to enable Evil mode to use emacs? I have been using Vim for most my life and switched to emacs last years. I am using vanilla version with lots of plugins of course.
[+] soraminazuki|5 years ago|reply
Not really. Evil's vim emulation are quite impressive, and it's doing its best to make the bindings available everywhere in Emacs. However, the behavior of each keys in different buffers are somewhat less consistent than with Vim, which is inevitable because Emacs buffers are used more like an UI for elisp applications. I think the benefits far outweigh the minor inconsistencies though.