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
if has("autocmd") | |
augroup vimrcCompileMap | |
" Remove ALL autocommands for the current group. This prevents having the | |
" autocommands defined twice (e.g., after sourcing the .vimrc file again). | |
autocmd! | |
" Map <F5> to save, compile and run single source file. | |
if has("win32") | |
autocmd FileType cpp nnoremap <buffer> <F5> :w<CR>:!cls && cl /EHsc % && %< <CR> | |
autocmd FileType python nnoremap <buffer> <F5> :w<CR>:!py % <CR> |