I created a
Drawer command to use NetRW as a file drawer with two main uses.
Note: I always use the tree listing mode.
- Open the working directory
- Find a file to allow viewing/opening its siblings
The commands are below:
" open netrw/Explore (similar to NERDTree) command! -nargs=? Drawer if winnr("$") == 1 | Vexplore <args>| else | 1 wincmd w | Explore <args> | endif command! DrawerCwd execute 'Drawer' getcwd() command! DrawerFind let @/=expand("%:t") | execute 'Drawer' expand("%:p:h") | normal n
The only problem is that NetRW won't open a directory if there is already an upper directory open, and this makes my
DrawerFind useles when I already have a NetRw window opened.
Here are some examples:
:Explore /foo/bar/baz " opens /foo/bar/baz dir :Explore /foo/bar " move up to /foo/bar as expected :Explore /foo/bar/baz " won't move down to /foo/bar/baz until window is closed
How can make NetRW descend to lower directories when an upper one is already viewed?