To open a file in Vim with the right pane split around the middle (50%) and the left pane set for browsing files using NetRW, you can modify your .vimrc file as follows:
let g:netrw_browse_split = 4
let g:netrw_preview = 1
These settings will make Vim open files with the right pane split at 50% and set NetRW for browsing files in the left pane with a preview pane.
Here's the detailed explanation:
Vim Split Panes
Vim allows you to split the editor window into multiple panes. You can specify the percentage of the screen that each pane should occupy. In this case, we want the right pane to take up 50% of the screen.
let g:netrw_browse_split = 4
The g:netrw_browse_split variable controls the default split when using NetRW. A value of 4 means the right pane will take up 50% of the screen.
Vim NetRW Preview
NetRW is a plugin for Vim that allows you to browse and edit files in a directory tree. The g:netrw_preview variable enables the preview pane when using NetRW.
let g:netrw_preview = 1
By setting g:netrw_preview to 1, you will see a preview pane when using NetRW.