准备用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