Skip to content

Instantly share code, notes, and snippets.

@tommcdo
Last active August 29, 2015 13:56
Show Gist options
  • Save tommcdo/9274729 to your computer and use it in GitHub Desktop.
Save tommcdo/9274729 to your computer and use it in GitHub Desktop.
function! MinCommandPrefix(command)
for i in range(len(a:command) - 1, 0, -1)
if exists(':' . strpart(a:command, 0, i)) != 1
return i + 1
endif
endfor
return -1
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment