How to clear vim registers effectively?

前端 未结 7 1250
傲寒
傲寒 2021-01-31 07:07

Registers in vim are a great feature to store text snippets and even to run commands on the text stored within them. However, I\'m a tidy person and tend to clean things up when

7条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-31 07:57

    Put this in your .vimrc:

    command! WipeReg for i in range(34,122) | silent! call setreg(nr2char(i), []) | endfor
    

    and clear every register with :WipeReg

    If you would like that to happen every time you start Vim also add:

    autocmd VimEnter * WipeReg
    

提交回复
热议问题