I often use the following:
" Tip #470 : Piet Delport & Anthony (ad_scriven) vnoremap <silent> g" <esc>:call <sid>SwapVisualWithCut()<cr> function! s:SwapVisualWithCut() normal! `.`` if line(".")==line("'.") && col(".") < col("'.") let c = col('.') normal! gvp```] let c = col('.') - c normal! `` :silent call cursor(line("."),col(".")+c) normal! P else normal! gvp``P endif endfunction
The idea is to delete something anywhere, then go to the selection of characters elsewhere and press g" to replace the delete characters with new ones.
source share