VIM插件


安装环境

我的安装环境是Centos 7.4.1708,VIM编辑器版本是7.4.629,python版本2.7.5,root用户登录。

vim按F5编译

1.将以下代码复制到~/.vimrc中

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Quickly Run
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

map  :call CompileRunGcc()

func! CompileRunGcc()
    exec "w" 
    if &filetype == 'c' 
        exec '!g++ % -o %<'
        exec '!time ./%<'
    elseif &filetype == 'cpp'
        exec '!g++ % -o %<'
        exec '!time ./%<'
    elseif &filetype == 'python'
        exec '!time python %'
    elseif &filetype == 'sh'
        :!time bash %
    endif                                                                              
endfunc 

2.使用vim打开代码文件按F5即可编译。

pathogen&snipmate先安装pathogen
2.
3.安装jedi-vim

pip install jedi

cd ~/.vim/bundle/ &&
git clone --recursive https://github.com/davidhalter/jedi-vim.git ~/.vim/bundle/jedi-vim

4.修改~/.vimrc配置文件

Plugin 'davidhalter/jedi-vim'

学习来自:vim编译运行参考1,vim编译运行参考2,安装jedi-vim插件,《python linux系统管理与自动化运维》 第二章