VIM - NerdTree - Open Bookmarks when VIM is started
Asked Answered
A

3

21

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?

Analyst answered 27/1, 2011 at 16:35 Comment(0)
S
34

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.

Saunderson answered 27/1, 2011 at 16:46 Comment(2)
cool, I didn't know how to load that help file, it's Very useful. So to open NERDTree straight to a bookmark, just do autocmd VimEnter * NERDTree bookmarkNameSkricki
:help NERDTree on vimApiarian
H
7

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.

Homey answered 27/1, 2011 at 16:44 Comment(0)
F
4

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/
Fazio answered 28/4, 2011 at 14:36 Comment(1)
This is actually the answer I was looking for. Thank you.Reprobate

© 2022 - 2024 — McMap. All rights reserved.