vim安装Vundle

git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim


touch ~/.vimrc


#在.vimrc文件开始添加以下内容

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 'VundleVim/Vundle.vim'
 
" 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
filetype plugin on
let g:pydiction_location = '~/.vim/bundle/pydiction/complete-dict'
let g:pydiction_menu_height = 3 
 



:PluginInstall

 

1.自动补全  

Pydiction

[root@localhost ~]# mkdir ~/.vim

[root@localhost ~]# mkdir ~/.vim/bundle

[root@localhost ~]# cd ~/.vim/bundle

[root@localhost bundle]# git clone https://github.com/rkulla/pydiction.git #如果没有git需要先行安装

[root@localhost pydiction]# vim ~/.vimrc
filetype plugin on
let g:pydiction_location = '~/.vim/bundle/pydiction/complete-dict'  #此路径根据自己实际路径
let g:pydiction_menu_height = 3

到此便可使用tab键补全代码了

2.其他设置

set nocompatible
"显示行号"
set number    
set guioptions-=r 
set guioptions-=L
set guioptions-=b
"隐藏顶部标签栏"
"set showtabline=0
""设置字体"
set guifont=Monaco:h13    
syntax on   "开启语法高亮"
let g:solarized_termcolors=256  "solarized主题设置在终端下的设置"
set background=dark     "设置背景色"
set nowrap  "设置不折行"
set fileformat=unix "设置以unix的格式保存文件"
set cindent     "设置C样式的缩进格式"
set tabstop=4   "设置table长度"
set shiftwidth=4        "同上"
set showmatch   "显示匹配的括号"
set scrolloff=5     "距离顶部和底部5行"
set laststatus=2    "命令行为两行"
set fenc=utf-8      "文件编码"
set backspace=2
set selection=exclusive
set selectmode=mouse,key
set matchtime=5
set ignorecase      "忽略大小写"
set incsearch
set hlsearch        "高亮搜索项"
set noexpandtab     "不允许扩展table"
set whichwrap+=<,>,h,l
set autoread
set cursorline      "突出显示当前行"
set cursorcolumn    "突出显示当前列"
 
"括号补全"
inoremap ' ''<ESC>i
inoremap " ""<ESC>i
inoremap ( ()<ESC>i
inoremap [ []<ESC>i
inoremap { {<CR>}<ESC>O

"自动换行"
inoremap : :<CR>

(有需要再补充!)

Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐