How to clear vim registers effectively?

前端 未结 7 1252
傲寒
傲寒 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:58

    AFAIK you can't use built-in commands/functions to make registers disappear from the list. That seems to be doable only by removing them from your ~/.viminfo which sounds a bit extreme.

    this thread on the vim mailing list has a command that clears every register but it doesn't remove them from :reg:

    let regs='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789/-"' | let i=0 | while (i<strlen(regs)) | exec 'let @'.regs[i].'=""' | let i=i+1 | endwhile | unlet regs
    
    0 讨论(0)
提交回复
热议问题