Skip to content

Instantly share code, notes, and snippets.

@freddiefujiwara
Forked from ursm/ditz.vim
Created July 29, 2008 08:38
Show Gist options
  • Save freddiefujiwara/3049 to your computer and use it in GitHub Desktop.
Save freddiefujiwara/3049 to your computer and use it in GitHub Desktop.
let s:commands = system('ditz --commands')
function! s:DitzComplete(cur, all, pos)
let args = split(strpart(a:all, 0, a:pos), ' ', 1)
if len(args) <= 2
return s:commands
elseif index(split(s:commands), args[1]) != -1
return system('ditz '.args[1].' "<options>"')
else
return ''
endif
endfunction
command! -nargs=+ -complete=custom,s:DitzComplete Ditz !ditz <args>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment