Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim motion vertical version of f & t?

Tags:

vim

motion

In vim, I really love f & t in Normal mode. Are there vertical versions of these? If not, what's the best way to jump so many lines downward to a word that I see? Do I just have to count the lines and do 12j or something?

like image 850
ma11hew28 Avatar asked Aug 30 '11 17:08

ma11hew28


3 Answers

Can you use /foo (or ?foo for backwards)? I tend to use that more than t or f anyway.

like image 156
Alex Avatar answered Nov 09 '22 17:11

Alex


I think you'll love the EasyMotion plugin.

You'll type <leader>fb to go to a b, horizontally and vertically.

(you can also find the vim.org mirror git here)

like image 42
Drasill Avatar answered Nov 09 '22 15:11

Drasill


Try vim-sneak, a plugin I wrote for this very reason. It enables you to jump to any location in three keystrokes by specifying the first two characters of the target:

s{char}{char}

For example, sab moves the cursor to the next instance of the string "ab". And Sab moves backwards to the previous instance of "ab".

It also supports:

  • visual mode
  • operations (like dzab, czab, and yzab)
  • operation-repeat with .
  • motion-repeat with ; and ,

vim-sneak is similar to vim-seek, with many improvements.

like image 1
Justin M. Keyes Avatar answered Nov 09 '22 16:11

Justin M. Keyes