I found the following chunk of command on this blog to have a file browser open by starting vim that I added to my .vimrc. It splits the window into 2 panes: a file browser and the text editor. The active pane is the file browser one. When quitting (from the text editor pane), we have to quit the editor and then the file browser pane

let g:netrw_banner = 0
let g:netrw_liststyle = 3
let g:netrw_browse_split = 4
let g:netrw_altv = 1
let g:netrw_winsize = 25
augroup ProjectDrawer
  autocmd VimEnter * :Vexplore
augroup END

What I would like to do have as behaviour is:

  1. To have the cursor on the text editor (and not on the file browser) when opening.
  2. When closing from the text editor, I want to quit vim altogether (and not having to close the text editor and then close the file browser pane): to have the text editor as "master"

Many thanks for your help!

  • 1
    You may want to read this article on project drawers
    – D. Ben Knoble
    Jul 5 '20 at 12:34
  • For #2 you can quit vim with a single command even with multiple windows open using :qa or one of its variations (e.g. :wqa to write before quitting).
    – B Layer
    Jul 5 '20 at 14:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.