Here's my netrw settings, I toggle netrw with <F2>.
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 = 20
set autochdir
" Toggle Vexplore with <F2>
function! ToggleVExplorer()
if exists("t:expl_buf_num")
let expl_win_num = bufwinnr(t:expl_buf_num)
let cur_win_num = winnr()
if expl_win_num != -1
while expl_win_num != cur_win_num
exec "wincmd w"
let cur_win_num = winnr()
endwhile
close
endif
unlet t:expl_buf_num
else
Vexplore"
let t:expl_buf_num = bufnr("%")
endif
endfunction
map <F2> :call ToggleVExplorer()<CR>
This is the first view I open netrw:
Then I do some operations in netrw just like this.
But when toggle happened, the operations I did disappear.
Can anyone who knows about netrw help me solve this problem? I have been confused for two months. SOS!
I hope when I open netrw again, I can see the view when I leave netrw. I know that if I don't close netrw it will not clean my operation when switch to other buffers, but sometimes I have to close it temporarily due to valuable screen space.