[nvim] add DragOut command

This commit is contained in:
Dmytro Meleshko 2020-11-12 11:43:52 +02:00
parent ef1bd7fa6a
commit 9ce4eb6d46
1 changed files with 14 additions and 0 deletions

View File

@ -105,6 +105,20 @@ nnoremap <silent><expr> <CR> empty(&buftype) ? ":write<bar>wall\<CR>" : "\<CR>"
command -nargs=* -complete=file -bar EditGlob call s:EditGlob(<f-args>)
" }}}
" DragOut {{{
" Shows a window for draging (-and-dropping) the currently opened file out.
function s:DragOut(path)
if empty(a:path) | return | endif
if !executable('dragon-drag-and-drop')
echoerr "Please install <https://github.com/mwh/dragon> for the DragOut command to work."
return
endif
execute '!dragon-drag-and-drop '.shellescape(a:path)
endfunction
command -nargs=* -complete=file DragOut call s:DragOut(empty(<q-args>) ? expand('%') : <q-args>)
" }}}
" }}}