"--------------------------------------------------------------------------- " DESCription: Programming Automation " Help: F2 key or "mm" to compile and debug " Author: ywgx.ch@gmail.com " Version: 1.9 " License: GPL v2.0 "--------------------------------------------------------------------------- se ai si nocp se nu is cin smd wmnu magic se exrc ts=4 sw=4 sts=4 backspace=2 im ,, im ;; map gk map gj no! no! no! no! nm ;; :q! nm ,, :wq au BufRead,BufNewFile *.html setf html au FileType python,ruby :call Py() au FileType cpp,c,cc,h,html,perl :call Cc() au FileType c,cc,cpp,h,html,python :call Cp() func Cp() ino , , ino ; ; ino <= <= ino *= *= ino /= /= ino >> >> ino << << ino >= >= ino == == ino += += ino && && endf func Py() nm mm :call CrText() im mm $ im nn o im if exists("$DISPLAY") nm :call Cr() el nm :call CrText() en endf func Cc() no != != im mm A; im nn A;o nm # :ii# if exists("$DISPLAY") if &filetype == 'perl' nm mm :call CrText() nm :call Cr() im :call Cr() el nm mm :call CrText() nm mm :call CrText() nm :call Cr() im :call Cr() en el nm :call CrText() im :call CrText() nm mm :call CrText() en endf func Cr() exe "w" if &filetype == 'c' exe "!gcc -Wall % -o %<" exe "!clear;./%< 2>/dev/null && rm -f %<" elsei &filetype == 'cpp' exe "!g++ -Wall % -o %<" exe "!clear;./%< 2>/dev/null && rm -f %<" elsei &filetype == 'python' exe "!clear;python %" elsei &filetype == 'ruby' exe "!clear;ruby %" elsei &filetype == 'sh' exe "!clear;bash %" elsei &filetype == 'perl' exe "!clear;perl %" en endf func CrText() exe "w" if &filetype == 'c' exe "!gcc -Wall % -o %<" exe "!./%< 2>/dev/null && rm -f %<" elsei &filetype == 'cpp' exe "!g++ -Wall % -o %<" exe "!./%< 2>/dev/null && rm -f %<" elsei &filetype == 'python' exe "!python %" elsei &filetype == 'ruby' exe "!ruby %" elsei &filetype == 'sh' exe "!bash %" elsei &filetype == 'perl' exe "!perl %" elsei &filetype =='html' exe "!firefox %" en endf