vim:keys: Group together * mappings in the code

This commit is contained in:
2023-02-15 10:52:06 +01:00
parent 10824feb74
commit 647a022782

View File

@@ -91,14 +91,14 @@ endif
vnoremap * y/\V<C-R>=escape(@",'/\')<CR><CR>
vnoremap # y?\V<C-R>=escape(@",'?\')<CR><CR>
" Search inside visual selection
noremap <leader>v/ /\%V
" Extended `*`. Starts vim search (without jump) and ripgrep search for cword
nmap <leader>* :let @/ = '\<' . expand('<cword>') . '\>' <bar>
\ set hlsearch <bar>
\ Rg \b<C-R>=expand('<cword>')<CR>\b<CR>
" Search inside visual selection
noremap <leader>v/ /\%V
" Select last pasted text in same visual mode as it was selected (v, V, or ^V)
" Taken from: https://vim.fandom.com/wiki/Selecting_your_pasted_text
nnoremap <expr> gp '`[' . strpart(getregtype(), 0, 1) . '`]'