打造Python的vim环境

准备用vim写python3,所以配置一下环境。在此记录一下过程中出错的地方,以便自己和同行查用。

1、在下载python3之后,改了python软连接,也修改了/usr/bin/yum头部的python为python2.7,yum安装时报错:File “/usr/libexec/urlgrabber-ext-down”, line 28,
修改了/usr/libexec/urlgrabber-ext-down和/usr/bin/yum-config-manager头部的python为python2.7解决。

2、在git 下载vundle的时候,报错:fatal: unable to access ‘https://github.com/VundleVim/Vundle.vim.git/‘: Peer reports incompatible or unsupported protocol version.
使用yum update -y nss curl libcurl解决

3、安装YouCompleteMe之后,出现报错:E185: Cannot find color scheme ‘Zenburn’ ,YouCompleteMe unavailable: requires Vim 7.4.1578+.。vim版本不兼容,重新安装vim8解决。

另附.vimrc配置,包括一些用到的插件:

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 'Valloric/YouCompleteMe'
Plugin 'altercation/vim-colors-solarized'
Plugin 'Yggdroot/indentLine'
Plugin 'jnurmine/Zenburn'
Plugin 'scrooloose/nerdtree'

" 你的所有插件要写在这行之前,即在vundle#begin()和vundle#end()之间
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    "语法高亮
map <C-n> :NERDTreeToggle<CR>

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   "保存文件格式

"代码折叠,zc创建折叠,za打开或关闭折叠
set foldmethod=indent
set foldlevel=9

colorscheme Zenburn
"syntax enable
"set background=light or dark
"colorscheme solarized

最后,分享一个有完整步骤的链接:https://www.cnblogs.com/linxiyue/p/7834817.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值