How to paste over without overwriting register

后端 未结 10 2578
粉色の甜心
粉色の甜心 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:15

    Luc's function worked well for me after I made a change to support the fact that I have clipboard=unnamed set:

    function! RestoreRegister()
        let @" = s:restore_reg
        if &clipboard == "unnamed"
            let @* = s:restore_reg
        endif
        return ''
    endfunction
    

提交回复
热议问题