browse

command module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2018 License: BSD-3-Clause Imports: 23 Imported by: 0

README

browse

Terminal Go Source Code Browser

Installation

$ go get [-u] modernc.org/browse

Documentation: godoc.org/modernc.org/browse


Screenshot

Documentation

Overview

Command browse is a source code viewer.

Usage

Invocation of the command:

browse [flags] [import-path]

The optional import path argument must be a valid import path. If no argument is provided the command checks if the current working directory is in a subtree rooted at GOPATH/src, in which case it opens the package files in the current directory.

Flags

Options to amend things:

-tags 'white space separated string'

A list of additional build tags to consider satisfied during the build. For more information about build tags, see the description of build constraints in the documentation for the go/build package.

The default tag set includes the Go version tags, like "go1.1" ... "go1.7", according to the version of Go used to build the command, and tags based on runtime.GOOS and runtime GOARCH. The last two tags can be overridden by setting the GOOS and GOARCH environmental variables, respectively.

The additional tags, if any, are added to the default tag set.

Navigation

Keys recognized by the focused window or the application itself.

<PageUp> or CTRL-B
	Scroll window one page Backwards (upwards) in the buffer.

CTRL-D
	Scroll window half a screen Downwards in the buffer.

CTRL-E
	Scroll window one line downwards in the buffer. Mnemonic: Extra lines.

<PageDown> or CTRL-F
	Scroll window one page Forwards (downwards) in the buffer.

<Tab> or CTRL-I
	Go to newer cursor position in location history list

CTRL-U
	Scroll window half a screen Upwards in the buffer.

CTRL-O
	Go to Older cursor position in location history list

CTRL-Q
	Quit the application.

CTRL-W
	Close the Window.

CTRL-Y
	Scrolls one line upwards in the buffer.

<Home>
	Scroll to the first line.

<End>
	Scroll to the last line.

Screenshot

See https://gitlab.com/cznic/browse/raw/images/browse.png

Known issues

Key bindings and terminal colors are hard coded.

In terminals with no mouse support there's no way to select and follow links to declarations.

Identifiers in certain contexts cannot be resolved to their respective declarations without type information available. Browse does not (yet) type check the loaded packages. The (slower) fallback in such cases depends on the guru tool. To install guru:

go get -u golang.org/x/tools/cmd/guru

Directories

Path Synopsis
internal
ftoken
Package ftoken is a faster subset of the stdlib go/token package.
Package ftoken is a faster subset of the stdlib go/token package.
gc
Package gc is a Go compiler front end.
Package gc is a Go compiler front end.

Jump to

Keyboard shortcuts

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