Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Double nerdtree when passing directory as argument #32

Open
@nybblr

Description

@nybblr

Love the plugin -- makes my NERD life that much better =)

Whenever I call:
$ mvim /path/to/dir

Two NERDTree windows are opened: one on the left that is at my home directory, and a big one on the right that is cd'ed to the directory I passed in. It seems the left nerdtree also sets the PWD last, so if I focus from the left tree to the right tree, the directory is suddenly my home directory instead of the directory I pass in.

The left NERDtree is obviously generated by this plugin: if I open a new tab, it mirrors that one. The one on the right (takes up most of the screen) is what NERDTree auto loads, probably because it tries to take place of netrw, the default vim dir explorer.

Obviously this behavior is irritating...I like the behavior I get if I just run mvim with no args: then it opens this plugin's nerdtree window to the terminal's pwd, and opens a blank buffer on the left. What needs to be changed to fix the behavior to match this when given a directory? I'll gladly help out, but I'm somewhat new to vim plugin architecturing so a push in the right direction would be great!

Just FYI this only happens with directories: if I give a file, it uses the directory as the PWD and root of the nerdtree (which your plugin opens without competition from the netrw hook) as it should. It just misbehaves when I use a directory as the argument.

Thanks!
~ Jonathan Martin

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions