darkrc/vim/plugin/netrw_improved.vim

38 lines
940 B
VimL
Raw Permalink Normal View History

let g:netrw_liststyle=3
let g:netrw_banner=0
let g:netrw_browse_split=4
" 1 - open files in a new horizontal split
" 2 - open files in a new vertical split
" 3 - open files in a new tab
" 4 - open in previous window
" Netrw window size in %
2020-08-19 11:53:22 +00:00
let g:netrw_winsize = 20
" Reuse directory listings
let g:netrw_fastbrowse = 1
2020-08-19 09:45:54 +00:00
augroup NETRW
au!
2020-08-19 11:12:31 +00:00
au FileType netrw nmap <buffer> l gn:exec("tcd ".b:netrw_curdir)<CR>
au FileType netrw nmap <buffer> h -:exec("tcd ".b:netrw_curdir)<CR>
2020-08-19 09:49:35 +00:00
au FileType netrw nmap <buffer> <space> <CR>
2020-08-19 11:12:31 +00:00
au FileType netrw nmap <nowait> <buffer> q :q<CR>
2020-08-19 11:53:22 +00:00
au FileType netrw set winfixwidth
2020-08-19 09:45:54 +00:00
augroup END
2020-08-19 11:12:31 +00:00
function s:vex()
2020-08-19 15:32:32 +00:00
let netrw_windows = getwininfo()
\->filter({ k,v -> v["variables"]->has_key("netrw_treedict") })
\->filter({ k,v -> v["tabnr"]==tabpagenr() })
if netrw_windows->len() > 0
call win_gotoid(netrw_windows[0]["winid"])
else
Vex .
end
2020-08-19 11:12:31 +00:00
endfun
nnoremap <leader><space> :call <SID>vex()<CR>