在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
1 环境配置 export GOPATH=/home/go 2 在新建GOPATH下新建三个目录 mkdir src pkg bin
src 存放源码 3 工具安装
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 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>
|
请发表评论