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

发布于 2024-10-14 07:40:46 字数 143 浏览 5 评论 0原文

我将 VIM 设置为在 VIM 启动时打开 NERDTree,方法是: autocmd VimEnter * NERDTree

我应该对我的 vimrc 文件进行哪些更改,以便每当 VIM 和 NERDTree 时书签也打开。 NerdTree 启动了吗?

I set VIM to open NERDTree whenever VIM is started by doing this: autocmd VimEnter * NERDTree

What changes should I make to my vimrc file so that the Bookmarks also open up whenever VIM & NerdTree are started?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

一页 2024-10-21 07:40:46

let NERDTreeShowBookmarks=1 将在启动时显示书签表。如果您想实际打开文件进行编辑,我不知道该怎么做。

NERDTree 提供了一个非常好的文档文件。如果您在 ~/.vim 中提取了 zip 文件,则它位于 ~/.vim/doc/NERD_tree.txt。如果您想使用 vim 的内置帮助,请运行 :helptags ~/.vim/doc/,然后您就可以使用 :help NERDTree 访问它。

当然,如果您将 zip 解压到其他位置,请将 ~/.vim 替换为您解压到的文件夹。

let NERDTreeShowBookmarks=1 will display the bookmarks table on startup. 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. If you extracted the zip file in ~/.vim, it is located at ~/.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.

Of course, if you extracted the zip someplace else, replace ~/.vim with the folder you extracted it into.

維他命╮ 2024-10-21 07:40:46

来自 Nerdtree 的帮助文件:

2.2.1。书签表NERDTreeBookmarkTable
如果书签表处于活动状态(请参阅 |NERDTree-B| 和 |'NERDTreeShowBookmarks'|),它将呈现在树上方。您可以双击书签或使用 |NERDTree-o|映射来激活它们。另请参阅 |NERDTree-t|和 |NERDTree-T|

所以我猜
.vimrc 中的 let NERDTreeShowBookmarks=1 应该可以工作。

From the help file of Nerdtree :

2.2.1. The Bookmark Table NERDTreeBookmarkTable
If the bookmark table is active (see |NERDTree-B| and |'NERDTreeShowBookmarks'|), it will be rendered above the tree. You can double click bookmarks or use the |NERDTree-o| mapping to activate them. See also, |NERDTree-t| and |NERDTree-T|

So I guess that
let NERDTreeShowBookmarks=1 in your .vimrc should work.

你又不是我 2024-10-21 07:40:46

我知道这个问题不久前被问过,但由于它位于谷歌结果的顶部,我想我会给出正确的答案。

在你的 .vimrc 文件中 NERDTreeFromBookmark 不会操作书签名称,但会打开一个硬路径。

例如:

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

这将在 VIM 启动时在该位置打开 NERDTree。

希望能帮助一些人。

编辑:

我猜你也可以这样做:

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

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.

In your .vimrc file NERDTreeFromBookmark will not op a bookmark name BUT it will open a hard path.

For example:

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

This will open NERDTree at that location on VIM startup.

Hope that helps some people.

EDIT:

im guessing you could also do:

au VimEnter *  NERDTree /path/to/a/folder/
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文