Ⅰ. 插件描述
A semantic highlighter for go sourcecode files in vim.Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'meonlol/vim-gosem'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'meonlol/vim-gosem'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'meonlol/vim-gosem'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/meonlol/vim-gosem
Ⅳ. 文档说明
vim-gosem
This is a semantic highlighter for go source code files in vim. It uses
[gosem][] to do the analyzing, which uses go's built in go-parser, so it is
blazing fast, even on large files. It highlights fields, parameters and local
variables.

Screenshot with [solarized][] color scheme.
Installation
You need go installed to make all of this work, but since this is a tool for go
development this might not be a problem for you.
gosem
To get the syntax highlighting, you first need [gosem][]. Just go get it:
go get -u github.com/meonlol/gosem
This should just work. Ask aunt google to help you with your environment if it
won't. You can test gosem by navigating to some go source file on the command
line and running gosem -f yourfile.go. If it ouputs something like the below,
your good to go.
someFieldToPrint someOtherField|8,16,stringToPrint a b|18,21,alocalhost
vim-gosem
You know the drill! Copy-pase, away!
[Pathogen][]
git clone https://github.com/meonlol/vim-gosem.git ~/.vim/bundle/vim-gosem
[vim-plug][]
Plug 'meonlol/vim-gosem'
[NeoBundle][]
NeoBundle 'meonlol/vim-gosem'
[Vundle][]
Plugin 'meonlol/vim-gosem'
Then put this in your vimrc...
" make vim-gosem your highlighter once you open a go source file, and refresh on save
autocmd BufRead,BufNewFile *.go setlocal syntax=vim-gosem
autocmd BufWritePost *.go silent! setlocal syntax=vim-gosem
... source % it and open a go source file.