[英]How to set Vim NERDTree to prevent show .git folders and files?
I make visible all hidden files and folders, also, .git
folders and files ( .git
, .gitignore
and etc.)我使所有隐藏的文件和文件夹可见,还有
.git
文件夹和文件( .git
、 .gitignore
等)
In a project tree when using NERDTree
in Vim, I wanted to manage to show all other hidden files except .git
folder and its subfolders and files.在 Vim 中使用
NERDTree
时,在项目树中,我想设法显示除.git
文件夹及其子文件夹和文件之外的所有其他隐藏文件。
How I can do it?我该怎么做?
It worked for me.它对我有用。 Did you try the following options ?
您是否尝试过以下选项?
let NERDTreeShowHidden=1
Maybe you are not at the root of your git repo and that is why you don't see any .git* files/dirs
也许您不在 git 存储库的根目录下,这就是为什么您看不到任何
.git* files/dirs
在 NerdTree 窗口中按 Shift+I
Actually, the question post wants to show all hidden files and folders but ignore some files or folders like .git
folder.实际上,问题帖子想要显示所有隐藏的文件和文件夹,但忽略一些文件或文件夹,如
.git
文件夹。 for this setting:对于此设置:
.vimrc
file and at the end of file insert the following command:.vimrc
文件并在文件末尾插入以下命令:let NERDTreeShowHidden=1
.vimrc
file again and the end of file insert the following command too:.vimrc
文件并在文件末尾插入以下命令:let NERDTreeIgnore=['\.git$']
Hint : recently I migrated from VSCode
and WebStorm
to Vim
so on the second step I ignore some other files and folders, I mean:提示:最近我从
VSCode
和WebStorm
迁移到Vim
所以在第二步我忽略了其他一些文件和文件夹,我的意思是:
let NERDTreeIgnore=['\.git$', '\.idea$', '\.vscode$', '\.history$']
只需将以下内容添加到您的.vimrc
文件中:
let NERDTreeIgnore=[".git"]
Try using this尝试使用这个
let g:NERDTreeIgnore = ['\.git$']
Note that it must start with " \\ " and end with "$".请注意,它必须以“\\”开头并以“$”结尾。 This works for Windows, Linux and MacOs
这适用于 Windows、Linux 和 MacOs
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.