Improve Shift-R substitution

Shift-R now captures the original word so it can be used in the
substitution pattern and type less.
This commit is contained in:
Talia 2018-11-28 09:15:51 +01:00
parent ee35298a03
commit 372f6c2d7e

4
vimrc
View file

@ -545,8 +545,8 @@ vnoremap <C-d> :copy '><CR>
nnoremap dx 0"_d$
nnoremap dcx 0d$
nnoremap <leader>: :let @* = @:<CR>
nnoremap <expr> <S-r> ":%s/\\<".expand("<cword>")."\\>/"
vnoremap <expr> <S-r> ":<C-u>%s/".VisualSelection()."/"
nnoremap <expr> R ":%s/\\<\\(".expand("<cword>")."\\)\\>/"
vnoremap <expr> R ":<C-u>%s/".VisualSelection()."/"
" Put in new line with indentation
nnoremap ]p :let [content, type]=
\[getreg(v:register), getregtype(v:register)] \|