DEV Community

Peter Gundel
Peter Gundel

Posted on

Finally switching to vim

This article is just a selection of things I found helpful when switching to vim. So when someone asks for help because he or she wants to switch to vim, I just pass him or her the link to this article. Some of the links in this article also describe why you should switch to vim. So I won't get into this here.


Before I started using vim, I thought switching would be just a timeframe of 2-4 weeks of being less productive and learning vim and then I would have it all set up and I am used to the vim style of doing things. But then I realized switching to vim is more like a long and ongoing journey.

The most important thing about vim is that you can't just start with a complete-guide-to-vim and then you're good to go. It is a steady process of learning new things (and be overwhelmed by them). The secret in the beginning is to give yourself some time to get up to speed and understand the brilliance behind the concepts of vim.


I recommend to start by watching this introduction talk to vim by Mike Coutermash. He describes really good what I was experience as well when starting with vim. Here are also his blog article and his slides for the talk.

In order to get a first impression I started with an interactive online tutorial. This tutorial provides a very good interactive introduction to the principles of vim. And this is a very good read about the why of vim.

After that I realized that I need a list of all these movement commands. Here is a cheat sheet to start with. Or even better you print out a more complete vim cheat sheet: This or this. The vim wiki has a getting started page that I found quite useful.

In order to train the basic movements you can start playing VIM Adventures.

This Github repository provides a long guide to vim.

Here are 68 free screencasts about vim and here are two more free ones and other paid ones.

You also might wanna have a look at neovim.

Vim has a very rich ecosystem of plugins. There are multiple ways of installing plugins. I started with pathogen.vim and it was ok. But my coworkers showed me the advantages of vim-plug and as they are using vim-plug I switched, too.

Then you have to decide which plugins to use (and not to use 😉) and how to customize your settings and keymaps. As a starting point I will list some plugins someone might have a look at. The most important thing here is: read through the documentation of each plugin and decide whether you need it or not!

Here are some plugins that I found useful for the start:

And every programming language normally has a vim plugin on its own.

Finally, start playing vimgolf from the beginning. It's never too early to start (I had that thought). Just look at the other solutions and try to understand what they did.


After one week of vim I'm not as productive as with RubyMine. If I really need to get something done fast I still open RubyMine. But most of the time I use vim now and I enjoy working with it. Two more weeks and RubyMine stays closed. What I miss the most is the awesome multi cursor implementation of RubyMine. But I already have been told that in vim you do things differently 😉


Hi there, we’re store2be, a Berlin based startup that builds a SaaS enabled marketplace for short term retails space. If you like what we are posting you might wanna check out the store2be tech page or follow our Medium channel.

Top comments (37)

Collapse
 
dubyabrian profile image
W. Brian Gourlie

There are two ways to think of VIM: As a text editor, and as a set of common modes and keybindings.

Switching to VIM doesn't need to be about making the switch from a fully-featured IDE to a text editor—IDEs have a lot of great functionality that text editors don't, so you're really giving up a lot for the sake of using VIM for everything.

The alternative to using VIM (the text editor) for everything, is to leverage VIM plugins for whatever tool is best fit for the job. You mention you use RubyMine; JetBrains vends an excellent VIM plugin for all their IDEs. There are excellent VIM plugins for Visual Studio, Sublime, Atom, VSCode, etc.

While VIM (the text editor) is great in its own right, and there are a lot of really great plugins, VIM is really about being able to navigate and edit text efficiently. You don't need to give up your existing tools to leverage VIM's efficiency!

Collapse
 
ddiukariev profile image
Dmitry Diukariev

I confirm that VIM plugin is a good way to go if you want the best of both worlds power of VIM and IDEs. Doing this for over a year with Visual Studio and VsVim and it works great for me (I have tried switching fully to VIM but lack of IDE features made me consider mix of IDE and VIM).
Also it is true that sometimes those plugins miss things that VIM has. But I just made a command to open current file for editing in VIM with hitting single key. So whenever I need smth. complex that plugin still doesn't have I just switch to VIM edit and return back.
Also eventually I found out that I want VIM editing everywhere :). So I made an AutoHotKey script that allows me to edit text from any input in vim (I just hit shortcut selected text loads in vim I edit it hit shortcut again and new text replaces previously selected) find this to be very handy.

Collapse
 
ismatim profile image
Ismatim

Do you have a special list of plugins for working with Visual Studio ?

Thread Thread
 
ddiukariev profile image
Dmitry Diukariev

I use VsVim for Visual Studio. No other plugins.

Thread Thread
 
ismatim profile image
Ismatim • Edited

How does your crafted .vimrc work within Visual Studio ? Did you need to make any curious adjustment ?

Thread Thread
 
ddiukariev profile image
Dmitry Diukariev

I have separate configs for vim (_vimrc) and VsVIM (.vimrc) because VsVIM does not support all of the vim features. Both files are placed in default vim installation directory at C:\Program Files (x86)\Vim. VSVim picks it up automatically when you load visual studio. There is also a manual way to load it just type :s {path to your .vimrc}

Collapse
 
robertmjohnson profile image
Robert Johnson

Agreed, I recommend this approach - I got started though using plugins too. Another area where plugins shine is being able to easily toggle them on and off with a button or keyboard shortcut. This really helped me when I had got confident enough to start using Vim editing at work, but sometimes wanted an escape hatch to get back to "normal" editing for more complex things that I hadn't learnt the Vim way for yet.

Plugins are also useful for if you work on Windows. There are things like gVim or installing Vim on a Cygwin terminal, but to me they always feel a bit unnatural somehow compared to the experience on a *nix box, and so plugins avoid this issue.

Collapse
 
alexeyzimarev profile image
Alexey Zimarev

I agree. Using vim keystrokes saves lots of time when one uses emulator across multiple IDEs and editors. I use VS 15/17, several Jetbrains products, Sublime, VS Code, and everywhere I use vim emulators, keeping me comfortable across all these.

Collapse
 
peterfication profile image
Peter Gundel

And what I also like about vim is that you are encouraged to adjust it to your needs. That's a really strange thing because you can do the same in the JetBrains IDEs but I never really did it. Maybe because it's already that good out of the box.

Collapse
 
peterfication profile image
Peter Gundel

Oh that's really cool! I should definitely check this out!

Another problem with RubyMine though is that it is so slow. So I thought it is better to have a really fast text editor instead of all the IDE features from which I only use some.

Collapse
 
dubyabrian profile image
W. Brian Gourlie

Ah, yeah. I've never had performance issues with JetBrains IDEs, but I've also never used RubyMine specifically.

Collapse
 
niorad profile image
Antonio Radovcic

Thanks for the article.

For me it finally clicked when I started using buffers directly instead of tabs.

This article helped, maybe someone might find it helpful:
joshldavis.com/2014/04/05/vim-tab-...

For OSX-Users I highly recommend VimR, which is MacVim but using NeoVim.

Collapse
 
peterfication profile image
Peter Gundel

Thanks for this article! This also helped me a lot now :) I have to admit I was using tabs the wrong way ;) But this will change now :)

Collapse
 
kidpixo profile image
kidpixo

nice post!
for the multiple cursor look here github.com/terryma/vim-multiple-cu...

but I actually never used it.

Collapse
 
peterfication profile image
Peter Gundel

Thanks for the link. Unfortunately, this one does not work like the JetBrains one. You can only select a whole word and find for next occurrences. In JetBrains products you can select an arbitrary amount of chars and then find the next occurrences. So when you want to select a few words that have the same prefix or suffix, you can't use this vim plugin.

Collapse
 
kidpixo profile image
kidpixo

Oh sorry, I installed it when I had your same feeling, but after a while I stop using it in favour of regex search/substitution or rectangular selection with .

Take a look to medium.com/@schtoeffel/you-don-t-n..., some interesting ideas there.

Good luck !

Thread Thread
 
peterfication profile image
Peter Gundel

Thanks for the link, I already had it in my last sentence ;)

Thread Thread
 
kidpixo profile image
kidpixo

sorry, I didn't catch that!

Collapse
 
vikramj74 profile image
Vikram Jaswal

Currently using sublime, although I am quite well versed with vim.

The main reason, was that I just cannot figure out a good way to combine, Filezilla and Vim.

But you've inspired me to take another shot at it.

I think using Gvim as an option on Filezilla should work.

Thanks for this.

Collapse
 
maxart2501 profile image
Massimo Artizzu

The most important thing about vim is that you can't just start with a complete-guide-to-vim and then you're good to go.

I've heard or read that countless of times. And my answer is still the same: I'm not paid to learn an editor, I'm paid to produce code. I don't want to lose time in an editor, I want an interface with a high discoverability that makes me feel at home right from the start. Because I need to be productive right from the start.

People are always joking about exiting Vim - but if you think about it, it's just nuts that you need to tell an editor that you want to edit the file. You say that I have to take my time - actually it's Vim that'd take my time!

I have to deal with Vim on a daily basis for the too many terminal commands that force you to use it - starting from Git - I just don't want to deal with it any second more than necessary.

Collapse
 
peterfication profile image
Peter Gundel
  1. I think you didn't understand the real value of an editor like Vim or Emacs. If you really take the time to learn it, it can make you more productive in the long term. So being less productive for 3 months is paying out a lot after that. But in the end everybody has to decide it for him/herself of course.

  2. You can change the terminal editor to the editor of your choice ;) (google.de/search?q=change+terminal...)

Collapse
 
maxart2501 profile image
Massimo Artizzu

If you really take the time to learn it, it can make you more productive in the long term.

Huh, I've heard that. As nauseam.

But guess what? I actually know hardcore Vim users. And while they're usually quite productive indeed, I can't say they're more than me... and they can't either. (The opposite holds too, by the way.)

The point is that your tools can increase your productivity that much, the rest is up to you and how good you are.

And I'm fine with VS Code and my multi cursor-fu.

Thread Thread
 
peterfication profile image
Peter Gundel

It's about your personal productivity, not about the comparison with others. So if vim isn't a fit for you, it's fine. It does not mean that this also accounts for others ;) I for my part can just say that it was worth it :)

Collapse
 
soundstruck profile image
Dina Gathe

As many others have mentioned, it doesn't have to be all or nothing to make good use of Vim. I use vim-mode-plus in Atom, and it works great for me (though I wouldn't say by any stretch that I'm a vim power user). I use it in the areas that I feel it makes me a bit faster and more productive.

I do want to point out one other reason that makes it useful to learn Vim (modes and keybindings): Working on different machines, or VMs, where your favorite editor is not necessarily readily available, or GUI-less servers. For basic text editing it has been invaluable to learn to use Vim to do quick edits (at least for *nix machines).

Collapse
 
robertmjohnson profile image
Robert Johnson

While I agree that all Vim plugins eventually fall short somewhere, to say that "If you think that, then you never actually used vim" is unnecessarily harsh. For a Vim beginner a plugin is plenty, and lets them focus on the basic motions etc while still staying within a familiar environment.

Collapse
 
jmutawa profile image
Jalal Almutawa

Do you recommend starting with something like vim-bootstrap.com/ ?

Collapse
 
peterfication profile image
Peter Gundel

I think it is a good thing to look at, but you should just add the things to your vim config that are really relevant to you. So check it out, read about the plugins and then decide if you would like to use them. You don't need to use all plugins and configs from the beginning.

Collapse
 
dzervas profile image
Dimitris Zervas

There is vim-multiple-cursors which is really useful.

I would suggest working with vim for a bit without plugins though to learn what it can do on its own

Collapse
 
peterfication profile image
Peter Gundel

That's a good suggestion. Playing vimgolf helps a lot in finding out features of vim (when working with one file only though).

Collapse
 
yeongsheng profile image
Yeong Sheng

Do try out spacemacs in evil mode. You'll like it better.

Collapse
 
matsleal profile image
MatsLeal

.vimrc please !!

Collapse
 
peterfication profile image
Peter Gundel
Collapse
 
peterfication profile image
Peter Gundel

Yes I use neovim.

I didn't have look at emacs so far. But I will maybe have a look at it as soon as I am more familiar with vim.

Collapse
 
macskeptic profile image
♥ ☕

100% agreed

Collapse
 
taq profile image
Eustáquio Rangel

Hey, take a look at this repo:

github.com/taq/workshop-vim

Some nice plugins there. :-)

Collapse
 
peterfication profile image
Peter Gundel

Thanks :) I will have a look at them :)

Collapse
 
xyz85046927 profile image
Charles Xavier

Too much work just to feel "pro" or "hipster"