[nvim] Add keymap to rg through hidden files

Grepping through files is mapped to `<leader>F` but it respects ripgrep's
default settings, which is to ignore files in gitignore and files
hidden. This map still ignores gitignored files, but searches through
hidden ones in addition to normal ones. It is mapped to `<leader><C-F>`,
to signify an 'extra' added to normal grepping (and since it will be
presumably more rarely invoked, justifying the slightly awkward key
combination).
This commit is contained in:
Marty Oehme 2020-01-30 11:44:44 +01:00
parent 401d4a603a
commit ea5ffe8bc5
2 changed files with 9 additions and 0 deletions

View file

@ -146,6 +146,9 @@ noremap <leader>f :FzfFiles<cr>
" FZF general full-text search in cwd with rg
noremap <leader>F :FzfRg<cr>
" same full-text FZF search, but include hidden files
noremap <leader><C-F> :FzfRgHidden<cr>
" FZF git diff
noremap <leader>gd :FzfGFiles?<cr>

View file

@ -78,3 +78,9 @@ let g:fzf_action = {
\ 'ctrl-t': 'tab split',
\ 'ctrl-x': 'split',
\ 'ctrl-v': 'vsplit' }
" FzfRg but also search through hidden files
command! -bang -nargs=* FzfRgHidden
\ call fzf#vim#grep(
\ 'rg --column --line-number --no-heading --color=always --smart-case --hidden '.shellescape(<q-args>), 1,
\ fzf#vim#with_preview(), <bang>0)