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 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .vim/after/plugin/grep.vim (limited to '.vim/after/plugin/grep.vim') 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('') -- cgit v1.2.3