diff --git a/home/.vim/bundle/vim-eunuch/README.markdown b/home/.vim/bundle/vim-eunuch/README.markdown index d576691..2d5febe 100644 --- a/home/.vim/bundle/vim-eunuch/README.markdown +++ b/home/.vim/bundle/vim-eunuch/README.markdown @@ -3,9 +3,10 @@ Vim sugar for the UNIX shell commands that need it the most. Features include: -* `:Unlink`: Delete a buffer and the file on disk simultaneously. -* `:Remove`: Like `:Unlink`, but doesn't require a neckbeard. +* `:Remove`: Delete a buffer and the file on disk simultaneously. +* `:Unlink`: Like `:Remove`, but keeps the now empty buffer. * `:Move`: Rename a buffer and the file on disk simultaneously. +* `:Rename`: Like `:Move`, but relative to the current file's containing directory. * `:Chmod`: Change the permissions of the current file. * `:Mkdir`: Create a directory, defaulting to the parent of the current file. * `:Find`: Run `find` and load the results into the quickfix list. diff --git a/home/.vim/bundle/vim-eunuch/doc/eunuch.txt b/home/.vim/bundle/vim-eunuch/doc/eunuch.txt index 2509d79..b069b38 100644 --- a/home/.vim/bundle/vim-eunuch/doc/eunuch.txt +++ b/home/.vim/bundle/vim-eunuch/doc/eunuch.txt @@ -21,13 +21,14 @@ based on the original file name. COMMANDS *eunuch-commands* - *eunuch-:Unlink* -:Unlink[!] |:bdelete|, and, if successful, delete the file from + *eunuch-:Remove* +:Remove[!] |:bdelete|, and, if successful, delete the file from disk. If a bang is given, it is passed along to :bdelete. - *eunuch-:Remove* -:Remove[!] Alias for |:Unlink|. + *eunuch-:Unlink* +:Unlink[!] Delete the file from disk and reload the buffer. + If a bang is given, discard unsaved changes. *eunuch-:Move* :Move[!] {file} Like |:saveas|, but delete the old file afterwards. diff --git a/home/.vim/bundle/vim-eunuch/plugin/eunuch.vim b/home/.vim/bundle/vim-eunuch/plugin/eunuch.vim index 7f47038..c210501 100644 --- a/home/.vim/bundle/vim-eunuch/plugin/eunuch.vim +++ b/home/.vim/bundle/vim-eunuch/plugin/eunuch.vim @@ -21,7 +21,16 @@ function! s:separator() return !exists('+shellslash') || &shellslash ? '/' : '\\' endfunction -command! -bar -bang Unlink : +command! -bar -bang Unlink + \ if 1 && &modified | + \ edit | + \ elseif delete(expand('%')) | + \ echoerr 'Failed to delete "'.expand('%').'"' | + \ else | + \ edit! | + \ endif + +command! -bar -bang Remove \ let s:file = fnamemodify(bufname(),':p') | \ execute 'bdelete' | \ if !bufloaded(s:file) && delete(s:file) | @@ -29,8 +38,6 @@ command! -bar -bang Unlink : \ endif | \ unlet s:file -command! -bar -bang Remove :Unlink - command! -bar -nargs=1 -bang -complete=file Move : \ let s:src = expand('%:p') | \ let s:dst = expand() |