MacVim 怎样配置成python ide

如题所述

python-mode补全和提示都有,很多人都用这个。我用的补全插件是youcompleteme。
你可以绑定一个按键来执行代码:

map <F5> <ESC>:w<CR>:call RunOneFile()<CR>
function! RunOneFile()
if &filetype=='vim'
source %
elseif &filetype=='python'
if expand('%:e')=='py3'
!python3 %
else
!python %
endif
elseif &filetype=='c'
if exists('g:ccprg')
let b:ccprg = g:ccprg
else
let b:ccprg = 'gcc'
endif
exe '!' . b:ccprg . ' "' . expand('%:p') . '" -o "' . expand('%:p:r') . '"'
exe '!' . expand('%:p:r')
endif
endfunction
温馨提示:答案为网友推荐,仅供参考