4

When viewing a file /tmp/vim_split_demo/test.txt, the parent directory can be opened in a horizontal split screen using the command :Sex, as shown in these screenshots:

enter image description here

What command gives same functionality, except with the screen split vertically instead of horizontally? Here is a screenshot of the desired results.

enter image description here

That screenshot came from vim /tmp/vim_split_demo, then doing vsplit and opening the file in one side. I've tried :VSex, :Vsex and a few others, but can't figure it out. It doesn't matter which side shows the parent directory.

1
  • 3
    Yes, the title is very silly but it has all the terms I'm trying to match. I felt weird Googling for it on my work computer. Sep 12, 2019 at 19:33

1 Answer 1

14

What you're looking for is :Vexplore.

From your question, it sounds like you started off knowing only about :Sexplore and understandably thought that that was the basic command for bringing up the vim file explorer (which is called netrw). However, the basic command is just :Explore, and :SExplore is actually just a variant of that.

The basic :Explore version doesn't open netrw in a split window, it just replaces the current window with netrw.

There are several variants. Here's the full list from the vim help documentation, which you can see here, or in vim by typing

:help explore

 :[N]Explore[!]  [dir]... Explore directory of current file      *:Explore*
 :[N]Hexplore[!] [dir]... Horizontal Split & Explore             *:Hexplore*
 :[N]Lexplore[!] [dir]... Left Explorer Toggle                   *:Lexplore*
 :[N]Sexplore[!] [dir]... Split&Explore current file's directory *:Sexplore*
 :[N]Vexplore[!] [dir]... Vertical   Split & Explore             *:Vexplore*
 :Texplore       [dir]... Tab & Explore                          *:Texplore*
 :Rexplore            ... Return to/from Explorer                *:Rexplore*

 Used with :Explore **/pattern : (also see |netrw-starstar|)
 :Nexplore............. go to next matching file                *:Nexplore*
 :Pexplore............. go to previous matching file            *:Pexplore*

For more detailed information about each variant, see the help docs.

2
  • 2
    Might be worth mentioning the original Explore and where to get help
    – D. Ben Knoble
    Sep 13, 2019 at 12:30
  • 1
    @D.BenKnoble Good suggestion. I updated my answer.
    – Mike Holt
    Sep 13, 2019 at 16:48

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.