本文介绍了如何将 NERDTree 添加到您的 .vimrc的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将 NERDTree 添加到我的 .vimrc 中?

How do I add NERDTree to my .vimrc?

推荐答案

好吧,以前的版本有点简洁,但您正在寻找的答案是将以下行添加到您的 ~/.vimrc 文件.它告诉 Vim 你想设置一个命令在 Vim 启动时运行,但由于它依赖于要加载的各种插件,你不想在所有初始化完成之前运行它:

Okay, the previous version was a bit terse, but the answer you're looking for is to add the line below into your ~/.vimrc file. It tells Vim that you want to setup a command to run when Vim starts, but since it depends on various plugins to be loaded, you don't want to run it until all initialization is finished:

autocmd VimEnter * NERDTree

但是,如果您对光标总是在 NERDTree 窗口中开始这一事实感到恼火,您可以添加第二个自动命令,将光标移动到主窗口中:

If, however, you're annoyed by the fact that the cursor always starts in the NERDTree window, you can add a second autocommand that will move the cursor into the main window:

autocmd VimEnter * NERDTree
autocmd VimEnter * wincmd p

这篇关于如何将 NERDTree 添加到您的 .vimrc的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-09 22:36