vim-golang


Ⅰ. 插件描述

Github mirror of Go vimscripts, synced with main repository

Ⅱ. 基本信息

创建日期:  2010-10-26
使用用户:  3
Github星:  1
插件作者:  Andrew Radev

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'andrewradev/vim-golang-who-speaks'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'andrewradev/vim-golang-who-speaks'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'andrewradev/vim-golang-who-speaks'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/andrewradev/vim-golang

Ⅳ. 文档说明

No Maintenance Intended

This project is my own fork of Go's Vim runtime files. I intended to add some
additional features to it that won't make their way upstream, but which you may
find useful.

Unfortunately, I don't write a whole of Go these days, so I stopped working on
it and don't intend to continue. I'm leaving to code as potential inspiration
for somebody else :).

Some notable changes:

  • :Godoc is smarter, and can now look for a particular symbol (function call)
    as well as packages.
  • Minimal syntax highlighting for the godoc buffer.
  • Function text objects
  • The gf family of mappings work for packages
  • The :A command opens the related test file
  • :Fmt can be given several arguments that change its behaviour

For the official runtime files, straight from the Golang project, go to
golang.org/misc/vim/.

Usage

This plugin provides filetype detection, syntax highlighting and indentation
for the Go programming language. It also includes some useful tools for working
with Go code.

For the most basic usage, just install the plugin and edit Go code. You should
get the basic benefits automatically.

If you want to use the other tools, please take a look at the documentation in
doc/golang.txt, or within Vim itself with :help golang.

Installation

There are several ways to install the plugin. The recommended one is by using
Tim Pope's pathogen. In
that case, you can clone the plugin's git repository like so:

git clone git://github.com/AndrewRadev/vim-golang.git ~/.vim/bundle/golang

If your vim configuration is under git version control, you could also set up
the repository as a submodule, which would allow you to update more easily. The
command is (provided you're in ~/.vim):

git submodule add git://github.com/AndrewRadev/vim-golang.git bundle/golang

Another way is to simply copy all the essential directories inside the ~/.vim
directory: autoload, doc, ftdetect, ftplugin, indent, plugin, syntax.

添加新评论