(Originally asked in a wrong place - https://stackoverflow.com/questions/63780235/is-it-possible-to-view-the-current-file-content-during-directory-navigation-in-v)
I am watching this Pluralsight course on helm and the instructor uses vi from the linux console all the time in the directory browsing mode with the current file being automatically open for viewing in the other pane:
When I run vi .
it does open the directory navigation mode, but I have only one pane and to view a file I need to Enter it and then it shows it instead of the directory view. I can go back with :E
, but the experience is not the same.
How can we tell vi to automatically open the current file in a side pane, so both the directory navigator and the file content are available in side by side panes?
I do not have any vi configuration. This is a fresh new Linux 18.04 VM to which I connect with ssh.
vi .
(edit the current directory), which automatically opens netrw. It appears that while hovering in netrw, they get a side-panel with the file. – D. Ben Knoble♦ Sep 8 '20 at 15:06vi .
. I do not understand the meaning of "hovering" when working from the console. What I can see is that in the console mode there is no hovering. I can move the selection from file to file and enter folders. But to view a file I need to enter it and that opens the file content instead of the file browser. In short, the default out of the box experience is not the one I wish to have, The accepted answer moves me closer to the desired experience. – mark Sep 8 '20 at 16:37p
as indicated by the answer. I find it quite confusing - Enter to enter a folder, butp
to preview. I find myself often pressing Enter instead ofp
and then I have no idea how to return back to the file navigator - has to quit vi completely and restart. – mark Sep 8 '20 at 18:06