How to paste over without overwriting register

后端 未结 10 2576
粉色の甜心
粉色の甜心 2020-11-28 02:41

Does anyone know of a way to paste over a visually selected area without having the selection placed in the default register?

I know I can solve the problem by alway

10条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-28 03:37

    In your .vimrc

    xnoremap p "_dP
    

    I found this from a response on a similar thread, but the original source was http://vim.wikia.com/wiki/Replace_a_word_with_yanked_text. It mentions some drawbacks, however it works fine for me.

提交回复
热议问题