vim自动补全:go
2015-12-18 12:56
495 查看
1 环境配置
2 在新建GOPATH下新建三个目录
src 存放源码
pkg 存放编译生成的文件
bin 存放生成的可执行文件
3 工具安装
安装goimports
安装gocode
安装godef
4、安装vbundle(安装git:apt-get install git)
5、
a) Add following commands to the head of ~/.vimrc.
b) Install vim-go
export GOPATH=/home/go
2 在新建GOPATH下新建三个目录
mkdir src pkg bin
src 存放源码
pkg 存放编译生成的文件
bin 存放生成的可执行文件
3 工具安装
安装goimports
go get github.com/bradfitz/goimports
安装gocode
go get github.com/nsf/gocode
安装godef
go get code.google.com/p/rog-go/exp/cmd/godef
4、安装vbundle(安装git:apt-get install git)
git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
5、
a) Add following commands to the head of ~/.vimrc.
set nocompatible " be iMproved filetype off " required! set rtp+=~/.vim/bundle/vundle/ call vundle#rc() " let Vundle manage Vundle " required! Bundle 'gmarik/vundle' filetype plugin indent on syntax on
b) Install vim-go
~$ cd ~/.vim/bundle ~$ git clone https://github.com/fatih/vim-go.git[/code]
Add this line to ~/.vimrc.Plugin 'fatih/vim-go'
Execute :PluginInstall in Vim.
6、更新cd $GOPATH/src/github.com/nsf/gocode && vim/update.sh gocode set propose-builtins true gocode set lib-path "$GOPATH/pkg/linux_amd64"
7、打开vim,自动补全功能快捷键(ctrl+x+o)为了方便,将 Ctrl+Space 映射为自动补全快捷键: imap <C-Space> <C-x><C-o>
相关文章推荐
- Alpine里的go应用,你猜他能有多小?
- 101,使用Category给API里面的类添加新方法
- Django - “no module named django.core.management”
- Alpine里的go应用,你猜他能有多小?
- ubuntu 12.04 lts安装golang并设置vim语法高亮
- 启发式算法(heuristic algorithm)
- Django-1.9
- 接入google play service 的debug模式测试时候弹出选择谷歌账户后回调失败的原因【三个小坑真TM的经典】
- Django 设置template的全局变量
- ZZUOJ-10434: good string
- Django adminsite
- Codeforces Round #313 (Div. 2) 560C Gerald's Hexagon(脑洞)
- ZJPC-CTF_2015.11~12_writeup_by_GoldsNow
- 在阿里云ubuntu 14.04 上部署Gogs
- 在Go语言中记录log:seelog包
- 看godoc的命令
- 99,Category基本概念与注意点
- Genetic Algorithm遗传算法学习
- Windows Phone版使用移动广告平台集成Google Mobile Ads SDK教程
- Google 的开源技术protobuf 简介与例子