Skip to content

Instantly share code, notes, and snippets.

@AndrewVos
Created February 10, 2014 16:52
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 AndrewVos/8919668 to your computer and use it in GitHub Desktop.
Save AndrewVos/8919668 to your computer and use it in GitHub Desktop.
function! ExecuteMapping()
if exists("g:mapping")
execute :wa
execute "!" . g:mapping
endif
endfunction
function! SetupMapping()
let g:mapping = input('Command: ')
endfunction
map <leader>c :call SetupMapping()<cr>
map <leader>r :call ExecuteMapping()<cr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment