Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

migrated from stackoverflow.com Jan 14 '11 at 0:10

This question came from our site for professional and enthusiast programmers.

closed as off topic by Daniel Beck, Sathya, Nifle, random Feb 2 '11 at 23:48

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 Morris Jan 13 '11 at 19:26
add comment

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.

share|improve this answer
1  
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. –  Jefromi Jan 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 Rudolph Jan 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. –  ZyX Jan 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. –  ZyX Jan 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 Rudolph Jan 13 '11 at 21:24
show 3 more comments

You 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_aragraph
vib : between parentheses, it will select the content than you can then yank, cut, etc
vi} : 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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

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.

share|improve this answer
    
Yeah, I know about the visual mode and selecting lines in it. But I am still not comfortable with it. –  finemann Jan 13 '11 at 18:49
add comment

I 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.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.