【问题标题】:NERDTree Load Particular Directory AutomaticallyNERDTree 自动加载特定目录
【发布时间】:2011-04-27 07:34:48
【问题描述】:

我在 windows 中使用 gvim。默认情况下 nerdtree 加载 C:\ 驱动器作为默认值。我喜欢将其更改为 E:\ 驱动器。如何实现这一点?

每当我尝试使用 :NERDTree 命令启动 NERDTree 时,都会收到此错误 E492: Not an editor command: NERDTree

【问题讨论】:

    标签: vim nerdtree


    【解决方案1】:

    我的vimrc 文件中有以下代码

    cd ~/documents
    map <F2> :NERDTreeToggle<CR>
    " open Nerd Tree in folder of file in active buffer
    map <Leader>nt :NERDTree %:p:h<CR>
    

    cd 命令不是 NerdTree 特定的。它只是在 Vim 启动时更改工作目录,这对我来说是明智的。

    【讨论】:

    • %:p:h如何打开活动缓冲区中的文件文件夹?
    【解决方案2】:

    来自 NERDTree 帮助文件: :NERDTree [<start-directory> | <bookmark>] *:NERDTree* Opens a fresh NERD tree. The root of the tree depends on the argument given. There are 3 cases: If no argument is given, the current directory will be used. If a directory is given, that will be used. If a bookmark name is given, the corresponding directory will be used. For example: > :NERDTree /home/marty/vim7/src :NERDTree foo (foo is the name of a bookmark)

    【讨论】:

      【解决方案3】:

      在我的vimrc 文件中,我使用这个autocmd vimenter * NERDTree G:\G:\ 应该设置为您的默认驱动器,但是,它只是 NERDTree 的工作目录。添加cd G:\更改vim 开始工作目录。就像Jeromy Anglim 说的那样。

      【讨论】:

        猜你喜欢
        • 2017-12-11
        • 2014-04-10
        • 2020-01-01
        • 2011-07-17
        • 1970-01-01
        • 2022-01-02
        • 2014-11-02
        • 1970-01-01
        • 2023-03-31
        相关资源
        最近更新 更多