Documentation
¶
Index ¶
- Constants
- Variables
- func AddNewlineAbove(e *view.Editor)
- func AddNewlineBelow(e *view.Editor)
- func AlignSelections(e *view.Editor)
- func AlignViewBottom(e *view.Editor)
- func AlignViewCenter(e *view.Editor)
- func AlignViewTop(e *view.Editor)
- func AppendMode(e *view.Editor)
- func AppendToLine(e *view.Editor)
- func ApplySelection(e *view.Editor, sel core.Selection)
- func ChangeSelection(e *view.Editor)
- func ChangeSelectionNoYank(e *view.Editor)
- func CharInfo(e *view.Editor) string
- func CloseCurrentView(e *view.Editor)
- func CollapseSelection(e *view.Editor)
- func CopyOnNextLine(e *view.Editor)
- func CopyOnPrevLine(e *view.Editor)
- func Decrement(e *view.Editor)
- func DeleteCharBackward(e *view.Editor)
- func DeleteCharForward(e *view.Editor)
- func DeleteSelection(e *view.Editor)
- func DeleteSelectionNoYank(e *view.Editor)
- func DeleteWordBackward(e *view.Editor)
- func DeleteWordForward(e *view.Editor)
- func EnsureForward(e *view.Editor)
- func ExitSelectMode(e *view.Editor)
- func ExtendCharLeft(e *view.Editor)
- func ExtendCharRight(e *view.Editor)
- func ExtendLineBelow(e *view.Editor)
- func ExtendLineDown(e *view.Editor)
- func ExtendLineUp(e *view.Editor)
- func ExtendNextLongWordEnd(e *view.Editor)
- func ExtendNextLongWordStart(e *view.Editor)
- func ExtendNextSubWordEnd(e *view.Editor)
- func ExtendNextSubWordStart(e *view.Editor)
- func ExtendNextWordEnd(e *view.Editor)
- func ExtendNextWordStart(e *view.Editor)
- func ExtendPrevLongWordEnd(e *view.Editor)
- func ExtendPrevLongWordStart(e *view.Editor)
- func ExtendPrevSubWordEnd(e *view.Editor)
- func ExtendPrevSubWordStart(e *view.Editor)
- func ExtendPrevWordEnd(e *view.Editor)
- func ExtendPrevWordStart(e *view.Editor)
- func ExtendSearchNext(e *view.Editor)
- func ExtendSearchPrev(e *view.Editor)
- func ExtendToColumn(e *view.Editor)
- func ExtendToFileEnd(e *view.Editor)
- func ExtendToFileStart(e *view.Editor)
- func ExtendToLastLine(e *view.Editor)
- func ExtendToLineBounds(e *view.Editor)
- func ExtendToLineEnd(e *view.Editor)
- func ExtendToLineEndNewline(e *view.Editor)
- func ExtendToLineStart(e *view.Editor)
- func ExtendToNonWhitespace(e *view.Editor)
- func FindChar(args FindCharArgs)
- func FlipSelections(e *view.Editor)
- func GotoColumn(e *view.Editor)
- func GotoFirstChange(e *view.Editor)
- func GotoLastAccessedFile(e *view.Editor)
- func GotoLastChange(e *view.Editor)
- func GotoLastModification(e *view.Editor)
- func GotoLastModifiedFile(e *view.Editor)
- func GotoLine(e *view.Editor, n int)
- func GotoLineEndNewline(e *view.Editor)
- func GotoNextChange(e *view.Editor)
- func GotoNextParagraph(e *view.Editor)
- func GotoPosition(e *view.Editor, at core.Position)
- func GotoPrevChange(e *view.Editor)
- func GotoPrevParagraph(e *view.Editor)
- func GotoWindowBottom(e *view.Editor)
- func GotoWindowCenter(e *view.Editor)
- func GotoWindowTop(e *view.Editor)
- func HalfPageDown(e *view.Editor)
- func HalfPageUp(e *view.Editor)
- func InLeadingWhitespace(e *view.Editor) bool
- func Increment(e *view.Editor)
- func Indent(e *view.Editor)
- func InsertAtLineStart(e *view.Editor)
- func InsertChar(e *view.Editor, ch rune)
- func InsertMode(e *view.Editor)
- func InsertNewline(e *view.Editor)
- func InsertTab(e *view.Editor)
- func JoinSelections(e *view.Editor)
- func JoinSelectionsSpace(e *view.Editor)
- func JumpBackward(e *view.Editor)
- func JumpForward(e *view.Editor)
- func KeepPrimarySelection(e *view.Editor)
- func KeepSelectionsMatching(e *view.Editor, pattern string) error
- func KillToLineEnd(e *view.Editor)
- func KillToLineStart(e *view.Editor)
- func MakeSearchWordBounded(e *view.Editor)
- func MergeConsecutive(e *view.Editor)
- func MergeSelections(e *view.Editor)
- func MoveDown(e *view.Editor)
- func MoveFileEnd(e *view.Editor)
- func MoveFileStart(e *view.Editor)
- func MoveLeft(e *view.Editor)
- func MoveLineEnd(e *view.Editor)
- func MoveLineNonWhitespace(e *view.Editor)
- func MoveLineStart(e *view.Editor)
- func MoveLongWordBackward(e *view.Editor)
- func MoveLongWordEnd(e *view.Editor)
- func MoveLongWordForward(e *view.Editor)
- func MoveNextSubWordEnd(e *view.Editor)
- func MoveNextSubWordStart(e *view.Editor)
- func MovePrevLongWordEnd(e *view.Editor)
- func MovePrevSubWordEnd(e *view.Editor)
- func MovePrevSubWordStart(e *view.Editor)
- func MovePrevWordEnd(e *view.Editor)
- func MoveRight(e *view.Editor)
- func MoveUp(e *view.Editor)
- func MoveWordBackward(e *view.Editor)
- func MoveWordEnd(e *view.Editor)
- func MoveWordForward(e *view.Editor)
- func NewOSC52Clipboard(inner view.Clipboard) view.Clipboard
- func NormalMode(e *view.Editor)
- func OpenAbove(e *view.Editor)
- func OpenBelow(e *view.Editor)
- func OpenExternalURL(raw string) error
- func PageCursorHalfDown(e *view.Editor)
- func PageCursorHalfUp(e *view.Editor)
- func PageDown(e *view.Editor)
- func PageUp(e *view.Editor)
- func PasteAfter(e *view.Editor)
- func PasteBefore(e *view.Editor)
- func PastePrimaryClipboardAfter(e *view.Editor)
- func PastePrimaryClipboardBefore(e *view.Editor)
- func PasteRegisterAtCursor(e *view.Editor, reg rune)
- func PrimaryClipboardReplace(e *view.Editor)
- func ReadFile(e *view.Editor, path string) error
- func ReflowSelections(e *view.Editor, width int)
- func RemovePrimarySelection(e *view.Editor)
- func RemoveSelectionsMatching(e *view.Editor, pattern string) error
- func RepeatLastMotion(e *view.Editor)
- func ReplaceChar(e *view.Editor, ch rune)
- func ReplaceWithYanked(e *view.Editor)
- func ResetDiffChange(e *view.Editor) (int, error)
- func ResizeViewDown(e *view.Editor)
- func ResizeViewLeft(e *view.Editor)
- func ResizeViewRight(e *view.Editor)
- func ResizeViewUp(e *view.Editor)
- func RotateContentsBackward(e *view.Editor)
- func RotateContentsForward(e *view.Editor)
- func RotateSelectionsBackward(e *view.Editor)
- func RotateSelectionsForward(e *view.Editor)
- func RunFormatter(a RunFormatterArgs) error
- func SaveSelection(e *view.Editor)
- func ScrollDown(e *view.Editor)
- func ScrollUp(e *view.Editor)
- func ScrollViewColumns(e *view.Editor, v *view.View, n int, left bool)
- func ScrollViewLines(e *view.Editor, v *view.View, n int, up bool)
- func SearchBackward(e *view.Editor, pattern string) error
- func SearchForward(e *view.Editor, pattern string) error
- func SearchNext(e *view.Editor)
- func SearchPrev(e *view.Editor)
- func SearchSelection(e *view.Editor)
- func SearchSelectionWord(e *view.Editor)
- func SelectAll(e *view.Editor)
- func SelectLineAbove(e *view.Editor)
- func SelectLineBelow(e *view.Editor)
- func SelectMode(e *view.Editor)
- func SelectTextObjectAround(e *view.Editor, ch rune)
- func SelectTextObjectInside(e *view.Editor, ch rune)
- func SelectWithinRegex(e *view.Editor, pattern string) error
- func SetLineEnding(e *view.Editor, le core.LineEnding) error
- func ShellAppendOutput(e *view.Editor, cmdStr string) error
- func ShellInsertOutput(e *view.Editor, cmdStr string) error
- func ShellKeepPipe(e *view.Editor, cmdStr string) error
- func ShellPipe(e *view.Editor, cmdStr string) error
- func ShellPipeTo(e *view.Editor, cmdStr string) error
- func ShrinkToLineBounds(e *view.Editor)
- func SortSelections(e *view.Editor, args SortSelectionsArgs) error
- func SplitSelectionByRegex(e *view.Editor, pattern string) error
- func SplitSelectionOnNewline(e *view.Editor)
- func SurroundAdd(e *view.Editor, ch rune)
- func SurroundDelete(e *view.Editor, ch rune)
- func SurroundDeleteAt(e *view.Editor, text core.Rope, positions []int)
- func SurroundReplace(args SurroundReplaceArgs)
- func SurroundReplaceAt(e *view.Editor, text core.Rope, positions []int, to rune)
- func SwitchCase(e *view.Editor)
- func SwitchToLowercase(e *view.Editor)
- func SwitchToUppercase(e *view.Editor)
- func ToggleBlockComments(e *view.Editor)
- func ToggleComments(e *view.Editor)
- func ToggleLineComments(e *view.Editor)
- func TrimSelections(e *view.Editor)
- func Unindent(e *view.Editor)
- func Yank(e *view.Editor)
- func YankJoin(e *view.Editor, sep string)
- func YankMain(e *view.Editor)
- func YankToClipboard(e *view.Editor)
- func YankToPrimaryClipboard(e *view.Editor)
- type FindCharArgs
- type GotoTarget
- type RunFormatterArgs
- type SortSelectionsArgs
- type SurroundReplaceArgs
- type SystemClipboard
- type TTYWriter
Constants ¶
const ( StatusYanked i18n.Key = "status.yanked" StatusYankedToClipboard i18n.Key = "status.yankedToClipboard" )
Variables ¶
var ( // ErrNoFilePath is returned when no file path is found under the cursor ErrNoFilePath = errors.New("no file path under cursor") // ErrDocumentLinkTarget is returned when a caller needs a local path but // the document link points elsewhere ErrDocumentLinkTarget = errors.New("document link target unsupported") // ErrExternalURLOpener is returned when no external URL opener is available ErrExternalURLOpener = errors.New("external URL opener unavailable") )
var ( ErrNoChangesInSelection = errors.New("no changes under any selection") )
var (
ErrNoClipboardProvider = errors.New("no clipboard provider found")
)
var ErrShellCommand = errors.New("shell command failed")
Functions ¶
func AddNewlineAbove ¶
AddNewlineAbove inserts blank lines above each selection's first line. Repeats count times using the document line ending
func AddNewlineBelow ¶
AddNewlineBelow inserts blank lines below each selection's last line. Repeats count times using the document line ending
func AlignSelections ¶
AlignSelections inserts spaces before each cursor so all cursors sit at the same visual column (the maximum column among all cursors). Only operates when there are multiple selection ranges, all on different lines
func AlignViewBottom ¶
AlignViewBottom scrolls the viewport so the cursor line is at the bottom
func AlignViewCenter ¶
AlignViewCenter scrolls the viewport so the cursor line is at the center
func AlignViewTop ¶
AlignViewTop scrolls the viewport so the cursor line is at the top
func AppendMode ¶
AppendMode enters insert mode with cursors one grapheme past the end of each selection
func AppendToLine ¶
AppendToLine moves each cursor to the end of its current line and enters insert mode (append after last char)
func ApplySelection ¶
ApplySelection applies sel to the focused document as a selection-only transaction, so cursor moves driven by input (mouse, jumps) go through the same insert-group and history bookkeeping as an edit
func ChangeSelection ¶
ChangeSelection yanks all selections into the active register, deletes them, and enters insert mode. For linewise selections, opens a blank line above
func ChangeSelectionNoYank ¶
ChangeSelectionNoYank deletes each selection without yanking and enters insert mode
func CharInfo ¶
CharInfo returns a string describing the grapheme at the primary cursor. Format: "<printable>" (U+XXXX ...) [Dec N] Hex xx [+xx ...]
func CloseCurrentView ¶
CloseCurrentView closes the focused view. If the document has unsaved changes and there are other views, the close is blocked
func CollapseSelection ¶
CollapseSelection collapses every selection to its cursor position
func CopyOnNextLine ¶
CopyOnNextLine duplicates each selection range to the same column on the next line (count times)
func CopyOnPrevLine ¶
CopyOnPrevLine duplicates each selection range to the same column on the previous line (count times)
func DeleteCharBackward ¶
DeleteCharBackward deletes the character before each cursor in insert mode Dedents when the cursor is at the end of leading whitespace; otherwise deletes an auto-pair if applicable, or one grapheme backward
func DeleteCharForward ¶
DeleteCharForward deletes the grapheme cluster under each cursor
func DeleteSelection ¶
DeleteSelection yanks selections into the active register, then deletes them
func DeleteSelectionNoYank ¶
DeleteSelectionNoYank deletes each selection without yanking first
func DeleteWordBackward ¶
DeleteWordBackward deletes from the cursor to the start of the previous word, for use in insert mode (C-w)
func DeleteWordForward ¶
DeleteWordForward deletes from the cursor to the end of the next word, for use in insert mode (A-d)
func EnsureForward ¶
EnsureForward forces all selection ranges to have a forward direction (anchor <= head)
func ExitSelectMode ¶
ExitSelectMode returns to normal mode from select mode without performing the insert-mode cleanup that NormalMode does
func ExtendCharLeft ¶
ExtendCharLeft extends the selection one grapheme to the left
func ExtendCharRight ¶
ExtendCharRight extends the selection one grapheme to the right
func ExtendLineBelow ¶
ExtendLineBelow selects the current line(s) inclusive of the trailing newline. If the range already spans the full line, extends one more line
func ExtendLineDown ¶
ExtendLineDown extends the selection down one visual line, respecting soft-wrap
func ExtendLineUp ¶
ExtendLineUp extends the selection up one visual line, respecting soft-wrap
func ExtendNextLongWordEnd ¶
ExtendNextLongWordEnd extends the selection to the end of the next WORD
func ExtendNextLongWordStart ¶
ExtendNextLongWordStart extends the selection to the start of the next WORD
func ExtendNextSubWordEnd ¶
ExtendNextSubWordEnd extends to the end of the next sub-word
func ExtendNextSubWordStart ¶
ExtendNextSubWordStart extends to the start of the next sub-word
func ExtendNextWordEnd ¶
ExtendNextWordEnd extends the selection to the end of the next word
func ExtendNextWordStart ¶
ExtendNextWordStart extends the selection to the start of the next word
func ExtendPrevLongWordEnd ¶
ExtendPrevLongWordEnd extends the selection to the end of the previous WORD
func ExtendPrevLongWordStart ¶
ExtendPrevLongWordStart extends to the start of the previous WORD
func ExtendPrevSubWordEnd ¶
ExtendPrevSubWordEnd extends to the end of the previous sub-word
func ExtendPrevSubWordStart ¶
ExtendPrevSubWordStart extends to the start of the previous sub-word
func ExtendPrevWordEnd ¶
ExtendPrevWordEnd extends the selection to the end of the previous word
func ExtendPrevWordStart ¶
ExtendPrevWordStart extends the selection to the start of the previous word
func ExtendSearchNext ¶
ExtendSearchNext repeats the last search forward, extending the selection
func ExtendSearchPrev ¶
ExtendSearchPrev repeats the last search backward, extending the selection
func ExtendToColumn ¶
ExtendToColumn extends each selection to the Nth character column
func ExtendToFileEnd ¶
ExtendToFileEnd extends all selections to the absolute end of the document
func ExtendToFileStart ¶
ExtendToFileStart extends the selection to the beginning of the document
func ExtendToLastLine ¶
ExtendToLastLine extends to the start of the last non-blank line
func ExtendToLineBounds ¶
ExtendToLineBounds extends each selection range to cover complete lines (from line start to next-line start), preserving direction
func ExtendToLineEnd ¶
ExtendToLineEnd extends the selection to the end of the current line
func ExtendToLineEndNewline ¶
ExtendToLineEndNewline extends each selection to the end of its current line, landing on the newline character
func ExtendToLineStart ¶
ExtendToLineStart extends the selection to the start of the current line
func ExtendToNonWhitespace ¶
ExtendToNonWhitespace extends the selection to the first non-whitespace character on the current line
func FindChar ¶
func FindChar(args FindCharArgs)
FindChar moves (or extends) each cursor to the nth occurrence of ch in the given direction. inclusive=true lands on the char (f/F), false stops before/ after it (t/T). extend=true keeps the anchor (select mode)
func FlipSelections ¶
FlipSelections swaps anchor and head for every selection range
func GotoColumn ¶ added in v0.3.0
GotoColumn moves each cursor to the Nth character column
func GotoFirstChange ¶
GotoFirstChange selects the first diff change in the document
func GotoLastAccessedFile ¶
GotoLastAccessedFile switches to the most recently accessed alternate file
func GotoLastChange ¶
GotoLastChange selects the last diff change in the document
func GotoLastModification ¶
GotoLastModification moves each cursor to the position of the most recent committed change in the current document
func GotoLastModifiedFile ¶
GotoLastModifiedFile switches focus to the most recently modified document that is not currently focused
func GotoLine ¶
GotoLine moves (or extends in select mode) the cursor to line n (1-based) If n is 0 the command is a no-op. Clamps to the last non-empty line
func GotoLineEndNewline ¶
GotoLineEndNewline moves each cursor to the end of its current line, landing on the newline character (for use in insert mode)
func GotoNextChange ¶
GotoNextChange moves each cursor to the next diff change
func GotoNextParagraph ¶
GotoNextParagraph moves (or extends in select mode) each cursor to the start of the next paragraph. A paragraph boundary is a blank line
func GotoPosition ¶ added in v0.1.6
GotoPosition moves (or extends in select mode) the cursor to a 1-based line and column. A Col <= 1 lands on the line start; otherwise the cursor is clamped to the line end. A Line <= 0 is a no-op
func GotoPrevChange ¶
GotoPrevChange moves each cursor to the previous diff change
func GotoPrevParagraph ¶
GotoPrevParagraph moves (or extends in select mode) each cursor to the start of the previous paragraph
func GotoWindowBottom ¶
GotoWindowBottom moves the cursor to the last visible line in the viewport
func GotoWindowCenter ¶
GotoWindowCenter moves the cursor to the center visible line
func GotoWindowTop ¶
GotoWindowTop moves the cursor to the top of the viewport
func HalfPageDown ¶
HalfPageDown scrolls the view down by half a page without moving the cursor
func HalfPageUp ¶
HalfPageUp scrolls the view up by half a page without moving the cursor
func InLeadingWhitespace ¶ added in v0.1.13
InLeadingWhitespace reports whether every cursor has only whitespace between it and the start of its line
func InsertAtLineStart ¶
InsertAtLineStart moves each cursor to the first non-whitespace char of its current line and enters insert mode
func InsertChar ¶
InsertChar inserts a character at every cursor position in insert mode Auto-pairs are applied when the character matches an opener or closer
func InsertMode ¶
InsertMode enters insert mode with cursors at the start of each selection
func InsertNewline ¶
InsertNewline inserts a newline at every cursor in insert mode, then replicates the previous line's leading whitespace (auto-indent)
func JoinSelections ¶
JoinSelections joins the lines within each selected line range by replacing each line ending (and surrounding whitespace) with nothing
func JoinSelectionsSpace ¶
JoinSelectionsSpace joins the lines within each selected line range by replacing each line ending (and surrounding whitespace) with a single space
func JumpBackward ¶
JumpBackward navigates to the previous position in the view's jump list
func JumpForward ¶
JumpForward navigates to the next position in the view's jump list
func KeepPrimarySelection ¶
KeepPrimarySelection discards all but the primary selection range
func KeepSelectionsMatching ¶
KeepSelectionsMatching keeps only selection ranges whose text matches regex
func KillToLineEnd ¶
KillToLineEnd deletes from the cursor to the end of the current line. If the cursor is already at the line ending, the newline itself is deleted
func KillToLineStart ¶
KillToLineStart deletes from the cursor to the start of the current line If the cursor is at the start, deletes the preceding newline (joins lines)
func MakeSearchWordBounded ¶
MakeSearchWordBounded wraps the current search pattern with \b word-boundary anchors if they are not already present
func MergeConsecutive ¶
MergeConsecutive merges overlapping or adjacent selection ranges
func MergeSelections ¶
MergeSelections merges all selection ranges into one spanning range
func MoveFileEnd ¶
MoveFileEnd moves all cursors to the start of the last non-blank line
func MoveFileStart ¶
MoveFileStart moves all cursors to the start of the document
func MoveLineEnd ¶
MoveLineEnd moves all cursors to the last non-newline character of their current line
func MoveLineNonWhitespace ¶
MoveLineNonWhitespace moves all cursors to the first non-whitespace character of their current line
func MoveLineStart ¶
MoveLineStart moves all cursors to the start of their current line
func MoveLongWordBackward ¶
MoveLongWordBackward moves all cursors to the start of the previous WORD
func MoveLongWordEnd ¶
MoveLongWordEnd moves all cursors to the end of the current or next WORD
func MoveLongWordForward ¶
MoveLongWordForward moves all cursors to the start of the next WORD
func MoveNextSubWordEnd ¶
MoveNextSubWordEnd moves to the end of the next sub-word
func MoveNextSubWordStart ¶
MoveNextSubWordStart moves to the start of the next sub-word
func MovePrevLongWordEnd ¶
MovePrevLongWordEnd moves all cursors to the end of the previous WORD
func MovePrevSubWordEnd ¶
MovePrevSubWordEnd moves to the end of the previous sub-word
func MovePrevSubWordStart ¶
MovePrevSubWordStart moves to the start of the previous sub-word
func MovePrevWordEnd ¶
MovePrevWordEnd moves all cursors to the end of the previous word
func MoveWordBackward ¶
MoveWordBackward moves all cursors to the start of the previous word
func MoveWordEnd ¶
MoveWordEnd moves all cursors to the end of the current or next word
func MoveWordForward ¶
MoveWordForward moves all cursors to the start of the next word
func NewOSC52Clipboard ¶
NewOSC52Clipboard layers OSC 52 terminal writes over inner, so a copy also reaches the clipboard of a terminal reached over ssh
func NormalMode ¶
NormalMode returns to normal mode, running cleanup like stripping blank-line auto-indent and moving the cursor off the past-end position
func OpenBelow ¶ added in v0.3.0
OpenBelow opens a line below each cursor's line and enters insert mode
func OpenExternalURL ¶
OpenExternalURL opens a URL with the platform default handler
func PageCursorHalfDown ¶
PageCursorHalfDown moves the cursor and scrolls the view down by half a page
func PageCursorHalfUp ¶
PageCursorHalfUp moves the cursor and scrolls the view up by half a page
func PasteAfter ¶
PasteAfter pastes the active register's contents after each selection
func PasteBefore ¶
PasteBefore pastes the active register's contents before each selection
func PastePrimaryClipboardAfter ¶
PastePrimaryClipboardAfter reads the primary clipboard and pastes after each selection
func PastePrimaryClipboardBefore ¶
PastePrimaryClipboardBefore reads the primary clipboard and pastes before each selection
func PasteRegisterAtCursor ¶
PasteRegisterAtCursor inserts the contents of the given register at each cursor position (for use in insert mode)
func PrimaryClipboardReplace ¶
PrimaryClipboardReplace replaces each selection with the primary clipboard
func ReflowSelections ¶
ReflowSelections reflows the text of each selection range to the given column width. Mirrors :reflow in the reference
func RemovePrimarySelection ¶
RemovePrimarySelection removes the primary selection range. If only one range exists, the command is a no-op
func RemoveSelectionsMatching ¶
RemoveSelectionsMatching removes selection ranges whose text matches regex
func RepeatLastMotion ¶
RepeatLastMotion replays the most recently recorded repeatable motion
func ReplaceChar ¶
ReplaceChar replaces every grapheme in each selection with ch and exits select mode
func ReplaceWithYanked ¶
ReplaceWithYanked replaces each selection with the corresponding value from the active register (default '"'). Exits select mode
func ResetDiffChange ¶
ResetDiffChange reverts every diff hunk that intersects the selection back to the version-control base text. It returns how many hunks were reset
func ResizeViewDown ¶
ResizeViewDown pushes the focused split's border in the down direction by count cells (see view.Editor.ResizeFocusedSplit)
func ResizeViewLeft ¶
ResizeViewLeft pushes the focused split's border in the left direction by count cells (see view.Editor.ResizeFocusedSplit)
func ResizeViewRight ¶
ResizeViewRight pushes the focused split's border in the right direction by count cells (see view.Editor.ResizeFocusedSplit)
func ResizeViewUp ¶
ResizeViewUp pushes the focused split's border in the up direction by count cells (see view.Editor.ResizeFocusedSplit)
func RotateContentsBackward ¶
RotateContentsBackward rotates the text content of each selection range backward by count steps
func RotateContentsForward ¶
RotateContentsForward rotates the text content of each selection range forward by count steps
func RotateSelectionsBackward ¶
RotateSelectionsBackward rotates the primary selection index backward by count steps (wrapping around)
func RotateSelectionsForward ¶
RotateSelectionsForward rotates the primary selection index forward by count steps (wrapping around)
func RunFormatter ¶
func RunFormatter(a RunFormatterArgs) error
RunFormatter runs an external formatter as a subprocess over the document's text and applies its output as a single edit, replacing the document text only when the formatter changed it
func SaveSelection ¶
SaveSelection pushes the current cursor position to the view's jump list
func ScrollDown ¶
ScrollDown scrolls the view down by count lines without moving the cursor
func ScrollViewColumns ¶
ScrollViewColumns scrolls a view horizontally by n columns without moving the cursor; scrolling right is clamped to keep one column of content visible
func ScrollViewLines ¶
ScrollViewLines scrolls a specific view by n lines, not moving the cursor. Used for mouse-wheel events; the view remains free-scrolled until that view receives cursor-moving keyboard input
func SearchBackward ¶
SearchBackward executes a backward search with the given pattern, storing it in the '/' register, and moves each cursor to the previous match
func SearchForward ¶
SearchForward executes a forward search with the given pattern, storing it in the '/' register, and moves each cursor to the first match
func SearchNext ¶
SearchNext repeats the last search forward, moving the selection
func SearchPrev ¶
SearchPrev repeats the last search backward, moving the selection
func SearchSelection ¶
SearchSelection stores the joined selection text as the search pattern (no word-boundary detection) and sets it in the '/' register
func SearchSelectionWord ¶
SearchSelectionWord stores the selection text as the search pattern, adding \b word-boundary anchors where the selection touches word boundaries
func SelectLineAbove ¶
SelectLineAbove selects current line(s) extending upward, direction-aware: backward selections grow at the head; forward selections shrink at the head
func SelectLineBelow ¶
SelectLineBelow selects current line(s) extending downward, direction-aware: forward selections grow at the head; backward selections shrink at the head
func SelectMode ¶
SelectMode enters select mode, adjusting any empty end-of-document selection to be one grapheme wide so it is always visible
func SelectTextObjectAround ¶
SelectTextObjectAround selects around the text object identified by ch Plaintext objects: w=word, W=WORD, p=paragraph, m or bracket = surround pair
func SelectTextObjectInside ¶
SelectTextObjectInside selects inside the text object identified by ch Plaintext objects: w=word, W=WORD, p=paragraph, m or bracket = surround pair
func SelectWithinRegex ¶
SelectWithinRegex keeps only the parts of each selection that match regex
func SetLineEnding ¶
func SetLineEnding(e *view.Editor, le core.LineEnding) error
SetLineEnding changes the document line-ending style and rewrites existing line endings in the focused buffer to match
func ShellAppendOutput ¶
ShellAppendOutput runs a shell command and appends its output after each selection
func ShellInsertOutput ¶
ShellInsertOutput runs a shell command and inserts its output before each cursor position
func ShellKeepPipe ¶
ShellKeepPipe pipes each selection through a shell command and keeps only selections for which the command exits with status 0
func ShellPipe ¶
ShellPipe pipes each selection through a shell command, replacing the selection with the command's stdout
func ShellPipeTo ¶
ShellPipeTo pipes each selection to a shell command, discarding output
func ShrinkToLineBounds ¶
ShrinkToLineBounds shrinks each multi-line selection so that it no longer includes leading/trailing line endings. Single-line selections are unchanged
func SortSelections ¶
func SortSelections(e *view.Editor, args SortSelectionsArgs) error
SortSelections sorts the text of each selection range lexicographically, replacing each range with the sorted text
func SplitSelectionByRegex ¶
SplitSelectionByRegex splits each selection range at every regex match
func SplitSelectionOnNewline ¶
SplitSelectionOnNewline splits each selection range on line boundaries, producing one sub-range per line (excluding the line ending itself)
func SurroundAdd ¶
SurroundAdd wraps each selection with the pair that matches ch, then switches to normal mode. ch may be either the opening or closing bracket character
func SurroundDelete ¶
SurroundDelete removes the surrounding pair identified by ch around each selection, then switches to normal mode
func SurroundDeleteAt ¶
SurroundDeleteAt deletes the brackets at flat [open, close, ...] positions and switches to normal mode
func SurroundReplace ¶
func SurroundReplace(args SurroundReplaceArgs)
SurroundReplace replaces the surrounding pair identified by Current with the pair matching Wanted. Called after two key prompts resolved by the model
func SurroundReplaceAt ¶
SurroundReplaceAt replaces brackets at flat [open, close, ...] positions with the pair matching to, then switches to normal mode
func SwitchCase ¶
SwitchCase toggles the case of every character in each selection
func SwitchToLowercase ¶
SwitchToLowercase converts every character in each selection to lowercase
func SwitchToUppercase ¶
SwitchToUppercase converts every character in each selection to uppercase
func ToggleBlockComments ¶
ToggleBlockComments toggles block comments on each selection range
func ToggleComments ¶
ToggleComments toggles the most appropriate comment style for the language: block comments if already block-commented, line comments otherwise
func ToggleLineComments ¶
ToggleLineComments toggles line comments on the selected lines
func TrimSelections ¶
TrimSelections trims leading and trailing whitespace from each selection range. Empty or all-whitespace ranges are dropped. When all ranges are dropped the selection falls back to a single cursor at the primary position
func Yank ¶
Yank copies the text of every selection range to the active register (defaulting to '"') and exits select mode
func YankJoin ¶
YankJoin yanks all selection text joined by a separator to the active register (default '"'). Mirrors :yank-join
func YankToClipboard ¶
YankToClipboard copies all selection text to the system clipboard
func YankToPrimaryClipboard ¶
YankToPrimaryClipboard copies all selections to the primary clipboard
Types ¶
type FindCharArgs ¶
FindCharArgs holds the parameters for a FindChar operation
type GotoTarget ¶
GotoTarget is the resolved target under the primary cursor
func GotoFileTarget ¶
func GotoFileTarget(e *view.Editor) (GotoTarget, error)
GotoFileTarget resolves the file or URL target under the primary cursor
type RunFormatterArgs ¶
type RunFormatterArgs struct {
Editor *view.Editor
Doc *view.Document
ViewID view.Id
Command string
Argv []string
}
RunFormatterArgs is a parameter bundle for RunFormatter
type SortSelectionsArgs ¶ added in v0.2.0
SortSelectionsArgs selects the sort order and whether case is ignored
type SurroundReplaceArgs ¶ added in v0.2.0
SurroundReplaceArgs names the surrounding pair to replace and the pair to replace it with, each identified by either of its brackets
type SystemClipboard ¶
type SystemClipboard struct {
// contains filtered or unexported fields
}
SystemClipboard talks to the OS clipboard via an external command, detected once at construction and reused for every read and write
func NewSystemClipboard ¶
func NewSystemClipboard() *SystemClipboard
NewSystemClipboard returns the host's clipboard provider
func (*SystemClipboard) Available ¶
func (c *SystemClipboard) Available() bool
Available reports whether the host offers a clipboard
func (*SystemClipboard) Read ¶
func (c *SystemClipboard) Read() (string, error)
Read returns the system clipboard contents
func (*SystemClipboard) ReadPrimary ¶
func (c *SystemClipboard) ReadPrimary() (string, error)
ReadPrimary returns the primary selection contents
func (*SystemClipboard) Write ¶
func (c *SystemClipboard) Write(text string) error
Write copies text to the system clipboard
func (*SystemClipboard) WritePrimary ¶
func (c *SystemClipboard) WritePrimary(text string) error
WritePrimary copies text to the primary selection
Source Files
¶
- buf-text.go
- buffer.go
- clipboard-provider.go
- clipboard.go
- clipboard_posix.go
- clipboard_unix.go
- edit-align.go
- edit-case.go
- edit-comment.go
- edit-delete-char.go
- edit-delete.go
- edit-increment.go
- edit-indent.go
- edit-insert-newline.go
- edit-insert.go
- edit-kill.go
- edit-line-ending.go
- edit-open.go
- edit-select-line.go
- edit-select.go
- edit-surround.go
- edit-tab.go
- edit-yank.go
- edit.go
- format-external.go
- mot-extend.go
- mot-file.go
- mot-findchar.go
- mot-paragraph.go
- mot-scroll.go
- motion.go
- open_external_linux.go
- osc52-clipboard.go
- search-match.go
- search.go
- sel-bounds.go
- sel-duplicate.go
- sel-filter.go
- sel-join.go
- sel-rotate.go
- sel-trim.go
- selection.go
- shell.go
- system-clipboard.go
- vcs.go
- view-mode.go
- view-split.go