0%

golang配置vim

配置文件和快速设置

  1. PlugClean
  2. PlugInstall
  3. 去到YCM里执行
    1
    ./install.py --clang-completer --gocode-completer

安装插件管理器

1
curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

安装插件

1
2
3
4
5
6
7
8
9
10
call plug#begin()
Plug 'fatih/vim-go' "go
Plug 'tomasr/molokai' "主题
Plug 'SirVer/ultisnips' "tab补全
Plug 'ctrlpvim/ctrlp.vim' "快速查文件
Plug 'Shougo/neocomplete.vim' "实时提示
Plug 'majutsushi/tagbar' "tagbar
Plug 'scrooloose/nerdtree' "导航
Plug 'vim-airline/vim-airline' "下面
call plug#end()

安装go tools需要的东西

直接使用:GoInstallBinaries安装
如果网络不行(你懂的), 把代理把包都下载下来

1
git clone https://go.googlesource.com/tools

goTags需要安装ctags

1
brew install ctags



代码实时提示neocomplete, 需要vim支持lua

1
2
3
brew uninstall vim
brew install luajit
brew install vim --with-luajit

Gocode autocomplete non imported packages

1
gocode set unimported-packages true
给作者打赏,鼓励TA抓紧创作!