简体   繁体   中英

How to open a project directory in a new MacVim window with NERDTree

If I want to open, say, a Rails app in MacVim with NERDTree, I simply do $ mvim . from that directory. A new window open with the NERDTree navigator on the left and a buffer on the right.

Now let's say I want to do the same thing, but I already have a MacVim window open. From that window, I want to do exactly what I did above, but without needing to go back to the command line.

I do Cmd-N to open a new window, then I type: :e ~/path/to/new/project . But the NERDTree navigator I get here doesn't work correctly. It's as if it's not aware of the buffer to its right. It doesn't expand or collapse directories and pressing enter on any of the files will open it in the same window as the navigator.

I'm new to all this, so hopefully my terminology and description make some sense :)

假设与mvim捆绑在一起的mvim脚本在$PATH您可以执行以下操作:

:!mvim ~/path/to/new/project

From wherever you are, you can issue :NERDTree ~/path/to/new/project and NERDTree will open up with ~/path/to/new/project as the root. I tried it out and it behaves as expected.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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