function! My_compile_command() let l:ext = expand("%:e") if (l:ext == "cpp") exec "!g++ ".expand("%") elseif (l:ext == "c") exec "!gcc ".expand("%") endif endfunction nmap <silent> <leader>gg :call My_compile_command()<cr> nmap <silent> <leader>ea :!./a.out<cr>
写一个vim脚本方便在vim中编译所编辑的文件
最新推荐文章于 2024-07-11 19:20:33 发布