diff options
author | Guangxiong Lin <[email protected]> | 2022-04-13 12:18:36 +0800 |
---|---|---|
committer | Guangxiong Lin <[email protected]> | 2022-04-13 12:18:36 +0800 |
commit | b4b23f5980382f73ea8d866b18f0b48f75a32f2a (patch) | |
tree | 3e4f39a834dc9fb773a632459614d0337674a3ce /.vim/after/plugin/grep.vim | |
parent | b258258e84d3111248f7bff311660192b766119a (diff) | |
download | dotfiles-b4b23f5980382f73ea8d866b18f0b48f75a32f2a.tar.gz dotfiles-b4b23f5980382f73ea8d866b18f0b48f75a32f2a.tar.bz2 dotfiles-b4b23f5980382f73ea8d866b18f0b48f75a32f2a.zip |
Add shortcut of grep in vim
Diffstat (limited to '.vim/after/plugin/grep.vim')
-rw-r--r-- | .vim/after/plugin/grep.vim | 6 |
1 files changed, 6 insertions, 0 deletions
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 <leader><leader>g :grep! <c-r>=expand('<cword>')<cr><cr> |