From 399d8978587f92c388dfddc27fda8635a5a1ee48 Mon Sep 17 00:00:00 2001 From: ManjaroOne666 Date: Mon, 27 May 2019 14:09:29 +0100 Subject: [PATCH] update OpenNetrw, CloseNetrw --- after/ftplugin/netrw.vim | 6 +++--- vimrc | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/after/ftplugin/netrw.vim b/after/ftplugin/netrw.vim index 2be4e8e..f8d0c79 100644 --- a/after/ftplugin/netrw.vim +++ b/after/ftplugin/netrw.vim @@ -1,4 +1,4 @@ -nmap o :call CloseNetrw(1) -nmap q :call CloseNetrw(0) +nmap o +nmap q :call CloseNetrw(1) +nmap Q :call CloseNetrw(0) setl bufhidden=wipe -setl rnu nu diff --git a/vimrc b/vimrc index add1d3f..0ff6e0f 100644 --- a/vimrc +++ b/vimrc @@ -466,6 +466,7 @@ command! -nargs=1 -complete=command Redir silent call Redir() "}}} function! OpenNetrw() abort "{{{ Texplore + setl rnu nu endfunction "}}} @@ -474,7 +475,9 @@ function! CloseNetrw(keep_buffer) abort "{{{ let l:current_buffer = bufnr("%") tabclose tabprevious - execute "buffer" l:current_buffer + if bufexists(l:current_buffer) > 0 + execute "buffer" l:current_buffer + endif else tabclose tabprevious