Set netrw as default file searcher
This commit is contained in:
parent
9dc6472959
commit
a0abb9566d
2 changed files with 16 additions and 8 deletions
|
@ -16,7 +16,21 @@ let g:netrw_fastbrowse = 1
|
||||||
|
|
||||||
augroup NETRW
|
augroup NETRW
|
||||||
au!
|
au!
|
||||||
au FileType netrw nmap <buffer> l gn
|
au FileType netrw nmap <buffer> l gn:exec("tcd ".b:netrw_curdir)<CR>
|
||||||
au FileType netrw nmap <buffer> h -
|
au FileType netrw nmap <buffer> h -:exec("tcd ".b:netrw_curdir)<CR>
|
||||||
au FileType netrw nmap <buffer> <space> <CR>
|
au FileType netrw nmap <buffer> <space> <CR>
|
||||||
|
au FileType netrw nmap <nowait> <buffer> q :q<CR>
|
||||||
augroup END
|
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>
|
||||||
|
|
|
@ -217,12 +217,6 @@ endfunction
|
||||||
|
|
||||||
command! -bar RangerChooser call RangeChooser()
|
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 ---
|
" --- AUTO CLOSE ---
|
||||||
|
|
||||||
function! s:autoClose_HelperOpen(open, close)
|
function! s:autoClose_HelperOpen(open, close)
|
||||||
|
|
Loading…
Reference in a new issue