When using netrw as :Lex, opening a file simply replaces the current file open. How do I open a file in a new tab from Lex or in a new vertical split?
1 Answer
See :h netrw-t:
BROWSING WITH A NEW TAB netrw-t
Normally one enters a file or directory using the <cr>. The "t" map
allows one to open a new window holding the new directory listing or file in
a new tab.
If you'd like to have the new listing in a background tab, use gT.
And :h netrw-v:
BROWSING WITH A VERTICALLY SPLIT WINDOW netrw-v
Normally one enters a file or directory using the <cr>. However, the "v" map
allows one to open a new window to hold the new directory listing or file. A
vertical split is used. (for horizontal splitting, see netrw-o)
Normally, the v key splits the window vertically with the new window and
cursor at the left.
Just press t instead of pressing Enter for a new tab, or v for a new vertical split.
-
Thanks. While opening file in a new tab with
t, it opens the file in a new unsplit window. Can I modify it to act like other IDEs, i.e. open the file tabed in the existing right split window? I couldn't find this in:h netrw-tflipper– flipper2020-07-12 10:55:21 +00:00Commented Jul 12, 2020 at 10:55 -
In Vim, tabs contain splits. Splits can't contain tabs.muru– muru2020-07-12 11:47:12 +00:00Commented Jul 12, 2020 at 11:47
:Lexploreor:Lexin shortcut, opensnetrwon the left side of vim.