0

I'm usually in 2 vertical splits, in each one I jump in an out of files using :Ex. When a split shows a file and I type :Ex I expect this split to show me the netrw UI, where I can choose another file.

But sometimes instead of replacing the split, :Ex will create a horizontal split inside this split and show me both the netrw UI and the file I was previously viewing. I haven't identified when and how, was wondering if you could help me understand if I'm using it wrong.

1
2

This is directly explained under :help :Explore:

:Explore will open the local-directory browser on the current file's directory (or on directory [dir] if specified). The window will be split only if the file has been modified and 'hidden' is not set, otherwise the browsing window will take over that window. Normally the splitting is taken horizontally.

You might want to consider adding set hidden to your vimrc to ensure :Explore will not create a new split. See :help 'hidden' for details. I generally recommend enabling this option, I think it's quite useful behavior and it's not really counterintuitive, it doesn't take much to get used to its behavior.


As a general advice, when you have questions about a specific command or setting or behavior in Vim, start looking at :help (+ whatever command you're running.) Vim's help system is very good and in the vast majority of cases will have very direct answers to the questions you might have.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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