I have been using Vim for a couple of months and I think I've fallen in love with it. But I am still using the mouse for selecting text and scrolling. Every tutorial, advice and blog post I have visited states that it is a bad habit to use the mouse on Vim. Is it really embarrassing to use the mouse in Vim? Does anybody here who use Vim as their primary editor use the mouse?
15 Answers
These tutorials are wrong, and even detriment to learning. Do not try to abjure your previous working style and do everything the “Vim way” from now on. It won’t work anyway and you won’t get any work done.
Just go with it and try to learn more Vim idioms all the time. I’m still using the mouse after years of almost exclusively working in (g)Vim.
8You should try to use text objects.
I stopped using the mouse more or less once I started using these.
Basically text objects are shortcut to easily execute command on words, sentences, paragaphs.
Just for fun you can try the following :dip : it will _d_elete (_i_n) the current _p_aragraphvib : between parentheses, it will select the content than you can then yank, cut, etcvi} : will select a C block, than you then quickly reindent with = or delete, or decrease indentation...caw : to quickly delete and replace the next word
Possibilities are endless.
See :help text-objects
It is really one of the greatest Vim features and is only rarely highlighted in Vim tutorial. (I learned about them very late, maybe a year or two after starting using Vim)
That being said I still use the mouse sometimes and it is not a cardinal sin.
Its really a matter of preference. I sometimes use the mouse, but I find that it is much more efficient to not have to move my hands. If you spend a lot of time in vim, you may want to start learning the keyboard shortcuts and moving around using "hjkl" instead of the arrow keys. It saves you a lot of time.
Do you know about Shift-V and then using j or k keys to visually select entire lines at a time? I use this very frequently to yank files.
I use C-F and C-B for scrolling.
I find both more efficient than using a mouse.
1I very seldom use the mouse. Sometimes however I find it very quick to select some portion of text not linewise, from the middle of a line to the middle of another line on my screen.
This is the only use I have for the mouse in vim.