简体   繁体   English

VIM - NerdTree - VIM启动时打开书签

[英]VIM - NerdTree - Open Bookmarks when VIM is started

I set VIM to open NERDTree whenever VIM is started by doing this: autocmd VimEnter * NERDTree 每当VIM启动时,我都会将VIM设置为打开NERDTree:autocmd VimEnter * NERDTree

What changes should I make to my vimrc file so that the Bookmarks also open up whenever VIM & NerdTree are started? 我应该对我的vimrc文件进行哪些更改,以便每当VIM和NerdTree启动时书签也会打开?

let NERDTreeShowBookmarks=1 will display the bookmarks table on startup. let NERDTreeShowBookmarks=1将在启动时显示书签表。 If you wanted to actually open the files for editing, I'm not sure how to do that. 如果你想实际打开文件进行编辑,我不知道该怎么做。

NERDTree provides a very nice documentation file. NERDTree提供了一个非常好的文档文件。 If you extracted the zip file in ~/.vim, it is located at ~/.vim/doc/NERD_tree.txt. 如果您在〜/ .vim中解压缩了zip文件,则它位于〜/ .vim / doc / NERD_tree.txt。 If you want to use with vim's built in help, run :helptags ~/.vim/doc/ and then you'll be able to access it with :help NERDTree . 如果你想使用vim的内置帮助,运行:helptags ~/.vim/doc/然后你就可以使用:help NERDTree来访问它。

Of course, if you extracted the zip someplace else, replace ~/.vim with the folder you extracted it into. 当然,如果您在其他位置解压缩了zip,请将〜/ .vim替换为您将其解压缩到的文件夹。

From the help file of Nerdtree : 从Nerdtree的帮助文件中:

2.2.1. 2.2.1。 The Bookmark Table NERDTreeBookmarkTable 书签表NERDTreeBookmarkTable
If the bookmark table is active (see |NERDTree-B| and |'NERDTreeShowBookmarks'|), it will be rendered above the tree. 如果书签表处于活动状态(参见| NERDTree-B |和|'NERDTreeShowBookmarks'|),它将在树上方呈现。 You can double click bookmarks or use the |NERDTree-o| 您可以双击书签或使用| NERDTree-o | mapping to activate them. 映射以激活它们。 See also, |NERDTree-t| 另见,| NERDTree-t | and |NERDTree-T| 和| NERDTree-T |

So I guess that 所以我想是的
let NERDTreeShowBookmarks=1 in your .vimrc should work. let NERDTreeShowBookmarks=1 .vimrc let NERDTreeShowBookmarks=1可以正常工作。

I know this question was asked a while ago but since it is at the top of the google results I thought I would give the proper answer. 我知道这个问题刚才被问到,但由于它是google结果的顶部,我想我会给出正确的答案。

In your .vimrc file NERDTreeFromBookmark will not op a bookmark name BUT it will open a hard path. 在你的.vimrc文件中,NERDTreeFromBookmark不会显示书签名称,但它会打开一个硬路径。

For example: 例如:

au VimEnter *  NERDTreeFromBookmark /path/to/your/bookmark/folder/

This will open NERDTree at that location on VIM startup. 这将在VIM启动时在该位置打开NERDTree。

Hope that helps some people. 希望能帮助一些人。

EDIT: 编辑:

im guessing you could also do: 我猜你也可以这样做:

au VimEnter *  NERDTree /path/to/a/folder/

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

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