每天一博--第六天 安装VIM插件实现代码自动补全

本文详细介绍了如何在CentOS8环境中,通过Vundle安装管理Vim插件,并重点讲解了安装YouCompleteMe(YCM)这一代码自动补全工具的过程,以提升Vim的编程体验。
摘要由CSDN通过智能技术生成

一:基础环境

  • Centos8.0
  • VIM:8.1
  • Python:3.6

二:安装Vundle插件管理器

vundle插件管理器相当于python中的pip,nodejs中的npm

Vundle安装
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim

VIM配置

配置文件~/.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()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
Plugin 'Valloric/YouCompleteMe'

" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'

" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
Plugin 'tpope/vim-fugitive'
" plugin from http://vim-scripts.org/vim/scripts.html
" Plugin 'L9'
" Git plugin not hosted on GitHub
Plugin 'git://git.wincent.com/command-t.git'
" git repos on your local machine (i.e. when working on your own plugin)
Plugin 'file:///home/gmarik/path/to/plugin'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" Install L9 and avoid a Naming conflict if you've already installed a
" different version somewhere else.
" Plugin 'ascenator/L9', {'name': 'newL9'}

" All of your Plugins must be added before the following line
call vundle#end()            " required

let g:ycm_global_ycm_extra_conf='~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py'
filetype plugin indent on    " required

set shortmess=atI   " 启动的时候不显示那个援助乌干达儿童的提示

set nu              " 显示行号

set go=             " 不要图形按钮

" color asmanian2     " 设置背景主题

set guifont=Courier_New:h10:cANSI   " 设置字体

syntax on           " 语法高亮

set ruler           " 显示标尺

set showcmd         " 输入的命令显示出来,看的清楚些

"set whichwrap+=<,>,h,l   " 允许backspace和光标键跨越行边界(不建议)

"set scrolloff=3     " 光标移动到buffer的顶部和底部时保持3行距离

set novisualbell    " 不要闪烁(不明白)

set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%l,%v][%p%%]\ %{strftime(\"%d/%m/%y\ -\ %H:%M\")}   "状态行显示的内容

set laststatus=1    " 启动显示状态行(1),总是显示状态行(2)

set foldenable      " 允许折叠

"set foldmethod=manual   " 手动折叠

"set background=dark "背景使用黑色

set nocompatible  "去掉讨厌的有关vi一致性模式,避免以前版本的一些bug和局限

" 显示中文帮助

if version >= 603

	set helplang=cn

    set encoding=utf-8

endif

" 设置配色方案

"colorscheme murphy

"字体

"if (has("gui_running"))

"   set guifont=Bitstream\ Vera\ Sans\ Mono\ 10

"endif



set fencs=utf-8,ucs-bom,shift-jis,gb18030,gbk,gb2312,cp936

set termencoding=utf-8

set encoding=utf-8

set fileencodings=ucs-bom,utf-8,cp936

set fileencoding=utf-8


"""""""""""""""""""""""""""""""""""&#
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值