vim - Vimrc: check if unix command is installed -
i have these in vimrc:
if has("autocmd") augroup misc " jump last known position when reopening file autocmd bufreadpost * \ if line("'\"") > 1 && line("'\"") <= line("$") | \ exe "normal! g`\"" | \ endif augroup end augroup ftoptions autocmd! autocmd filetype cpp,java setlocal commentstring=//\ %s autocmd filetype markdown setlocal textwidth=78 formatprg=par\ -w78 augroup end
in markdown files i'd formatting using par. works well, warning if "par" not installed on system. i'm wondering if there's way check , set "formatprg=par\ -78" when par installed, otherwise use vim's default formatting.
i grateful suggestion.
if executable('par') " stuff endif
Comments
Post a Comment