map :call CompileRun() imap :call CompileRun() func! CompileRun() exec "w" if &filetype == 'c' exec "!gcc % -o %<" exec "!time ./%<" elseif &filetype == 'cpp' exec "!g++ % -o %<" exec "!time ./%<" elseif &filetype == 'java' exec "!javac %" exec "!time java -cp %:p:h %t:r" elseif &filetype == 'sh' exec "!time bash %" elseif &filetype == 'python' exec "!time python %" elseif &filetype == 'html' exec "!google-chrome % &" elseif &filetype == 'go' exec "!go build %<" exec "!time go run %" elseif &filetype == 'matlab' exec "!time octave %" endif endfunc