简体   繁体   English

使用 DirDiff 插件时如何禁用 NERDTree

[英]How to disable NERDTree when the DirDiff plugin is in use

I've just started using the NERDTree vim plugin and am generally pleased with it.我刚开始使用NERDTree vim 插件,总体上对它很满意。 I also sometimes use the DirDiff plugin.我有时也使用DirDiff插件。 My most frequent use of the DirDiff plugin is for git diff via this stack overflow explanation .我最常使用 DirDiff 插件是通过此堆栈溢出说明用于 git 差异。

I'd like to configure NERDTree to be automatically closed when the DirDiff plugin in effect.我想将 NERDTree 配置为在 DirDiff 插件生效时自动关闭。 Is this possible via my .vimrc ?这可以通过我的.vimrc实现吗? I install these plugins via vim-plug .我通过vim-plug安装这些插件。

You can create a custom function that triggers DirDiff and uses :NERDTreeClose as dependency and bind that custom function to keymap that you using for DirDiff.您可以创建一个自定义 function 来触发 DirDiff 并使用:NERDTreeClose作为依赖项并将该自定义 function 绑定到您用于 DirDiff 的键盘映射。

You can also try to play around with autocmd BufEnter .您也可以尝试使用autocmd BufEnter

I remember this was my problem as well, if you find solution combining my suggestion please post it here.我记得这也是我的问题,如果您找到结合我的建议的解决方案,请在此处发布。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM