Find files.

1 Point

Romain Lafourcade Romain Lafourcade

10 years ago

Finds files recursively under the current directory (,f, ,s, ,v) or under the directory of the current file (,F, ,S, ,V).

Works best with :set wildmenu.

set path=.,**
nnoremap ,f :find *
nnoremap ,F :find <C-R>=expand('%:p:h').'/**/*'<CR>
nnoremap ,s :sfind *
nnoremap ,S :sfind <C-R>=expand('%:p:h').'/**/*'<CR>
nnoremap ,v :vert sfind *
nnoremap ,V :vert sfind <C-R>=expand('%:p:h').'/**/*'<CR>

Chris Penner

Chris Penner 10 years ago

Do you know of any downsides to setting path to .,**?

Romain Lafourcade

Romain Lafourcade 10 years ago

@ChrisPenner, it works perfectly well for me. Be careful with large and deep projects, though.