tags:

views:

93

answers:

1

I know there's NERDTree and NERDTreeToggle,

however the function I want is:

if there is not a NERDTree window, pop one up if there already is one, switch to the NERDTree window

Thanks!

A: 

Just use the NERDTree command. It seems to do this for you unless I'm missing something you want. You can use custom and inbuilt commands straight in vimscript. Eg.

function NerdyFoo()
    echo "FooBar"
    NERDTree
    echo "Wibblybits"
endfun

:call NerdyFoo()
michael
:NERDTree... move up/down, open a directory... open a file :NERDTree// what we see is a re-opening, the previous directory is closed
anon
ok. you might need to add that in question with an example.
michael