Dup Ver Goto 📝

Searching

PT2/editor/vim/keys does not exist
To
29 lines, 126 words, 814 chars Page 'Searching' does not exist.

Remember to use :help / rather than google and stackexchange.

/<pattern>   -- search forwards
?<pattern>   -- search backwards

/<pat>/3     -- search forwards for <pat> then 3 lines further

/<cr>        -- search again for last used pattern
//4          -- last used pattern, then 4 lines

4n           -- repeat last search 4 times

4*           -- search for 4th occurrence of word under cursor
4#           -- like 4* but backwards

gd           -- (for C code -- go to local declaration)

gD           -- go to global declaration (C)

/<pat>/;/<pat2> -- find <pat>, then find <pat2>

I define

nnoremap <A-n> 1n   " to quickly skip through searches

note that <S-n> already searches backwards, but n is a prefix of nnoremap for example, so can't automatically skip forwards.