diff options
author | Johannes Löthberg <johannes@kyriasis.com> | 2018-07-19 16:48:36 +0200 |
---|---|---|
committer | Johannes Löthberg <johannes@kyriasis.com> | 2018-07-19 16:48:36 +0200 |
commit | 5dbaa286ccca4929599b5083435a441b319d8a32 (patch) | |
tree | 87adcdc18f6b1824eca84f03e176ff12d6d15acf | |
parent | 1a69f99f683259dcd822557b2dec06d121759f62 (diff) | |
download | dotfiles-5dbaa286ccca4929599b5083435a441b319d8a32.tar.xz |
nvim: Add :Rg (<Leader>s)
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
-rw-r--r-- | nvim/init.vim | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/nvim/init.vim b/nvim/init.vim index d999c09..684642f 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -130,3 +130,11 @@ noremap <C-l> <C-w>l noremap <Leader>p :FzfFiles<CR> noremap <Leader>P :FzfFiles<space> nnoremap <Leader>b :FzfBuffers<CR> + +noremap <Leader>s :Rg<space> +command! -bang -nargs=* Rg + \ call fzf#vim#grep( + \ 'rg --column --line-number --no-heading --color=always '.shellescape(<q-args>), 1, + \ <bang>0 ? fzf#vim#with_preview('up:60%') + \ : fzf#vim#with_preview('right:50%:hidden', '?'), + \ <bang>0) |