我想*.pyc
文件不在 NERDTree vim 插件中显示。
如何做到这一点?
你想要这个NERDTreeIgnore
选项。例如,在您的.vimrc
:
let NERDTreeIgnore = ['\.pyc$']
WhereNERDTreeIgnore
是与要排除的文件匹配的正则表达式数组。
刚刚遇到问题:隐藏没有扩展名的二进制文件怎么办?
无法隐藏它们,但可以对文件进行排序以消除一些俗气的混乱。问题看起来像:
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).