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, }
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 EventUser // User )
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{} }
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 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
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/fswatcher
Package fswatcher is responsible for providing file system events to govim
|
Package fswatcher is responsible for providing file system events to govim |
govim/internal/golang_org_x_tools/analysisinternal
Package analysisinternal exposes internal-only fields from go/analysis.
|
Package analysisinternal exposes internal-only fields from go/analysis. |
govim/internal/golang_org_x_tools/bug
Package bug provides utilities for reporting internal bugs, and being notified when they occur.
|
Package bug provides utilities for reporting internal bugs, and being notified when they occur. |
govim/internal/golang_org_x_tools/diff
Package diff computes differences between text files or strings.
|
Package diff computes differences between text files or strings. |
govim/internal/golang_org_x_tools/diff/lcs
package lcs contains code to find longest-common-subsequences (and diffs)
|
package lcs contains code to find longest-common-subsequences (and diffs) |
govim/internal/golang_org_x_tools/diff/myers
Package myers implements the Myers diff algorithm.
|
Package myers implements the Myers diff algorithm. |
govim/internal/golang_org_x_tools/event
Package event provides a set of packages that cover the main concepts of telemetry in an implementation agnostic way.
|
Package event provides a set of packages that cover the main concepts of telemetry in an implementation agnostic way. |
govim/internal/golang_org_x_tools/event/core
Package core provides support for event based telemetry.
|
Package core provides support for event based telemetry. |
govim/internal/golang_org_x_tools/event/tag
Package tag provides the labels used for telemetry throughout gopls.
|
Package tag provides the labels used for telemetry throughout gopls. |
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/fuzzy
Package fuzzy implements a fuzzy matching algorithm.
|
Package fuzzy implements a fuzzy matching algorithm. |
govim/internal/golang_org_x_tools/gocommand
Package gocommand is a helper for calling the go command.
|
Package gocommand is a helper for calling the go command. |
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/jsonrpc2_v2
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/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/typeparams
Package typeparams contains common utilities for writing tools that interact with generic Go code, as introduced with Go 1.18.
|
Package typeparams contains common utilities for writing tools that interact with generic Go code, as introduced with Go 1.18. |
govim/internal/golang_org_x_tools/typesinternal
Package typesinternal provides access to internal go/types APIs that are not yet exported.
|
Package typesinternal provides access to internal go/types APIs that are not yet exported. |
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/golang_org_x_tools_gopls/govulncheck
Package govulncheck supports the govulncheck command.
|
Package govulncheck supports the govulncheck command. |
govim/internal/golang_org_x_tools_gopls/govulncheck/semver
Package semver provides shared utilities for manipulating Go semantic versions.
|
Package semver provides shared utilities for manipulating Go semantic versions. |
govim/internal/golang_org_x_tools_gopls/lsp/analysis/embeddirective
Package embeddirective defines an Analyzer that validates import for //go:embed directive.
|
Package embeddirective defines an Analyzer that validates import for //go:embed directive. |
govim/internal/golang_org_x_tools_gopls/lsp/analysis/fillreturns
Package fillreturns defines an Analyzer that will attempt to automatically fill in a return statement that has missing values with zero value elements.
|
Package fillreturns defines an Analyzer that will attempt to automatically fill in a return statement that has missing values with zero value elements. |
govim/internal/golang_org_x_tools_gopls/lsp/analysis/fillstruct
Package fillstruct defines an Analyzer that automatically fills in a struct declaration with zero value elements for each field.
|
Package fillstruct defines an Analyzer that automatically fills in a struct declaration with zero value elements for each field. |
govim/internal/golang_org_x_tools_gopls/lsp/analysis/infertypeargs
Package infertypeargs defines an analyzer that checks for explicit function arguments that could be inferred.
|
Package infertypeargs defines an analyzer that checks for explicit function arguments that could be inferred. |
govim/internal/golang_org_x_tools_gopls/lsp/analysis/nonewvars
Package nonewvars defines an Analyzer that applies suggested fixes to errors of the type "no new variables on left side of :=".
|
Package nonewvars defines an Analyzer that applies suggested fixes to errors of the type "no new variables on left side of :=". |
govim/internal/golang_org_x_tools_gopls/lsp/analysis/noresultvalues
Package noresultvalues defines an Analyzer that applies suggested fixes to errors of the type "no result values expected".
|
Package noresultvalues defines an Analyzer that applies suggested fixes to errors of the type "no result values expected". |
govim/internal/golang_org_x_tools_gopls/lsp/analysis/simplifycompositelit
Package simplifycompositelit defines an Analyzer that simplifies composite literals.
|
Package simplifycompositelit defines an Analyzer that simplifies composite literals. |
govim/internal/golang_org_x_tools_gopls/lsp/analysis/simplifyrange
Package simplifyrange defines an Analyzer that simplifies range statements.
|
Package simplifyrange defines an Analyzer that simplifies range statements. |
govim/internal/golang_org_x_tools_gopls/lsp/analysis/simplifyslice
Package simplifyslice defines an Analyzer that simplifies slice statements.
|
Package simplifyslice defines an Analyzer that simplifies slice statements. |
govim/internal/golang_org_x_tools_gopls/lsp/analysis/undeclaredname
Package undeclaredname defines an Analyzer that applies suggested fixes to errors of the type "undeclared name: %s".
|
Package undeclaredname defines an Analyzer that applies suggested fixes to errors of the type "undeclared name: %s". |
govim/internal/golang_org_x_tools_gopls/lsp/analysis/unusedparams
Package unusedparams defines an analyzer that checks for unused parameters of functions.
|
Package unusedparams defines an analyzer that checks for unused parameters of functions. |
govim/internal/golang_org_x_tools_gopls/lsp/analysis/unusedvariable
Package unusedvariable defines an analyzer that checks for unused variables.
|
Package unusedvariable defines an analyzer that checks for unused variables. |
govim/internal/golang_org_x_tools_gopls/lsp/analysis/useany
Package useany defines an Analyzer that checks for usage of interface{} in constraints, rather than the predeclared any.
|
Package useany defines an Analyzer that checks for usage of interface{} in constraints, rather than the predeclared any. |
govim/internal/golang_org_x_tools_gopls/lsp/command
Package command defines the interface provided by gopls for the workspace/executeCommand LSP request.
|
Package command defines the interface provided by gopls for the workspace/executeCommand LSP request. |
govim/internal/golang_org_x_tools_gopls/lsp/lsppos
Package lsppos provides utilities for working with LSP positions.
|
Package lsppos provides utilities for working with LSP positions. |
govim/internal/golang_org_x_tools_gopls/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_gopls/lsp/safetoken
Package safetoken provides wrappers around methods in go/token, that return errors rather than panicking.
|
Package safetoken provides wrappers around methods in go/token, that return errors rather than panicking. |
govim/internal/golang_org_x_tools_gopls/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_gopls/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/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/txtarutil
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 |
Package testsetup defines some test-based constants that are common to tests and CI setup
|
Package testsetup defines some test-based constants that are common to tests and CI setup |
Click to show internal directories.
Click to hide internal directories.