From b4b23f5980382f73ea8d866b18f0b48f75a32f2a Mon Sep 17 00:00:00 2001 From: Guangxiong Lin Date: Wed, 13 Apr 2022 12:18:36 +0800 Subject: Add shortcut of grep in vim --- .vim/after/plugin/grep.vim | 6 ++++++ .vim/after/plugin/ripgrep.vim | 4 ---- 2 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 .vim/after/plugin/grep.vim delete mode 100644 .vim/after/plugin/ripgrep.vim (limited to '.vim/after/plugin') diff --git a/.vim/after/plugin/grep.vim b/.vim/after/plugin/grep.vim new file mode 100644 index 0000000..0720e36 --- /dev/null +++ b/.vim/after/plugin/grep.vim @@ -0,0 +1,6 @@ +if executable('rg') + set grepprg=rg\ --vimgrep\ --smart-case\ --hidden\ --glob\ !.git + set grepformat=%f:%l:%c:%m +endif + +nnoremap g :grep! =expand('') diff --git a/.vim/after/plugin/ripgrep.vim b/.vim/after/plugin/ripgrep.vim deleted file mode 100644 index 15e0285..0000000 --- a/.vim/after/plugin/ripgrep.vim +++ /dev/null @@ -1,4 +0,0 @@ -if executable('rg') - set grepprg=rg\ --vimgrep\ --smart-case\ --hidden\ --glob\ !.git - set grepformat=%f:%l:%c:%m -endif -- cgit v1.2.3