From a0abb9566d53229a359a290c230fd248c4886913 Mon Sep 17 00:00:00 2001 From: DarkWiiPlayer Date: Wed, 19 Aug 2020 13:12:31 +0200 Subject: [PATCH] Set netrw as default file searcher --- vim/plugin/netrw_improved.vim | 18 ++++++++++++++++-- vim/plugin/shame.vim | 6 ------ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/vim/plugin/netrw_improved.vim b/vim/plugin/netrw_improved.vim index 19a7b50..629226b 100644 --- a/vim/plugin/netrw_improved.vim +++ b/vim/plugin/netrw_improved.vim @@ -16,7 +16,21 @@ let g:netrw_fastbrowse = 1 augroup NETRW au! - au FileType netrw nmap l gn - au FileType netrw nmap h - + au FileType netrw nmap l gn:exec("tcd ".b:netrw_curdir) + au FileType netrw nmap h -:exec("tcd ".b:netrw_curdir) au FileType netrw nmap + au FileType netrw nmap q :q 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 :call vex() diff --git a/vim/plugin/shame.vim b/vim/plugin/shame.vim index 2675347..9798bf6 100644 --- a/vim/plugin/shame.vim +++ b/vim/plugin/shame.vim @@ -217,12 +217,6 @@ endfunction command! -bar RangerChooser call RangeChooser() -if has("unix") - nnoremap :RangerChooser -elseif has("win32") - nnoremap :e %:p:h -end - " --- AUTO CLOSE --- function! s:autoClose_HelperOpen(open, close)