Take the 2-minute tour ×

I know that philosophically the f/F command is used to search through the current line. However, other than [LINE]G f, what would be the best way to jump to somewhere else in the file in the style of the f command?

share|improve this question
Exact duplicate: stackoverflow.com/questions/3925230/vim-multiline-f –  glts Mar 2 '13 at 9:15
add comment

3 Answers

up vote 3 down vote accepted

Add this line to you ~/.vimrc

set incsearch

to activate incremental search and use /foo<CR> to search forward or ?bar<CR> to search backward.

Note that, like fFtT, /? can also be very useful as motions for dcsv.

If you don't mind using a plugin, there are a bunch of them designed around the idea of multi-dimensional fFtT like this one. Take a look around vim.org.

share|improve this answer
add comment

You may want to use the vim plugin EasyMotion,

<Leader>f<char> will search forward from current line to the end of current window. <Leader>F<char> will search backward from current line to the start of current window.

for all usage :help easymotion.txt

share|improve this answer
Thanks for this, +1. However, I would prefer a non-plugin solution (as I don't want to depend on a plugin and get used to it). If I don't get a non-plugin solution I'll accept yours. –  MaxMackie Mar 2 '13 at 2:55
In a non-plugin way, type /(search forward) or ?(search backward) then the search pattern. Use n to repeat the last search,use N to repeat the last search in the opposite direction. By the way, easymotion is easy to use because it is analogous to standard Vim motion. –  swpd Mar 2 '13 at 3:44
add comment

Christian Brabandt's ft_improved plugin extends the built-in f / t commands to search in following lines, too.

share|improve this answer
add comment

Your Answer


