Skip to content

Instantly share code, notes, and snippets.

@nelstrom
Created October 6, 2017 09:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nelstrom/c7695f1e3660bef1dc2891fcc5305388 to your computer and use it in GitHub Desktop.
Save nelstrom/c7695f1e3660bef1dc2891fcc5305388 to your computer and use it in GitHub Desktop.
function! SetupCommandAlias(input, output)
exec 'cabbrev <expr> '.a:input
\ .' ((getcmdtype() is# ":" && getcmdline() is# "'.a:input.'")'
\ .'? ("'.a:output.'") : ("'.a:input.'"))'
endfunction
call SetupCommandAlias("Em", "Emodel")
call SetupCommandAlias("Etm", "EmodelTest")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment