lampShade
lampShade

Reputation: 4391

Is there a way to make NERDtree load only directories that I specify?

Is there a way to make NERDtree load only directories that I specify? I don't see how to do this.

Upvotes: 2

Views: 944

Answers (1)

mliebelt
mliebelt

Reputation: 15525

One idea could be to use bookmarks for that purpose. For doing that, use the following sequence of commands:

  • Start VIM and NERDtree inside it.
  • Navigate to the directory you want to visit often, lets name that directory example my_proj.
  • Enter the command: Bookmark my_proj.
  • You may now open the list of Bookmarks by pressing B.
  • Navigate to the bookmark you want to open.
  • Press RETURN there.

The bookmark seems to be persistent, so you are now able to open a new VIM editor, and revisit the directories you have bookmarked. And you could even start the NERDtree with an additional argument, which could be a bookmark or directory (thank's david for the hint). So by entering NERDtree my_proj, everything is started fine.

Another idea could be to insert in your .vimrc file the following line:

:cd c:/path/To/my_proj

so when you start then NERDtree, your project directory should be in focus.

Upvotes: 2

Related Questions