Tuesday, July 31, 2012

What's the best way to move to an arbitrary location on your screen?

I've been learning Vim for a while, and one situation has been coming up a lot for me:

1) I'm scrolling through a sourcefile, and see an interesting word I'd like to edit or yank.
2) I look left at the line number of the word, and type [line number]G
3) I keep pressing w/W/b/B until I reach the word, (except if the word happens to be the first or last word of the line, or located near a unique symbol)

However, this feels inefficient (especially step 2), and I'm hoping to find a better solution.

Some things I think might be possible, but have no experience with:
- Use H/M/L to move roughly to the line, then 0/gm/$ to move roughly to the column, then using small motions to get to the final spot.
- Learn to guess [number]j/h/k/l way better (perhaps with relative line numbers) to do something like "7j33l".
- Use / and type characters until it matches, then press enter.
- Use the easy motion plugin.

Please comment on the above or share your method. :)

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment