Skip to content

Instantly share code, notes, and snippets.

@dtinth
Last active December 18, 2015 04:39
Show Gist options
  • Save dtinth/5727151 to your computer and use it in GitHub Desktop.
Save dtinth/5727151 to your computer and use it in GitHub Desktop.
Vim Custom Command
" put me in your vimrc
" bind run command
map <leader>r :call RunCustomCommand()<cr>
map <leader>s :call SetCustomCommand()<cr>
let g:silent_custom_command = 0
function! RunCustomCommand()
up
if g:silent_custom_command
execute 'silent !' . s:customcommand
else
execute '!' . s:customcommand
end
endfunction
function! SetCustomCommand()
let s:customcommand = input('Enter Custom Command$ ')
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment