aboutsummaryrefslogtreecommitdiffstats
path: root/vimrc
diff options
context:
space:
mode:
authorTeddy Wing2019-11-16 14:04:47 +0100
committerTeddy Wing2019-11-18 23:20:31 +0100
commitec48cdda27baf830229584df6b3695bc30b81f12 (patch)
treeb4fce3c94a906c8069f669df42c6a66712d94dd6 /vimrc
parentf349067741bf1bc1057a0caf1daa1297fdf3102e (diff)
downloaddotvim-ec48cdda27baf830229584df6b3695bc30b81f12.tar.bz2
vimrc: Add v_<leader>w mapping to search with Ripgrep
We already have an n_<leader>w mapping. This new one gives us the ability to refine the search term to include more than a single word. now we can include multiple words and punctuation in searches.
Diffstat (limited to 'vimrc')
-rw-r--r--vimrc2
1 files changed, 2 insertions, 0 deletions
diff --git a/vimrc b/vimrc
index 55a39af..69cd790 100644
--- a/vimrc
+++ b/vimrc
@@ -440,6 +440,7 @@
"
" 2019.11.15:
" * Add gS mapping to :ArgWrap.
+" * Add v_<leader>w mapping to search a visual selection with Ripgrep.
"
@@ -834,6 +835,7 @@ nnoremap <leader>sp :setlocal spell! spell?<cr>
" Search <cword> with Ripgrep
nnoremap <leader>w :!rg <cword><cr>
+xnoremap <leader>w y:if getregtype('"') ==# 'v' \| execute '!rg --fixed-strings ' . shellescape(getreg('"')) \| endif<cr>