make gV keep register type

Fri, 30 Jun 2017 12:06:33 -0400

author
Meredith Howard <mhoward@roomag.org>
date
Fri, 30 Jun 2017 12:06:33 -0400
changeset 614
2c3afa7e900f
parent 613
f5936ac6faec
child 615
9a899e4f4290

make gV keep register type

.vimrc file | annotate | diff | comparison | revisions
--- a/.vimrc
+++ b/.vimrc
@@ -95,8 +95,8 @@ nnoremap <expr> k v:count ? 'k' : 'gk'
 nmap gb <C-^>
 nmap gB :ls<CR>:b<Space>
 
-" Select last paste
-map gV `[v`]
+" Select last paste, in the same mode it was pasted in
+nmap <expr> gV '`[' . strpart(getregtype(), 0, 1) . '`]'
 
 " Use ltag over tselect
 nmap g<C-]> :call vimrc#Ltag(expand('<cword>'))<CR>

mercurial