Clear certain criteria from .viminfo file

前端 未结 5 627
深忆病人
深忆病人 2021-01-31 08:25

How can I clear certain criteria from my .viminfo file?

I want to clear the command line history, file marks, jumplist, etc.

However,

5条回答
  •  耶瑟儿~
    2021-01-31 09:15

    VIM seems not having a built-in command for this job. But you can do it in a shell with "grep". For example, the following command will clear the Command Line History,File marks, Jumplist:

    bash $ grep -v "^[:'-]" .viminfo > .viminfo_clear
    bash $ cp .viminfo_clear .viminfo
    

    If you open the .viminfo, you will find that the command line history is started with ":", the file mark is started with "'", and the jumplist is started with "-".

提交回复
热议问题