Skip to content

Commit

Permalink
Apply unlisted buffer patch
Browse files Browse the repository at this point in the history
  • Loading branch information
joshpencheon authored Mar 6, 2018
1 parent 44bc76a commit 342ca3f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions plugin/vinegar.vim
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if !exists("g:netrw_banner")
endif
let s:netrw_up = ''

nnoremap <silent> <Plug>VinegarUp :call <SID>opendir('edit')<CR>
nnoremap <silent> <Plug>VinegarUp :call <SID>opendir('Explore')<CR>
if empty(maparg('-', 'n'))
nmap - <Plug>VinegarUp
endif
Expand All @@ -47,8 +47,13 @@ function! s:opendir(cmd) abort
elseif expand('%') =~# '^$\|^term:[\/][\/]'
execute a:cmd '.'
else
let alt_file = expand('%:t')
if !exists("g:netrw_altfile") || g:netrw_altfile == 0
let @# = expand('%')
endif
normal! m`
execute a:cmd '%:h'
call s:seek(expand('#:t'))
call s:seek(alt_file)
endif
endfunction

Expand Down

0 comments on commit 342ca3f

Please sign in to comment.