"--------------------------------------------------------------------------- " DESCription: Programming Automation " Help: F2 key or "mm" to compile and debug " Author: ywgx.ch@gmail.com " Version: 1.8 " License: GPL v2.0 "--------------------------------------------------------------------------- se ai si nocp se exrc ts=4 sw=4 bs=2 sts=4 se nu cin magic smd hls is wmnu im ,, im ;; map gk map gj no! no! no! no! nm ;; :q! nm ,, :wqa au BufRead,BufNewFile *.html setf html au FileType python,ruby :call Py() au FileType cpp,c,cc,h :call Cc() func Py() nm mm :call CR1() im mm $ im nn o im if exists("$DISPLAY") nm :call CR() el nm :call CR1() en endf func Cc() ino , , ino ; ; ino <= <= ino *= *= ino /= /= ino >> >> ino << << ino >= >= ino == == ino += += ino && && ino != != nm i l im mm A; im nn A;o nm # :ii# if exists("$DISPLAY") nm mm :call CR1() nm :call CR() im :call CR() el nm mm :call CR1() nm :call CR1() im :call CR1() en nm ca I/*A nm cd :s/\/\*//g:s/\*\///g 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 == 'pl' exe "!clear;perl %" en endf func CR1() 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 == 'pl' exe "!perl %" elsei &filetype =='html' exe "!firefox %" en endf