gotags

command module
v1.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2017 License: MIT Imports: 15 Imported by: 0

README

gotags

gotags is a ctags-compatible tag generator for Go.

Build Status Report Card

Installation

Go version 1.1 or higher is required. Install or update gotags using the go get command:

go get -u github.com/jstemmer/gotags

Or using package manager brew on OS X

brew install gotags

Usage

gotags [options] file(s)

-L="": source file names are read from the specified file. If file is "-", input is read from standard in.
-R=false: recurse into directories in the file list.
-f="": write output to specified file. If file is "-", output is written to standard out.
-silent=false: do not produce any output on error.
-sort=true: sort tags.
-tag-relative=false: file paths should be relative to the directory containing the tag file.
-v=false: print version.

Vim Tagbar configuration

Put the following configuration in your vimrc:

let g:tagbar_type_go = {
	\ 'ctagstype' : 'go',
	\ 'kinds'     : [
		\ 'p:package',
		\ 'i:imports:1',
		\ 'c:constants',
		\ 'v:variables',
		\ 't:types',
		\ 'n:interfaces',
		\ 'w:fields',
		\ 'e:embedded',
		\ 'm:methods',
		\ 'r:constructor',
		\ 'f:functions'
	\ ],
	\ 'sro' : '.',
	\ 'kind2scope' : {
		\ 't' : 'ctype',
		\ 'n' : 'ntype'
	\ },
	\ 'scope2kind' : {
		\ 'ctype' : 't',
		\ 'ntype' : 'n'
	\ },
	\ 'ctagsbin'  : 'gotags',
	\ 'ctagsargs' : '-sort -silent'
\ }
Vim+Tagbar Screenshot

vim Tagbar gotags

gotags with Emacs

Gotags doesn't have support for generating etags yet, but gotags-el allows you to use gotags directly in Emacs.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL