Mac下安装YouCompleteMe实现golang代码自动补全

我的系统环境:

vim版本:8.0.x

iOS:10.13.1


安装Vundle

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

修改.vimrc文件,配置Plugins,在.vimrc文件中添加如下内容。

set nocompatible
filetype off

setrtp+=~/.vim/bundle/Vundle.vim
callvundle#begin()

Plugin 'gmarik/Vundle.vim'

call vundle#end()
filetype plugin indent on


安装YoucOompleteMe

.vimrc中添加如下内容位置在 call vundle#begin() 和 call vundle#end() 之间。

Bundle 'Valloric/YouCompleteMe'

 

因为YouCompleteMe的编译需要用到CMake,这里先用brew安装CMake.

brew install CMake


保存后重新打开vim,在正常模式下输入以下内容,开始安装YouCompleteMe

:BundleInstall

这里已经在安装YouCompleteMe了哟,静静地等待安装完成。


确诊仓库的完整性

git submodule update --init --recursive


进入到YouCompleteMe插件目录

cd .vim/bundle/YouCompleteMe


安装支持golang自动补全

./install.py --gocode-completer

其实还可以安装其它语言的自动实例,例如c语言:

./install.py --clang-completer



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值