Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
170 views
in Technique[技术] by (71.8m points)

Point and click, or generally move the cursor to where you're looking in Vim

I am currently learning to use Vim. It has been a very good experience so far and I believe the Vim approach to be generally much more powerful than GUI based text editors.

There is however one feature that I miss. I sometimes have to read my document to correct potential mistakes. If I spot a mistake I need to move quickly to the position of the mistake, say in a middle of a sentence. In a standard text editor I will reach briefly for the mouse and point/click to move the cursor to this position.

This is slow, but in VIM it will take me much longer. Generally it is impractical to search for the word, because it may have spelling mistakes or occur many times. The fastest way I found is move to the line using line numbers, then move across sentences, then words, then letters. It is still much slower than reaching for the mouse, pointing and clicking.

My question is two-fold: is there a way to click with the mouse to move the cursor in Vim? I know that's not really the spirit but I think it could be useful occasionally. If not, am I doing something wrong? How do Vim users generally handle this problem of moving to a specific word you're looking at, far from where the cursor currently is, for example when you're reading back what you typed for mistakes?

Thanks

question from:https://stackoverflow.com/questions/28616232/point-and-click-or-generally-move-the-cursor-to-where-youre-looking-in-vim

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

If your terminal supports it adding

set mouse=a

to your vimrc will enable mouse support.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...