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?

Questions on Super User are expected to relate to computer software or computer hardware within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.
If this question can be reworded to fit the rules in the help center, please edit the question.

I use the mouse mostly for scrolling through code when reviewing (not editing). The only other time I really use it is when I want to resize splits. I have not yet found a mapping I'm comfortable with that works well enough for this.
–
Randy MorrisJan 13 '11 at 19:26

5 Answers
5

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.

Some common mouse actions can be replaced with exciting vim commands, but there's really no replacement for the mouse when you want a large visual selection.
–
JefromiJan 13 '11 at 18:26

@Jefromi: depends on the selection, e.g. most block selections can be handled via vi{, where { is a block delimiter of your choice. But in general I agree with you.
–
Konrad RudolphJan 13 '11 at 18:29

1

The main and only reason, why you must not use mouse in vim is that moving hands from keys to mouse and back take very long time. With features like setl rnu, /{pat} and other motions it is always faster to use keyboard.
–
ZyXJan 13 '11 at 20:18

1

@Jefromi. Use setl rnu (relativenumber). With it you can normally get selections like V53k (assuming that all 53 lines are shown on the screen). If they do not fit, use /{pat}, marks, repeat Hz<CR> until you see target line, ... Mouse will slow you down significantly and prevent from learning neat vim tricks.
–
ZyXJan 13 '11 at 20:27

1

@ZyX: you may be right (I don’t know – I rarely use the mouse anyway but sometimes it’s still faster for me) but this doesn’t change that it’s bad didactics and detriment to learning. While it’s true that being thrown into the water will either teach you swim or drown you, the truth is that it will usually drown you. In the case of learning Vim this simply means that you throw your hands up in frustration and go back to some more convenient editor. I’ve been there. And so have countless other people.
–
Konrad RudolphJan 13 '11 at 21:24

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.