系统相关
首页 > 系统相关> > 配置VIM (Windows)

配置VIM (Windows)

作者:互联网

软件介绍

Vim作为一个好用的编辑器,可以实现很多功能.如果配置的比较好,可以作为一个IDE来作为开发轻量级的开发工具,但是功能上绝对不失其他的几十G的大型IDE.

使用版本和操作系统

智能补全: YCM

目标:实现对C语言自动补全

  1. 环境配置 官方提供
  2. 首先找到vimrc【不同的操作系统路径不同,本次使用的地址是/etc/vim/vimrc】文件,使用Bundle管理插件,在vimrc文件中加入如下内容:
“”””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””
“ Vundle
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(‘~/.vim/bundle/‘)

“ let Vundle manage Vundle, required
Plugin ‘VundleVim/Vundle.vim’

“ The following are examples of different formats supported.
“ Keep Plugin commands between vundle#begin/end.
“ Autocomplete
Plugin ‘Valloric/YouCompleteMe’

“ All of your Plugins must be added before the following line
call vundle#end() “ required
filetype plugin indent on “ required
“ To ignore plugin indent changes, instead use:
filetype plugin on

“ Brief help
“ :PluginList - lists configured plugins
“ :PluginInstall - installs plugins; append ! to update or just
“ :PluginUpdate
“ :PluginSearch foo - searches for foo; append ! to refresh local cache
“ :PluginClean - confirms removal of unused plugins; append ! to
“ auto-approve removal

“ see :h vundle for more details or wiki for FAQ
“ Put your non-Plugin stuff after this line
“ “””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””””

“ 使其能够找到自动补全的配置文件路径(注意文件路径不一定相同,根据实际情况改动,如果没有cpp文件夹,可以手动创建)
let g:ycm_global_ycm_extra_conf=’~/.vim/bundle/YouCompleteMe/cpp/.ycm_extra_conf.py’

注意比较.ycm_extra_conf.py文件的差异,左边是改动之后的,右边是改动之前样子。
img

改动的时候可以参考说明:provide-the-flags-manually

C语言自动补全:C.vim

更改模版格式:借鉴经验

标签:required,补全,Plugin,Windows,vundle,配置,vim,VIM,Vundle
来源: https://www.cnblogs.com/toooney/p/10424884.html