文章参考:
之前看其他朋友的vim配置教程,基本上没有成功过,要么是版本问题,要么是各种坑
今天把整体梳理一遍,并把某些坑贴出来,最重要的的是.vimrc一起贴出来
我只运行了两条指令, yum update , git clone ......vim
接下来直接进入vim ,:PluginInstall 看是否有报错,
vim界面最底下有一行提示,跟sublime text 是一样的
注释必须使用双引号,其它最好按照格式使用单引号,否则包语法错误
使用python自动提示的插件时报错:YouCompleteMe unavailable: requires Vim 7.4.1578+.
可以使用这个url直接下载https://fangself.com.cn/subcontent/download/.vimrc
set tabstop=4
set encoding=utf-8
colorscheme desert
set splitbelow
set splitright
"split navitions 不用鼠标就能切换分割布局
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
" Enbale folding 手动折叠
set foldmethod=indent
set foldlevel=99
nnoremap <space> za
set nocompatible " required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
"
" " alternatively, pass a path where Vundle should install plugins
" "call vundle#begin('~/some/path/here')
"
" " let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
Plugin 'vim-scripts/indentpython.vim'
" 符合pep8 标准的自动缩进
Plugin 'Valloric/YouCompleteMe'
"
" " Add all your plugins here (note older versions of Vundle used Bundle
" instead of Plugin)
" " All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" 是vim 支持python3 的 pep8 标准
au BufNewFile, BufRead *.py
\ set tabstop=4
\ set softtabstop=4
\ set shiftwidth=4
\ set textwidth=4
\ set expandtab
\ set autoindent
\ set fileformat=unix
"设置 vim 打开html,css ,js
au BufNewFile, BufRead *.js, *.html,*.htm,*.json,*.css,*.jsx,*.xml
\ set tabstop=2
\ set softtabstop=2
\ set shiftwidth=2
au BufNewFile, BufRead *.py, *.pyw, *.c, *.cpp match BadWhitespace /\s\+$/
"使用pep8标准将多余的空白字符标识出来
完成文件的编写之后,:PluginInstall 之后会提示 Processing .....正在安装你配置好的插件
成果,自动完成代码的插件没有安装成功,其他的插件均安装完成