Code search plugin for Vim powered by rg / sift / pt.
- Type
:Searcher [options] <keyword> <path>
in command mode. - Explore the results.
<c-j>
==> Jump to the next result
<c-k>
==> Jump to the previous result - Jump to the corresponding position.
<c-o> to open (same as Enter)
go to preview file, keeping focus on the results
<c-t> to open in new tab
gt to open in new tab, keeping focus on the results
<c-h> to open in horizontal split
gh to open in horizontal split, keeping focus on the results
<c-v> to open in vertical split
gv to open in vertical split, keeping focus on the results
q to close window
- Searcher [options] <keyword> <path>
Start searching. - SearcherCWD [options] <keyword>
Start searching in the current working directory (as given by :pwd). - SearcherStop
Stop searching. - SearcherClearAllCaches
Clear all caches which are stored in$HOME/.cache/searcher
.
Type :Searcher -t vim func .
(Use rg as the search tool and the options -t vim
for rg is to search vim files.)
Note: The input options must be valid for the chosen search tool (default: rg).
- For convenience, you can add a shortcut by setting
nnoremap <leader>a :Searcher -t %:e -S <C-R><C-W> .
. As a result, you can search the word under the cursor in files with the same extension. - search tool: rg