Skip to content

Instantly share code, notes, and snippets.

@aldente39
Created January 7, 2012 10:27
Show Gist options
  • Save aldente39/1574361 to your computer and use it in GitHub Desktop.
Save aldente39/1574361 to your computer and use it in GitHub Desktop.
To compile & run by F5 (Vim)
"実行コマンド
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
@MuhammetOzturk
Copy link

Thanks sir.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment