Documentation
¶
Overview ¶
Package govim implements a Vim8 channel-based plugin host that can be used to write plugins.
Index ¶
- Variables
- func ParseVersionLong(l int) string
- type CommAttr
- type CommMod
- type CommModList
- type CommandFlags
- type Complete
- type CompleteCustom
- type CompleteCustomList
- type CompleteInfo
- type CompleteItem
- type CompleteMode
- type CountN
- type Event
- type Events
- type Flavor
- type GenAttr
- type Govim
- type NArgs
- type Pattern
- type Patterns
- type Plugin
- type Range
- type RangeN
- type SwitchBufMode
- type Viewport
- type VimAutoCommandFunction
- type VimCommandFunction
- type VimFunction
- type VimRangeFunction
- type WinInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrShuttingDown = errors.New("govim shutting down")
)
View Source
var Flavors = []Flavor{ FlavorVim, FlavorGvim, FlavorNeovim, }
Functions ¶
func ParseVersionLong ¶ added in v0.0.27
Types ¶
type CommMod ¶
type CommMod string
const ( CommModAboveLeft CommMod = "aboveleft" CommModBelowRight CommMod = "belowright" CommModBotRight CommMod = "botright" CommModBrowse CommMod = "browse" CommModConfirm CommMod = "confirm" CommModHide CommMod = "hide" CommModKeepAlt CommMod = "keepalt" CommModKeepJumps CommMod = "keepjumps" CommModKeepMarks CommMod = "keepmarks" CommModKeepPatterns CommMod = "keeppatterns" CommModLeftAbove CommMod = "leftabove" CommModLockMarks CommMod = "lockmarks" CommModNoSwapfile CommMod = "noswapfile" CommModRightBelow CommMod = "rightbelow" CommModSilent CommMod = "silent" CommModTab CommMod = "tab" CommModTopLeft CommMod = "topleft" CommModVerbose CommMod = "verbose" CommModVertical CommMod = "vertical" )
type CommModList ¶
type CommModList []CommMod
func (CommModList) String ¶
func (c CommModList) String() string
type CommandFlags ¶
type CommandFlags struct {
Line1 *int
Line2 *int
Range *int
Count *int
Bang *bool
Reg *string
Mods CommModList
}
func (*CommandFlags) UnmarshalJSON ¶
func (c *CommandFlags) UnmarshalJSON(b []byte) error
type Complete ¶
type Complete uint
const ( CompleteArglist Complete = iota // -complete=arglist CompleteAugroup // -complete=augroup CompleteBuffer // -complete=buffer CompleteBehave // -complete=behave CompleteColor // -complete=color CompleteCommand // -complete=command CompleteCompiler // -complete=compiler CompleteCscope // -complete=cscope CompleteDir // -complete=dir CompleteEnvironment // -complete=environment CompleteEvent // -complete=event CompleteExpression // -complete=expression CompleteFile // -complete=file CompleteFileInPath // -complete=file_in_path CompleteFiletype // -complete=filetype CompleteFunction // -complete=function CompleteHelp // -complete=help CompleteHighlight // -complete=highlight CompleteHistory // -complete=history CompleteLocale // -complete=locale CompleteMapclear // -complete=mapclear CompleteMapping // -complete=mapping CompleteMenu // -complete=menu CompleteMessages // -complete=messages CompleteOption // -complete=option CompletePackadd // -complete=packadd CompleteShellCmd // -complete=shellcmd CompleteSign // -complete=sign CompleteSyntax // -complete=syntax CompleteSyntime // -complete=syntime CompleteTag // -complete=tag CompleteTagListFiles // -complete=tag_listfiles CompleteUser // -complete=user CompleteVar // -complete=var )
type CompleteCustom ¶
type CompleteCustom string
func (CompleteCustom) String ¶
func (c CompleteCustom) String() string
type CompleteCustomList ¶
type CompleteCustomList string
func (CompleteCustomList) String ¶
func (c CompleteCustomList) String() string
type CompleteInfo ¶ added in v0.0.27
type CompleteInfo struct {
Mode CompleteMode `json:"mode"`
}
type CompleteItem ¶ added in v0.0.27
type CompleteMode ¶ added in v0.0.27
type CompleteMode string
const ( CompleteModeNone CompleteMode = "" CompleteModeKeyword CompleteMode = "keyword" CompleteModeCtrl_x CompleteMode = "ctrl_x" CompleteModeWhole_line CompleteMode = "whole_line" CompleteModeFiles CompleteMode = "files" CompleteModeTags CompleteMode = "tags" CompleteModePath_defines CompleteMode = "path_defines" CompleteModePath_patterns CompleteMode = "path_patterns" CompleteModeDictionary CompleteMode = "dictionary" CompleteModeThesaurus CompleteMode = "thesaurus" CompleteModeCmdline CompleteMode = "cmdline" CompleteModeFunction CompleteMode = "function" CompleteModeOmni CompleteMode = "omni" CompleteModeSpell CompleteMode = "spell" CompleteModeEval CompleteMode = "eval" CompleteModeUnknown CompleteMode = "unknown" )
type Event ¶
type Event uint
const ( EventBufNewFile Event = iota // BufNewFile EventBufReadPre // BufReadPre EventBufRead // BufRead EventBufReadPost // BufReadPost EventBufReadCmd // BufReadCmd EventFileReadPre // FileReadPre EventFileReadPost // FileReadPost EventFileReadCmd // FileReadCmd EventFilterReadPre // FilterReadPre EventFilterReadPost // FilterReadPost EventStdinReadPre // StdinReadPre EventStdinReadPost // StdinReadPost EventBufWrite // BufWrite EventBufWritePre // BufWritePre EventBufWritePost // BufWritePost EventBufWriteCmd // BufWriteCmd EventFileWritePre // FileWritePre EventFileWritePost // FileWritePost EventFileWriteCmd // FileWriteCmd EventFileAppendPre // FileAppendPre EventFileAppendPost // FileAppendPost EventFileAppendCmd // FileAppendCmd EventFilterWritePre // FilterWritePre EventFilterWritePost // FilterWritePost EventBufAdd // BufAdd EventBufCreate // BufCreate EventBufDelete // BufDelete EventBufWipeout // BufWipeout EventTerminalOpen // TerminalOpen EventBufFilePre // BufFilePre EventBufFilePost // BufFilePost EventBufEnter // BufEnter EventBufLeave // BufLeave EventBufWinEnter // BufWinEnter EventBufWinLeave // BufWinLeave EventBufUnload // BufUnload EventBufHidden // BufHidden EventBufNew // BufNew EventSwapExists // SwapExists EventFileType // FileType EventSyntax // Syntax EventEncodingChanged // EncodingChanged EventTermChanged // TermChanged EventOptionSet // OptionSet EventVimEnter // VimEnter EventGUIEnter // GUIEnter EventGUIFailed // GUIFailed EventTermResponse // TermResponse EventQuitPre // QuitPre EventExitPre // ExitPre EventVimLeavePre // VimLeavePre EventVimLeave // VimLeave EventFileChangedShell // FileChangedShell EventFileChangedShellPost // FileChangedShellPost EventFileChangedRO // FileChangedRO EventDiffUpdated // DiffUpdated EventDirChanged // DirChanged EventShellCmdPost // ShellCmdPost EventShellFilterPost // ShellFilterPost EventCmdUndefined // CmdUndefined EventFuncUndefined // FuncUndefined EventSpellFileMissing // SpellFileMissing EventSourcePre // SourcePre EventSourcePost // SourcePost EventSourceCmd // SourceCmd EventVimResized // VimResized EventFocusGained // FocusGained EventFocusLost // FocusLost EventCursorHold // CursorHold EventCursorHoldI // CursorHoldI EventCursorMoved // CursorMoved EventCursorMovedI // CursorMovedI EventWinNew // WinNew EventTabNew // TabNew EventTabClosed // TabClosed EventWinEnter // WinEnter EventWinLeave // WinLeave EventTabEnter // TabEnter EventTabLeave // TabLeave EventCmdwinEnter // CmdwinEnter EventCmdwinLeave // CmdwinLeave EventCmdlineChanged // CmdlineChanged EventCmdlineEnter // CmdlineEnter EventCmdlineLeave // CmdlineLeave EventInsertEnter // InsertEnter EventInsertChange // InsertChange EventInsertLeave // InsertLeave EventInsertCharPre // InsertCharPre EventTextChanged // TextChanged EventTextChangedI // TextChangedI EventTextChangedP // TextChangedP EventTextYankPost // TextYankPost EventColorSchemePre // ColorSchemePre EventColorScheme // ColorScheme EventRemoteReply // RemoteReply EventQuickFixCmdPre // QuickFixCmdPre EventQuickFixCmdPost // QuickFixCmdPost EventSessionLoadPost // SessionLoadPost EventMenuPopup // MenuPopup EventCompleteDone // CompleteDone )
type Govim ¶
type Govim interface {
// ChannelEx executes a ex command in Vim
ChannelEx(expr string) error
// ChannelExpr evaluates and returns the result of expr in Vim
ChannelExpr(expr string) (json.RawMessage, error)
// ChannelNormal run a command in normal mode in Vim
ChannelNormal(expr string) error
// ChannelCall evaluates and returns the result of call in Vim
ChannelCall(fn string, args ...interface{}) (json.RawMessage, error)
// ChannelRedraw performs a redraw in Vim
ChannelRedraw(force bool) error
// DefineFunction defines the named function in Vim. name must begin with a capital
// letter. params is the parameters that will be used in the Vim function delcaration.
// If params is nil, then "..." is assumed.
DefineFunction(name string, params []string, f VimFunction) error
// DefineRangeFunction defines the named function as range-based in Vim. name
// must begin with a capital letter. params is the parameters that will be used
// in the Vim function delcaration. If params is nil, then "..." is assumed.
DefineRangeFunction(name string, params []string, f VimRangeFunction) error
// DefineCommand defines the named command in Vim. name must begin with a
// capital letter. attrs is a series of attributes for the command; see :help
// E174 in Vim for more details.
DefineCommand(name string, f VimCommandFunction, attrs ...CommAttr) error
// DefineAutoCommand defines an autocmd for events for files matching patterns.
DefineAutoCommand(group string, events Events, patts Patterns, nested bool, f VimAutoCommandFunction, exprs ...string) error
// Run is a user-friendly run wrapper
Run() error
// DoProto is used as a wrapper around function calls that jump the "interface"
// between the user and protocol aspects of govim.
DoProto(f func() error) error
// Viewport returns the active Vim viewport
Viewport() (Viewport, error)
// Errorf raises a formatted fatal error
Errorf(format string, args ...interface{})
// Logf logs a formatted message to the logger
Logf(format string, args ...interface{})
// Scheduled returns the event queue Govim interface
Scheduled() Govim
// Enqueue enqueues f to run in govim's event queue. There is no
// synchronisation with Vim's event queue. done is closed when f returns.
Enqueue(f func(Govim) error) (done chan struct{})
// Schedule schedules f to run when it is next safe to do so from Vim's
// perspective. f is then run within govim's event queue. done is closed
// when f returns
Schedule(f func(Govim) error) (done chan struct{}, err error)
// Flavor returns the flavor of the editor to which the Govim instance is
// connected
Flavor() Flavor
// Version returns the semver version of the editor to which the Govim
// instance is connected
Version() string
// Loaded returns a channel that can be used to wait until a Govim instance
// has finished loading. The Init phase will follow a successful load.
Loaded() chan struct{}
// Initialized returns a channel that can be used to wait until a Govim
// instance has completed the init phase, post loading.
Initialized() chan struct{}
// Shutdown returns a channel that can be used to wait until a Govim
// instance has completed the shutdown phase.
Shutdown() chan struct{}
}
type SwitchBufMode ¶
type SwitchBufMode string
SwitchBufValue typed constants define the set of values that the Vim setting switchbuf can take. See :help switchbuf for more details and definitions of each value.
const ( SwitchBufUseOpen SwitchBufMode = "useopen" SwitchBufUseTag SwitchBufMode = "usetab" SwitchBufSplit SwitchBufMode = "split" SwitchBufVsplit SwitchBufMode = "vsplit" SwitchBufNewTab SwitchBufMode = "newtab" )
func ParseSwitchBufModes ¶
func ParseSwitchBufModes(vs string) ([]SwitchBufMode, error)
ParseSwitchBufModes assumes vs is a valid value for &switchbuf
type VimAutoCommandFunction ¶
type VimAutoCommandFunction func(g Govim, args ...json.RawMessage) error
VimAutoCommandFunction is the signature of a callback from a defined autocmd
type VimCommandFunction ¶
type VimCommandFunction func(g Govim, flags CommandFlags, args ...string) error
VimCommandFunction is the signature of a callback from a defined command
type VimFunction ¶
type VimFunction func(g Govim, args ...json.RawMessage) (interface{}, error)
VimFunction is the signature of a callback from a defined function
type VimRangeFunction ¶
type VimRangeFunction func(g Govim, line1, line2 int, args ...json.RawMessage) (interface{}, error)
VimRangeFunction is the signature of a callback from a defined range-based function
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
govim
command
Command govim is a Vim8 channel-based plugin, written in Go, to support the writing of Go code in Vim8
|
Command govim is a Vim8 channel-based plugin, written in Go, to support the writing of Go code in Vim8 |
|
govim/config
Package config declares the configuration variables, functions and commands used by govim
|
Package config declares the configuration variables, functions and commands used by govim |
|
govim/config/internal/applygen
command
applygen is a command that automates the generation of an Apply method on the pointer receiver of a struct type which has exported pointer-type fields to apply overrides from the argument onto the receiver
|
applygen is a command that automates the generation of an Apply method on the pointer receiver of a struct type which has exported pointer-type fields to apply overrides from the argument onto the receiver |
|
govim/internal/golang_org_x_tools/fastwalk
Package fastwalk provides a faster version of filepath.Walk for file system scanning tools.
|
Package fastwalk provides a faster version of filepath.Walk for file system scanning tools. |
|
govim/internal/golang_org_x_tools/gopathwalk
Package gopathwalk is like filepath.Walk but specialized for finding Go packages, particularly in $GOPATH and $GOROOT.
|
Package gopathwalk is like filepath.Walk but specialized for finding Go packages, particularly in $GOPATH and $GOROOT. |
|
govim/internal/golang_org_x_tools/imports
Package imports implements a Go pretty-printer (like package "go/format") that also adds or removes import statements as necessary.
|
Package imports implements a Go pretty-printer (like package "go/format") that also adds or removes import statements as necessary. |
|
govim/internal/golang_org_x_tools/jsonrpc2
Package jsonrpc2 is a minimal implementation of the JSON RPC 2 spec.
|
Package jsonrpc2 is a minimal implementation of the JSON RPC 2 spec. |
|
govim/internal/golang_org_x_tools/lsp
Package lsp implements LSP for gopls.
|
Package lsp implements LSP for gopls. |
|
govim/internal/golang_org_x_tools/lsp/browser
Package browser provides utilities for interacting with users' browsers.
|
Package browser provides utilities for interacting with users' browsers. |
|
govim/internal/golang_org_x_tools/lsp/cache
Package cache implements the caching layer for gopls.
|
Package cache implements the caching layer for gopls. |
|
govim/internal/golang_org_x_tools/lsp/cmd
Package cmd handles the gopls command line.
|
Package cmd handles the gopls command line. |
|
govim/internal/golang_org_x_tools/lsp/cmd/test
Package cmdtest contains the test suite for the command line behavior of gopls.
|
Package cmdtest contains the test suite for the command line behavior of gopls. |
|
govim/internal/golang_org_x_tools/lsp/debug
Package debug exports debug information for gopls.
|
Package debug exports debug information for gopls. |
|
govim/internal/golang_org_x_tools/lsp/diff
Package diff supports a pluggable diff algorithm.
|
Package diff supports a pluggable diff algorithm. |
|
govim/internal/golang_org_x_tools/lsp/diff/difftest
Package difftest supplies a set of tests that will operate on any implementation of a diff algorithm as exposed by "github.com/govim/govim/cmd/govim/internal/golang_org_x_tools/lsp/diff"
|
Package difftest supplies a set of tests that will operate on any implementation of a diff algorithm as exposed by "github.com/govim/govim/cmd/govim/internal/golang_org_x_tools/lsp/diff" |
|
govim/internal/golang_org_x_tools/lsp/diff/myers
Package myers implements the Myers diff algorithm.
|
Package myers implements the Myers diff algorithm. |
|
govim/internal/golang_org_x_tools/lsp/fuzzy
Package fuzzy implements a fuzzy matching algorithm.
|
Package fuzzy implements a fuzzy matching algorithm. |
|
govim/internal/golang_org_x_tools/lsp/helper
command
Invoke with //go:generate helper/helper -t Server -d protocol/tsserver.go -u lsp -o server_gen.go invoke in internal/lsp
|
Invoke with //go:generate helper/helper -t Server -d protocol/tsserver.go -u lsp -o server_gen.go invoke in internal/lsp |
|
govim/internal/golang_org_x_tools/lsp/mod
Package mod provides core features related to go.mod file handling for use by Go editors and tools.
|
Package mod provides core features related to go.mod file handling for use by Go editors and tools. |
|
govim/internal/golang_org_x_tools/lsp/protocol
Package protocol contains the structs that map directly to the wire format of the "Language Server Protocol".
|
Package protocol contains the structs that map directly to the wire format of the "Language Server Protocol". |
|
govim/internal/golang_org_x_tools/lsp/snippet
Package snippet implements the specification for the LSP snippet format.
|
Package snippet implements the specification for the LSP snippet format. |
|
govim/internal/golang_org_x_tools/lsp/source
Package source provides core features for use by Go editors and tools.
|
Package source provides core features for use by Go editors and tools. |
|
govim/internal/golang_org_x_tools/lsp/telemetry
Package telemetry provides the hooks and adapters to allow use of telemetry throughout gopls.
|
Package telemetry provides the hooks and adapters to allow use of telemetry throughout gopls. |
|
govim/internal/golang_org_x_tools/lsp/tests
Package tests exports functionality to be used across a variety of gopls tests.
|
Package tests exports functionality to be used across a variety of gopls tests. |
|
govim/internal/golang_org_x_tools/memoize
Package memoize supports memoizing the return values of functions with idempotent results that are expensive to compute.
|
Package memoize supports memoizing the return values of functions with idempotent results that are expensive to compute. |
|
govim/internal/golang_org_x_tools/module
Package module defines the module.Version type along with support code.
|
Package module defines the module.Version type along with support code. |
|
govim/internal/golang_org_x_tools/packagesinternal
Package packagesinternal exposes internal-only fields from go/packages.
|
Package packagesinternal exposes internal-only fields from go/packages. |
|
govim/internal/golang_org_x_tools/semver
Package semver implements comparison of semantic version strings.
|
Package semver implements comparison of semantic version strings. |
|
govim/internal/golang_org_x_tools/span
Package span contains support for representing with positions and ranges in text files.
|
Package span contains support for representing with positions and ranges in text files. |
|
govim/internal/golang_org_x_tools/telemetry
Package telemetry provides an opinionated set of packages that cover the main concepts of telemetry in an implementation agnostic way.
|
Package telemetry provides an opinionated set of packages that cover the main concepts of telemetry in an implementation agnostic way. |
|
govim/internal/golang_org_x_tools/telemetry/export
Package export holds the definition of the telemetry Exporter interface, along with some simple implementations.
|
Package export holds the definition of the telemetry Exporter interface, along with some simple implementations. |
|
govim/internal/golang_org_x_tools/telemetry/export/ocagent
Package ocagent adds the ability to export all telemetry to an ocagent.
|
Package ocagent adds the ability to export all telemetry to an ocagent. |
|
govim/internal/golang_org_x_tools/telemetry/log
Package log is a context based logging package, designed to interact well with both the lsp protocol and the other telemetry packages.
|
Package log is a context based logging package, designed to interact well with both the lsp protocol and the other telemetry packages. |
|
govim/internal/golang_org_x_tools/telemetry/metric
Package metric aggregates stats into metrics that can be exported.
|
Package metric aggregates stats into metrics that can be exported. |
|
govim/internal/golang_org_x_tools/telemetry/stats
Package stats provides support for recording telemetry statistics.
|
Package stats provides support for recording telemetry statistics. |
|
govim/internal/golang_org_x_tools/telemetry/tag
Package tag provides support for telemetry tagging.
|
Package tag provides support for telemetry tagging. |
|
govim/internal/golang_org_x_tools/telemetry/trace
Package trace adds support for telemetry tracing.
|
Package trace adds support for telemetry tracing. |
|
govim/internal/golang_org_x_tools/telemetry/unit
Package unit holds the definitions for the units you can use in telemetry.
|
Package unit holds the definitions for the units you can use in telemetry. |
|
govim/internal/golang_org_x_tools/testenv
Package testenv contains helper functions for skipping tests based on which tools are present in the environment.
|
Package testenv contains helper functions for skipping tests based on which tools are present in the environment. |
|
govim/internal/golang_org_x_tools/tool
Package tool is an opinionated harness for writing Go tools.
|
Package tool is an opinionated harness for writing Go tools. |
|
govim/internal/golang_org_x_tools/xcontext
Package xcontext is a package to offer the extra functionality we need from contexts that is not available from the standard context package.
|
Package xcontext is a package to offer the extra functionality we need from contexts that is not available from the standard context package. |
|
govim/internal/vimconfig
Package vimconfig defines the mapping between Vim-specified config and govim config
|
Package vimconfig defines the mapping between Vim-specified config and govim config |
|
github
|
|
|
actions/setupvim
module
|
|
|
internal
|
|
|
cmd/genconfig
command
|
|
|
cmd/txtarutil
command
txtarutil manipulates the "footer" of a txtar archive.
|
txtarutil manipulates the "footer" of a txtar archive. |
|
textutil
package textutil contains text processing utilities.
|
package textutil contains text processing utilities. |
|
Package testdriver is a support package for plugins written using github.com/govim/govim
|
Package testdriver is a support package for plugins written using github.com/govim/govim |
Click to show internal directories.
Click to hide internal directories.