Created
January 7, 2012 10:27
-
-
Save aldente39/1574361 to your computer and use it in GitHub Desktop.
To compile & run by F5 (Vim)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"実行コマンド | |
command! Run call s:Run() | |
nmap <F5> :Run<CR> | |
function! s:Run() | |
let e = expand("%:e") | |
if e == "c" | |
:Gcc | |
endif | |
if e == "py" | |
:Python | |
endif | |
if e == "f90" || e == "f95" | |
:Gfortran | |
endif | |
endfunction | |
command! Python call s:Python() | |
function! s:Python() | |
:!python % | |
endfunction | |
command! Gcc call s:Gcc() | |
function! s:Gcc() | |
if has("win32") || has("win64") | |
:!gcc % -o %:r.exe | |
:!%:r.exe | |
else | |
:!gcc % -o %:r.out | |
:!%:r.out | |
endif | |
endfunction | |
command! Gfortran call s:Gfortran() | |
function! s:Gfortran() | |
if has("win32") || has("win64") | |
:!gfortran % -o %:r.exe | |
:!%:r.exe | |
else | |
:!gfortran % -o %:r.out | |
:!%:r.out | |
endif | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks sir.