Set netrw as default file searcher

This commit is contained in:
Talia 2020-08-19 13:12:31 +02:00
parent 9dc6472959
commit a0abb9566d
2 changed files with 16 additions and 8 deletions

View file

@ -16,7 +16,21 @@ let g:netrw_fastbrowse = 1
augroup NETRW
au!
au FileType netrw nmap <buffer> l gn
au FileType netrw nmap <buffer> h -
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>
au FileType netrw nmap <buffer> <space> <CR>
au FileType netrw nmap <nowait> <buffer> q :q<CR>
augroup END
function s:vex()
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
endfun
nnoremap <leader><space> :call <SID>vex()<CR>

View file

@ -217,12 +217,6 @@ endfunction
command! -bar RangerChooser call RangeChooser()
if has("unix")
nnoremap <leader><space> :<C-U>RangerChooser<CR>
elseif has("win32")
nnoremap <leader><space> :e %:p:h<CR>
end
" --- AUTO CLOSE ---
function! s:autoClose_HelperOpen(open, close)