Peter Gundel
CTO at store2be.com in Berlin, Ruby ninja with JS experience, interested in Rust and Kubernetes.
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 😉
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!
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.
Ah, yeah. I've never had performance issues with JetBrains IDEs, but I've also never used RubyMine specifically.
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.
nice post!
for the multiple cursor look here github.com/terryma/vim-multiple-cu...
but I actually never used it.
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.
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 !
Thanks for the link, I already had it in my last sentence ;)
sorry, I didn't catch that!
Hey, take a look at this repo:
github.com/taq/workshop-vim
Some nice plugins there. :-)
Thanks :) I will have a look at them :)
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
That's a good suggestion. Playing vimgolf helps a lot in finding out features of vim (when working with one file only though).
This was a real interesting read. Thanks for the post.
Are using neovim? Did you ever think of Emacs Evil mode?
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.