如何在Vim浏览oldfiles中显示固定数量的条目

时间:2015-10-15 22:30:48

标签: vim

我是Vim的新手。我发现浏览旧文件显示几个条目(最近打开70个文件)。有没有办法控制我想要在我的"浏览oldfiles"中看到的文件数量?名单。

我确实检查了Vim的帮助,没有提到如何控制条目数量?

:ol[dfiles]     List the files that have marks stored in the viminfo
            file.  This list is read on startup and only changes
            afterwards with ":rviminfo!".  Also see |v:oldfiles|.
            The number can be used with |c_#<|.
            {not in Vi, only when compiled with the |+eval|
            feature}

:bro[wse] ol[dfiles][!]
            List file names as with |:oldfiles|, and then prompt
            for a number.  When the number is valid that file from
            the list is edited.
            If you get the |press-enter| prompt you can press "q"
            and still get the prompt to enter a file number.
            Use ! to abandon a modified buffer. |abandon|
            {not when compiled with tiny or small features}

2 个答案:

答案 0 :(得分:4)

设置viminfo。例如,设置以前编辑过的文件的最大数量,比如70,

set viminfo='70

更多信息:h 'viminfo'

答案 1 :(得分:0)

我刚刚得到了一个很好的解决方案https://vi.stackexchange.com/a/11829/7339

    :browse filter /pattern/ oldfiles

我们可以避免

    :bro filter /tips/ ol

这样,您的列表只会显示包含“提示”的文件。在它的名字上。