用vim来写python程序,所需要设置的地方
下载插件:
1 | git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim |
---|
配置参考
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | set nocompatible " be iMproved, required filetype off " required " set the runtime path to include Vundle and initialize set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() " let Vundle manage Vundle, required Plugin 'VundleVim/Vundle.vim' Plugin 'vim-scripts/indentpython.vim' Plugin 'vim-syntastic/syntastic' Plugin 'altercation/vim-colors-solarized' Plugin 'scrooloose/nerdtree' Plugin 'jistr/vim-nerdtree-tabs' Plugin 'Lokaltog/vim-powerline' Plugin 'Yggdroot/indentLine' " All of your Plugins must be added before the following line call vundle#end() " required filetype plugin indent on " required set nocompatible "关闭与vi的兼容模式 set number "显示行号 set nowrap "不自动折行 set showmatch "显示匹配的括号 set scrolloff=3 "距离顶部和底部3行" set encoding=utf-8 "编码 set fenc=utf-8 "编码 set mouse=a "启用鼠标 set hlsearch "搜索高亮 syntax on "语法高亮 au BufNewFile,BufRead *.py \ set tabstop=4 "tab宽度 \ set softtabstop=4 \ set shiftwidth=4 \ set textwidth=79 "行最大宽度 \ set expandtab "tab替换为空格键 \ set autoindent "自动缩进 \ set fileformat=unix "保存文件格式 set foldmethod=indent set foldlevel=99 map <F5> :call RunPython()<CR> func! RunPython() exec "W" if &filetype == 'python' exec "!time python36 %" endif endfunc |
---|