nvim: Switch to ferret & drop our bare bones grepper

See ferret's README for the advantages.

Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
This commit is contained in:
Sanchayan Maity 2020-06-14 11:22:03 +05:30
parent 6bca8ccaad
commit 8ea80b9af7
4 changed files with 8 additions and 33 deletions

View file

@ -1,5 +1,3 @@
" Always open QF window at the bottom
wincmd J
" Quit vim if the last window is qf
autocmd BufEnter <buffer> if winnr('$') < 2| q | endif

View file

@ -1,11 +1,12 @@
call plug#begin('~/.config/nvim/plugged')
" Motions
Plug 'haya14busa/incsearch.vim'
" Vertical Motion
Plug 'justinmk/vim-sneak'
" Fuzzy search
" Search
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'haya14busa/incsearch.vim'
Plug 'wincent/ferret'
" Remove extraneous whitespace when edit mode is exited
Plug 'axelf4/vim-strip-trailing-whitespace'
" Manage Project sessions
@ -32,7 +33,6 @@ Plug 'sbdchd/neoformat'
Plug 'hauleth/asyncdo.vim'
" Quickfix
Plug 'ronakg/quickr-cscope.vim'
Plug 'stefandtw/quickfix-reflector.vim'
Plug 'milkypostman/vim-togglelist'
Plug 'yssl/QFEnter'
" Text Object plugins

View file

@ -73,10 +73,8 @@ nnoremap [q :cprevious<CR>
nnoremap ]q :cnext<CR>
nnoremap [Q :cfirst<CR>
nnoremap ]Q :clast<CR>
nnoremap qs :Grep<SPACE>
nnoremap q* :Grep <cword><CR>
nnoremap qg :Ggrep! <cword><CR>
nnoremap qG :Ggrep!<SPACE>
nnoremap q* :Ggrep! <cword><CR>
nnoremap qs :Ggrep!<SPACE>
nnoremap qt :call ToggleQuickfixList()<CR>
nnoremap Lo :lopen<CR>
nnoremap Lc :lclose<CR>
@ -84,10 +82,8 @@ nnoremap [l :lprevious<CR>
nnoremap ]l :lnext<CR>
nnoremap [L :lfirst<CR>
nnoremap ]L :llast<CR>
nnoremap Ls :LGrep<SPACE>
nnoremap L* :LGrep <cword><CR>
nnoremap Lg :Glgrep! <cword><CR>
nnoremap LG :Glgrep!<SPACE>
nnoremap L* :Glgrep! <cword><CR>
nnoremap Ls :Glgrep!<SPACE>
nnoremap Lt :call ToggleLocationList()<CR>
" Preview tags
nnoremap pt :ptag <C-R><C-W><CR>

View file

@ -1,19 +0,0 @@
if executable('rg')
set grepprg=rg\ --vimgrep\ --no-heading\ --smart-case
set grepformat=%f:%l:%c:%m,%f:%l%m,%f\ \ %l%m
elseif executable('ag')
set grepprg=ag\ --nogroup\ --nocolor\ --vimgrep
set grepformat^=%f:%l:%c:%m
endif
" Taken from https://github.com/hauleth/dotfiles/blob/master/vim/.config/nvim/init.vim
command! -bang -nargs=* -complete=dir Grep call asyncdo#run(<bang>0,
\ { 'job': &grepprg, 'errorformat': &grepformat }, <f-args>)
command! -bang -nargs=* -complete=dir LGrep call asyncdo#lrun(<bang>0,
\ { 'job': &grepprg, 'errorformat': &grepformat }, <f-args>)
augroup GrepperQFOpen
autocmd!
autocmd QuickFixCmdPost [^l]* nested cwindow
autocmd QuickFixCmdPost l* nested lwindow
augroup END