Last active
December 18, 2015 04:39
-
-
Save dtinth/5727151 to your computer and use it in GitHub Desktop.
Vim Custom Command
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" 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