aboutsummaryrefslogtreecommitdiff
path: root/.vim/after/plugin/grep.vim
diff options
context:
space:
mode:
authorGuangxiong Lin <[email protected]>2022-04-13 12:18:36 +0800
committerGuangxiong Lin <[email protected]>2022-04-13 12:18:36 +0800
commitb4b23f5980382f73ea8d866b18f0b48f75a32f2a (patch)
tree3e4f39a834dc9fb773a632459614d0337674a3ce /.vim/after/plugin/grep.vim
parentb258258e84d3111248f7bff311660192b766119a (diff)
downloaddotfiles-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.vim6
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>