Skip to content

Commit

Permalink
Implements the fix to tpope#74 as tested in issue comments
Browse files Browse the repository at this point in the history
  • Loading branch information
micku committed Nov 16, 2018
1 parent c38ea21 commit d90918c
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 @@ -27,7 +27,7 @@ if !exists("g:netrw_banner")
endif
unlet! 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 @@ -48,8 +48,13 @@ function! s:opendir(cmd) abort
elseif expand('%') =~# '^$\|^term:[\/][\/]'
execute a:cmd '.'
else
let alt_file = expand('%:t')
if !exists("g:alt_file") || g:alt_file == 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 d90918c

Please sign in to comment.