Open file in vertical split in Vim / netrw

vim

If I open vim with vim . netrw provides me with a nice list of the files and directories in the current directory.

If I open a file using v the file opens in a very narrow split down the left hand side of the screen and the directory listing remains open in a wide split on the right hand side of the screen.

Ideally I'd like it to have the opposite effect. ie. Show the directory listing in a narrow split on the left hand side of the screen and show the file in a wide split on the right hand side of the screen.

Any help much appreciated.

Best Answer

Easy. Put the following line in your .vimrc and restart vim:

let g:netrw_altv=1

See :he netrw-v, :he g:netrw_altv.

In current session simply run the command.

Related Question