diff --git a/doc/vinegar.txt b/doc/vinegar.txt index 44d419e..0798487 100644 --- a/doc/vinegar.txt +++ b/doc/vinegar.txt @@ -13,7 +13,13 @@ MAPPINGS *vinegar-mappings* *vinegar--* - Open the parent directory of the current file. This is the only mapping available outside of netrw - buffers. + buffers. If you have already mapped - to somthing else, + you'll need to map one of these plugs: + + VinegarUp + VinegarTabUp + VinegarSplitUp + VinegarVerticalSplitUp *vinegar-~* ~ Open $HOME. diff --git a/plugin/vinegar.vim b/plugin/vinegar.vim index 168b09a..7fdd60f 100644 --- a/plugin/vinegar.vim +++ b/plugin/vinegar.vim @@ -28,14 +28,17 @@ endif unlet! s:netrw_up nnoremap VinegarUp :call opendir('edit') -if empty(maparg('-', 'n')) - nmap - VinegarUp -endif - nnoremap VinegarTabUp :call opendir('tabedit') nnoremap VinegarSplitUp :call opendir('split') nnoremap VinegarVerticalSplitUp :call opendir('vsplit') +if empty(mapcheck('-', 'n')) && !hasmapto('VinegarUp') && + \ !hasmapto('VinegarSplitUp') && + \ !hasmapto('VinegarVerticalSplitUp') && + \ !hasmapto('VinegarTabUp') + nmap - VinegarUp +endif + function! s:opendir(cmd) abort let df = ','.s:dotfiles if expand('%:t')[0] ==# '.' && g:netrw_list_hide[-strlen(df):-1] ==# df