From 0640a92e6a7a04a30e175dd9c30a53a0559ac341 Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Mon, 30 Apr 2018 13:59:30 +0200 Subject: [PATCH] Search in files tryouts --- .vimrc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.vimrc b/.vimrc index e208041..e8f8804 100644 --- a/.vimrc +++ b/.vimrc @@ -103,6 +103,9 @@ if executable('ag') "let g:ackprg = 'ag --nogroup --nocolor --column' let g:ackprg = 'ag --vimgrep' endif +if executable('rg') + let g:ackprg = 'rg --vimgrep' +endif " fzf integration for fast fuzzy finding, better and faster than ctrl-p set rtp+=~/workspace/projects/others/fzf @@ -113,6 +116,16 @@ Plugin 'junegunn/fzf.vim' " searched command! -bang -nargs=* Find call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --no-ignore --hidden --follow --glob "!.git/*" --color "always" '.shellescape().'| tr -d "\017"', 1, 0) +" Handy search stuff +" https://github.com/BurntSushi/ripgrep/issues/425 +set grepprg=rg\ --vimgrep\ --no-heading\ --smart-case +"nnoremap g :silent lgrep +nnoremap [f :lprevious +nnoremap ]f :lnext + +" F8 search for word under the cursor recursively , :copen , to close -> :ccl +nnoremap :grep! "\<\>" . -r:copen 33 + " Simply type ; to search through buffers, leader-o to search through file " names, \t for tags, \c for (Git) commits and \f to search through contents " of files