diff --git a/.config/vim/vimrc.d/40-keys.vim b/.config/vim/vimrc.d/40-keys.vim index 68026cf..1dcc518 100644 --- a/.config/vim/vimrc.d/40-keys.vim +++ b/.config/vim/vimrc.d/40-keys.vim @@ -124,8 +124,12 @@ function! GetVisualSelection(escape = "", byteescape = 'n') return l:sel endfunction -vmap * /\V=GetVisualSelection('/\') -vmap # ?\V=GetVisualSelection('?\') +" In case these do not exist already (At the time of writing only Neovim adds +" mappings for these) +if maparg('*', 'v', 0, 1) == {} + vmap * /\V=GetVisualSelection('/\') + vmap # ?\V=GetVisualSelection('?\') +endif " Extended `*`. Starts vim search (without jump) and ripgrep nmap * :let @/ = '\<' . expand('') . '\>'