194

我想*.pyc文件不在 NERDTree vim 插件中显示。

如何做到这一点?

4

2 回答 2

309

你想要这个NERDTreeIgnore选项。例如,在您的.vimrc

let NERDTreeIgnore = ['\.pyc$']

WhereNERDTreeIgnore是与要排除的文件匹配的正则表达式数组。

于 2011-04-08T23:40:13.483 回答
0

刚刚遇到问题:隐藏没有扩展名的二进制文件怎么办?

无法隐藏它们,但可以对文件进行排序以消除一些俗气的混乱。问题看起来像:

file1*
file1.c
file2*
file2.c

解决方案:

let NERDTreeSortOrder=['\.c$']

结果:

file1.c
file2.c
file1*
file2*

这将首先对以“.c”结尾的文件进行排序(如果需要,后跟其他扩展名)。您不会摆脱二进制文件,但它变得易于管理。

NERDTree has a mechanism to detect and highlight files with the extra execute bit, where -rwxr-xr-x displays in bold with a "*" at the end of the filename. It would not be hard to add an extra mechanism to hide executable files (useful for compiled stuff, not so desirable for scripts).

于 2018-04-18T14:08:44.753 回答