Answers:
你可以做:
:redir => scriptn | sil exe 'scriptnames' | redir end | echo(system('grep pattern',scriptn))
它能做什么 :
:redir => scriptn "redirect following output to variable scriptn
:sil exe 'scriptnames' "silently execute scriptnames
:redir end "end the redirection
:echo(system('grep pattern',scriptn)) "echo the call of grep witht that input with the pattern `pattern`
首先,您需要获取的输出scriptnames
并将其放入缓冲区。
您可以使用:redir
:
:redir @a " redirect output of following ex commands to register a
:scriptnames " press G to get to the end of the output if it's too long
:redir END " end the redirection
:vnew " new buffer in vertical window
:put a " put content of register
/pattern " search for 'pattern'
也就是说,:scriptname
输出时间太长而无法用自己的眼睛进行扫描,这可能是更深层问题的征兆。
:scriptnames
比Magna Carta长,则可以考虑安装Tim Pope的scriptease。它提供了:Scriptnames
将所有垃圾放入快速修复列表的功能。在这里,您可以根据自己的需求搜索内容,将其保存到文件中,或者转到相应的脚本。
NERDTree
将其所有功能放在一个文件中,以使输出:scriptnames
简短?这会使它成为一个更好的书面插件吗?