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.

Wolfson
  • 173
  • 1
  • 7
  • 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 '22 at 13:14
  • 1
    Obligatory: http://vimcasts.org/blog/2013/01/oil-and-vinegar-split-windows-and-project-drawer/ – D. Ben Knoble Oct 20 '22 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 '22 at 07: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 '22 at 09:58

1 Answers1

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.

D. Ben Knoble
  • 26,070
  • 3
  • 29
  • 65