1

In vim, I open a terminal using :term and enter the normal mode using <C-w> <N>. Then, :Explore does not open the vim's file navigation view, but creates a another split window of the current terminal session.

I would like to know why this is happening, and how to fix it. Thank you!

This is badly slowing down my workflow, as sometimes the vim terminal window is the only window left. Then, I would like to open a text file in a split window to edit by :Vexplore and selecting the text file. However since the :Explore command doesn't work as expected, I have to exit vim entirely using :q! and just restart vim to open the file, which seems to be a waste of time.

Edit: I kind of found a way to not have to close vim, when the terminal is the only window left. Do :new to open a new empty window, and from there all normal mode command work just as fine.

0
1

In vim, I open a terminal using :term and enter the normal mode using . Then, :Explore does not open the vim's file navigation view, but creates a another split window of the current terminal session.

That is how it should be.

I would like to know why this is happening, and how to fix it. Thank you!

:Explore is provided by built-in netrw plugin. You can read help about it :h netrw or :h :Explore.

This is happening because :Explore command wants to show you list of files in a new buffer but current window either has modified contents or can't be :h 'hidden'. So instead of reusing current window, it has to create a new one in a split.

This is badly slowing down my workflow, as sometimes the vim terminal window is the only window left. Then, I would like to open a text file in a split window to edit by :Vexplore and selecting the text file. However since the :Explore command doesn't work as expected, I have to exit vim entirely using :q! and just restart vim to open the file, which seems to be a waste of time.

You can just do <C-w>:split newfile.txt<CR> or <C-w>:Explore<CR> and select file there. Or delete buffer with terminal <C-w>:bd!<CR>

2
  • Hi, thank you so much for your answer! So from this explanation, i get that the terminal buffer is treated in a special way because it can't be hidden. (maybe the same reason i can exit the terminal only with :q! command and not the normal :q command that works for normal text files. However for the solution, the strange part is that <C-w> :Explore<CR> to me doesn't work at all. Should I think that it is something wrong with my settings of WSL2 or is it just like that for all other linux environments?
    – B1LLP4RK
    Sep 9 at 19:47
  • "doesn't work" is a bit vague. :Explore will not replace your terminal buffer.
    – Maxim Kim
    Sep 10 at 6:53

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.