mirror of
https://github.com/amix/vimrc
synced 2025-02-28 14:12:51 +08:00
🚑 Fix cpp and c files run
This commit is contained in:
parent
d93dda4770
commit
96bb75d663
@ -207,18 +207,16 @@ vmap <F5> <Esc>:call CompileRun()<CR>
|
|||||||
func! CompileRun()
|
func! CompileRun()
|
||||||
exec "w"
|
exec "w"
|
||||||
if &filetype == 'c'
|
if &filetype == 'c'
|
||||||
exec "!gcc % -o %<"
|
exec "!gcc % && ./a.out<"
|
||||||
exec "!time ./%<"
|
|
||||||
elseif &filetype == 'cpp'
|
elseif &filetype == 'cpp'
|
||||||
exec "!g++ % -o %<"
|
exec "!g++ % && ./a.out"
|
||||||
exec "!time ./%<"
|
|
||||||
elseif &filetype == 'java'
|
elseif &filetype == 'java'
|
||||||
exec "!javac %"
|
exec "!javac %"
|
||||||
exec "!time java %"
|
exec "!time java %"
|
||||||
elseif &filetype == 'sh'
|
elseif &filetype == 'sh'
|
||||||
exec "!time bash %"
|
exec "!time bash %"
|
||||||
elseif &filetype == 'python'
|
elseif &filetype == 'python'
|
||||||
exec "!time python3 %"
|
exec "!time python %"
|
||||||
elseif &filetype == 'html'
|
elseif &filetype == 'html'
|
||||||
exec "!google-chrome % &"
|
exec "!google-chrome % &"
|
||||||
elseif &filetype == 'go'
|
elseif &filetype == 'go'
|
||||||
|
Loading…
Reference in New Issue
Block a user