码迷,mamicode.com
首页 > Windows程序 > 详细

配置VIM (Windows)

时间:2019-02-24 01:10:44      阅读:192      评论:0      收藏:0      [点我收藏+]

标签:orm   ubunt   port   c语言   一个   global   flag   adr   git   

软件介绍

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

使用版本和操作系统

  • 操作系统: Ubuntu 18.04
  • python 3.7 64位
  • VIM - Vi IMproved 8.0
  • cmake version 3.10.2

智能补全: 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文件的差异,左边是改动之后的,右边是改动之前样子。
技术图片

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

C语言自动补全:C.vim

更改模版格式:借鉴经验

配置VIM (Windows)

标签:orm   ubunt   port   c语言   一个   global   flag   adr   git   

原文地址:https://www.cnblogs.com/toooney/p/10424884.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!