1

When I open a vertical split by providing the path to a directory with :vsplit /my/dir the split window opens with NERDtree showing the directory. I then open a file /my/dir/file. I would then love to switch back to the inital view showing NERDtree with /my/dir in this window again as before.

Background: I often compare/copy stuff from a file in one location to/from a file in a completely different location. Doing this, I would love to be able to browse both locations. I can browse one location with my default NERDtree showing on the left. For browsing the 2nd location, I would love to have the above capability.

4
  • If you don't mind giving up on NERDtree, the builtin in Netrw plugin has a command :Rexplore (:Rex for short) that toggles a window between the last Netrw display and the last Netrw-edited file.
    – D. Ben Knoble
    Oct 20, 2022 at 13:14
  • 1
    Obligatory: vimcasts.org/blog/2013/01/…
    – D. Ben Knoble
    Oct 20, 2022 at 13:14
  • @D.BenKnoble thanks a lot for this interesting article! It looks very promising and I'll give it a try :)
    – Wolfson
    Oct 21, 2022 at 7:33
  • @D.BenKnoble I'm still working based on the builtin Netrw plugin and though still have to internelize the differences, like it a lot so far, thanks again!
    – Wolfson
    Oct 31, 2022 at 9:58

1 Answer 1

1

If you don't mind giving up on NERDtree, the builtin in Netrw plugin has a command :Rexplore (:Rex for short) that toggles a window between the last Netrw display and the last Netrw-edited file.

An obligatory article about favoring same-window-style directory browsing to project-tree-style directory browsing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.