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

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -