更改 NERDTree 中的根 [英] Change root in NERDTree

查看:20
本文介绍了更改 NERDTree 中的根的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用

:BookmarkToRoot <bookmark>

command 和 C 字母,但是当我关闭 vim 并打开 vim 时,根不会改变.

command and with C letter but when I close vim and open vim the root is not changed.

你知道如何永远改变根吗?

Do you know how to change the root forever?

推荐答案

您可以尝试以下操作:

nnoremap <leader>n :NERDTree /path/to/folder<CR>

我的 .vimrc 中有这个:

I have this in my .vimrc:

set autochdir
let NERDTreeChDirMode=2
nnoremap <leader>n :NERDTree .<CR>

这样 NERDTree 总是在当前文件夹中打开.

so that NERDTree always opens in the current folder.

对于第一行,工作目录始终是活动缓冲区所在的目录.

With the 1st line, the working directory is always the one where the active buffer is located.

第二行,我确保工作目录设置正确.

With the 2nd line, I make sure the working directory is set correctly.

在第三行,我点击 n 打开 NERDTree.

With the 3rd line, I hit <leader>n to open NERDTree.

这篇关于更改 NERDTree 中的根的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆