Documentation ¶
Index ¶
- Constants
- Variables
- func BindKey(k, v string)
- func BufMapKey(k Event, action string)
- func BufMapMouse(k MouseEvent, action string)
- func CommandComplete(b *buffer.Buffer) ([]string, []string)
- func DefaultBindings() map[string]string
- func HelpComplete(b *buffer.Buffer) ([]string, []string)
- func InitBindings()
- func InitCommands()
- func InitGlobals()
- func InitTabs(bufs []*buffer.Buffer)
- func LuaAction(fn string) func(*BufPane) bool
- func LuaFunctionCommand(fn string) func(*BufPane, []string)
- func LuaMakeCommand(name, function string, completer buffer.Completer)
- func OpenLogBuf(h *BufPane)
- func OptionComplete(b *buffer.Buffer) ([]string, []string)
- func OptionValueComplete(b *buffer.Buffer) ([]string, []string)
- func PluginCmdComplete(b *buffer.Buffer) ([]string, []string)
- func PluginComplete(b *buffer.Buffer) ([]string, []string)
- func ReloadConfig()
- func RunTermEmulator(h *BufPane, input string, wait bool, getOutput bool, callback string, ...) error
- func SetGlobalOption(option, value string) error
- func SetGlobalOptionNative(option string, nativeValue interface{}) error
- func TryBindKey(k, v string, overwrite bool) (bool, error)
- func UnbindKey(k string) error
- func WriteLog(s string)
- type BufKeyAction
- type BufMouseAction
- type BufPane
- func (h *BufPane) AddTab() bool
- func (h *BufPane) Autocomplete() bool
- func (h *BufPane) Backspace() bool
- func (h *BufPane) BindCmd(args []string)
- func (h *BufPane) CdCmd(args []string)
- func (h *BufPane) Center() bool
- func (h *BufPane) ClearStatus() bool
- func (h *BufPane) Close()
- func (h *BufPane) CommandMode() bool
- func (h *BufPane) Copy() bool
- func (h *BufPane) CursorDown() bool
- func (h *BufPane) CursorEnd() bool
- func (h *BufPane) CursorLeft() bool
- func (h *BufPane) CursorPageDown() bool
- func (h *BufPane) CursorPageUp() bool
- func (h *BufPane) CursorRight() bool
- func (h *BufPane) CursorStart() bool
- func (h *BufPane) CursorUp() bool
- func (h *BufPane) Cut() bool
- func (h *BufPane) CutLine() bool
- func (h *BufPane) Delete() bool
- func (h *BufPane) DeleteLine() bool
- func (h *BufPane) DeleteWordLeft() bool
- func (h *BufPane) DeleteWordRight() bool
- func (h *BufPane) DoKeyEvent(e Event) bool
- func (h *BufPane) DoMouseEvent(e MouseEvent, te *tcell.EventMouse) bool
- func (h *BufPane) DoRuneInsert(r rune)
- func (h *BufPane) DuplicateLine() bool
- func (h *BufPane) End() bool
- func (h *BufPane) EndOfLine() bool
- func (h *BufPane) Escape() bool
- func (h *BufPane) EvalCmd(args []string)
- func (h *BufPane) Find() bool
- func (h *BufPane) FindNext() bool
- func (h *BufPane) FindPrevious() bool
- func (h *BufPane) GotoCmd(args []string)
- func (h *BufPane) HSplitAction() bool
- func (h *BufPane) HSplitBuf(buf *buffer.Buffer) *BufPane
- func (h *BufPane) HSplitCmd(args []string)
- func (h *BufPane) HalfPageDown() bool
- func (h *BufPane) HalfPageUp() bool
- func (h *BufPane) HandleCommand(input string)
- func (h *BufPane) HandleEvent(event tcell.Event)
- func (h *BufPane) HasKeyEvent(e Event) bool
- func (h *BufPane) HelpCmd(args []string)
- func (h *BufPane) ID() uint64
- func (h *BufPane) IndentSelection() bool
- func (h *BufPane) InsertNewline() bool
- func (h *BufPane) InsertTab() bool
- func (h *BufPane) JumpToMatchingBrace() bool
- func (h *BufPane) MemUsageCmd(args []string)
- func (h *BufPane) MouseMultiCursor(e *tcell.EventMouse) bool
- func (h *BufPane) MousePress(e *tcell.EventMouse) bool
- func (h *BufPane) MoveLinesDown() bool
- func (h *BufPane) MoveLinesUp() bool
- func (h *BufPane) Name() string
- func (h *BufPane) NewTabCmd(args []string)
- func (h *BufPane) NextSplit() bool
- func (h *BufPane) NextTab() bool
- func (h *BufPane) None() bool
- func (h *BufPane) OpenBuffer(b *buffer.Buffer)
- func (h *BufPane) OpenCmd(args []string)
- func (h *BufPane) OpenFile() bool
- func (h *BufPane) OutdentLine() bool
- func (h *BufPane) OutdentSelection() bool
- func (h *BufPane) PageDown() bool
- func (h *BufPane) PageUp() bool
- func (h *BufPane) ParagraphNext() bool
- func (h *BufPane) ParagraphPrevious() bool
- func (h *BufPane) Paste() bool
- func (h *BufPane) PastePrimary() bool
- func (h *BufPane) PlayMacro() bool
- func (h *BufPane) PluginCB(cb string) bool
- func (h *BufPane) PluginCBRune(cb string, r rune) bool
- func (h *BufPane) PluginCmd(args []string)
- func (h *BufPane) PreviousSplit() bool
- func (h *BufPane) PreviousTab() bool
- func (h *BufPane) PwdCmd(args []string)
- func (h *BufPane) Quit() bool
- func (h *BufPane) QuitAll() bool
- func (h *BufPane) QuitCmd(args []string)
- func (h *BufPane) RawCmd(args []string)
- func (h *BufPane) Redo() bool
- func (h *BufPane) ReloadCmd(args []string)
- func (h *BufPane) RemoveAllMultiCursors() bool
- func (h *BufPane) RemoveMultiCursor() bool
- func (h *BufPane) ReopenCmd(args []string)
- func (h *BufPane) ReplaceAllCmd(args []string)
- func (h *BufPane) ReplaceCmd(args []string)
- func (h *BufPane) ResetCmd(args []string)
- func (h *BufPane) Retab() bool
- func (h *BufPane) RetabCmd(args []string)
- func (h *BufPane) RunCmd(args []string)
- func (h *BufPane) Save() bool
- func (h *BufPane) SaveAll() bool
- func (h *BufPane) SaveAs() bool
- func (h *BufPane) SaveCmd(args []string)
- func (h *BufPane) ScrollDown(n int)
- func (h *BufPane) ScrollDownAction() bool
- func (h *BufPane) ScrollUp(n int)
- func (h *BufPane) ScrollUpAction() bool
- func (h *BufPane) SelectAll() bool
- func (h *BufPane) SelectDown() bool
- func (h *BufPane) SelectLeft() bool
- func (h *BufPane) SelectLine() bool
- func (h *BufPane) SelectPageDown() bool
- func (h *BufPane) SelectPageUp() bool
- func (h *BufPane) SelectRight() bool
- func (h *BufPane) SelectToEnd() bool
- func (h *BufPane) SelectToEndOfLine() bool
- func (h *BufPane) SelectToStart() bool
- func (h *BufPane) SelectToStartOfLine() bool
- func (h *BufPane) SelectUp() bool
- func (h *BufPane) SelectWordLeft() bool
- func (h *BufPane) SelectWordRight() bool
- func (h *BufPane) SetActive(b bool)
- func (h *BufPane) SetCmd(args []string)
- func (h *BufPane) SetID(i uint64)
- func (h *BufPane) SetLocalCmd(args []string)
- func (h *BufPane) ShellMode() bool
- func (h *BufPane) ShowCmd(args []string)
- func (h *BufPane) ShowKeyCmd(args []string)
- func (h *BufPane) SkipMultiCursor() bool
- func (h *BufPane) SpawnMultiCursor() bool
- func (h *BufPane) SpawnMultiCursorSelect() bool
- func (h *BufPane) Start() bool
- func (h *BufPane) StartOfLine() bool
- func (*BufPane) Suspend() bool
- func (h *BufPane) TabSwitchCmd(args []string)
- func (h *BufPane) TermCmd(args []string)
- func (h *BufPane) TextFilterCmd(args []string)
- func (h *BufPane) ToggleHelp() bool
- func (h *BufPane) ToggleKeyMenu() bool
- func (h *BufPane) ToggleLogCmd(args []string)
- func (h *BufPane) ToggleMacro() bool
- func (h *BufPane) ToggleOverwriteMode() bool
- func (h *BufPane) ToggleRuler() bool
- func (h *BufPane) UnbindCmd(args []string)
- func (h *BufPane) Undo() bool
- func (h *BufPane) Unsplit() bool
- func (h *BufPane) VSplitAction() bool
- func (h *BufPane) VSplitBuf(buf *buffer.Buffer) *BufPane
- func (h *BufPane) VSplitCmd(args []string)
- func (h *BufPane) WordLeft() bool
- func (h *BufPane) WordRight() bool
- type Command
- type Event
- type Handler
- type InfoKeyAction
- type InfoPane
- func (h *InfoPane) Autocomplete()
- func (h *InfoPane) Close()
- func (h *InfoPane) CursorDown()
- func (h *InfoPane) CursorUp()
- func (h *InfoPane) CycleBack()
- func (h *InfoPane) DoKeyEvent(e KeyEvent) bool
- func (h *InfoPane) Escape()
- func (h *InfoPane) HandleEvent(event tcell.Event)
- func (h *InfoPane) InsertNewline()
- func (h *InfoPane) Quit()
- func (h *InfoPane) QuitAll()
- type KeyAction
- type KeyEvent
- type MouseAction
- type MouseEvent
- type Pane
- type RawEvent
- type RawPane
- type Tab
- type TabList
- type TermPane
Constants ¶
const TermEmuSupported = true
Variables ¶
var BufKeyActions = map[string]BufKeyAction{ "CursorUp": (*BufPane).CursorUp, "CursorDown": (*BufPane).CursorDown, "CursorPageUp": (*BufPane).CursorPageUp, "CursorPageDown": (*BufPane).CursorPageDown, "CursorLeft": (*BufPane).CursorLeft, "CursorRight": (*BufPane).CursorRight, "CursorStart": (*BufPane).CursorStart, "CursorEnd": (*BufPane).CursorEnd, "SelectToStart": (*BufPane).SelectToStart, "SelectToEnd": (*BufPane).SelectToEnd, "SelectUp": (*BufPane).SelectUp, "SelectDown": (*BufPane).SelectDown, "SelectLeft": (*BufPane).SelectLeft, "SelectRight": (*BufPane).SelectRight, "WordRight": (*BufPane).WordRight, "WordLeft": (*BufPane).WordLeft, "SelectWordRight": (*BufPane).SelectWordRight, "SelectWordLeft": (*BufPane).SelectWordLeft, "DeleteWordRight": (*BufPane).DeleteWordRight, "DeleteWordLeft": (*BufPane).DeleteWordLeft, "SelectLine": (*BufPane).SelectLine, "SelectToStartOfLine": (*BufPane).SelectToStartOfLine, "SelectToEndOfLine": (*BufPane).SelectToEndOfLine, "ParagraphPrevious": (*BufPane).ParagraphPrevious, "ParagraphNext": (*BufPane).ParagraphNext, "InsertNewline": (*BufPane).InsertNewline, "Backspace": (*BufPane).Backspace, "Delete": (*BufPane).Delete, "InsertTab": (*BufPane).InsertTab, "Save": (*BufPane).Save, "SaveAll": (*BufPane).SaveAll, "SaveAs": (*BufPane).SaveAs, "Find": (*BufPane).Find, "FindNext": (*BufPane).FindNext, "FindPrevious": (*BufPane).FindPrevious, "Center": (*BufPane).Center, "Undo": (*BufPane).Undo, "Redo": (*BufPane).Redo, "Copy": (*BufPane).Copy, "Cut": (*BufPane).Cut, "CutLine": (*BufPane).CutLine, "DuplicateLine": (*BufPane).DuplicateLine, "DeleteLine": (*BufPane).DeleteLine, "MoveLinesUp": (*BufPane).MoveLinesUp, "MoveLinesDown": (*BufPane).MoveLinesDown, "IndentSelection": (*BufPane).IndentSelection, "OutdentSelection": (*BufPane).OutdentSelection, "Autocomplete": (*BufPane).Autocomplete, "OutdentLine": (*BufPane).OutdentLine, "Paste": (*BufPane).Paste, "PastePrimary": (*BufPane).PastePrimary, "SelectAll": (*BufPane).SelectAll, "OpenFile": (*BufPane).OpenFile, "Start": (*BufPane).Start, "End": (*BufPane).End, "PageUp": (*BufPane).PageUp, "PageDown": (*BufPane).PageDown, "SelectPageUp": (*BufPane).SelectPageUp, "SelectPageDown": (*BufPane).SelectPageDown, "HalfPageUp": (*BufPane).HalfPageUp, "HalfPageDown": (*BufPane).HalfPageDown, "StartOfLine": (*BufPane).StartOfLine, "EndOfLine": (*BufPane).EndOfLine, "ToggleHelp": (*BufPane).ToggleHelp, "ToggleKeyMenu": (*BufPane).ToggleKeyMenu, "ToggleRuler": (*BufPane).ToggleRuler, "ClearStatus": (*BufPane).ClearStatus, "ShellMode": (*BufPane).ShellMode, "CommandMode": (*BufPane).CommandMode, "ToggleOverwriteMode": (*BufPane).ToggleOverwriteMode, "Escape": (*BufPane).Escape, "Quit": (*BufPane).Quit, "QuitAll": (*BufPane).QuitAll, "AddTab": (*BufPane).AddTab, "PreviousTab": (*BufPane).PreviousTab, "NextTab": (*BufPane).NextTab, "NextSplit": (*BufPane).NextSplit, "PreviousSplit": (*BufPane).PreviousSplit, "Unsplit": (*BufPane).Unsplit, "VSplit": (*BufPane).VSplitAction, "HSplit": (*BufPane).HSplitAction, "ToggleMacro": (*BufPane).ToggleMacro, "PlayMacro": (*BufPane).PlayMacro, "Suspend": (*BufPane).Suspend, "ScrollUp": (*BufPane).ScrollUpAction, "ScrollDown": (*BufPane).ScrollDownAction, "SpawnMultiCursor": (*BufPane).SpawnMultiCursor, "SpawnMultiCursorSelect": (*BufPane).SpawnMultiCursorSelect, "RemoveMultiCursor": (*BufPane).RemoveMultiCursor, "RemoveAllMultiCursors": (*BufPane).RemoveAllMultiCursors, "SkipMultiCursor": (*BufPane).SkipMultiCursor, "JumpToMatchingBrace": (*BufPane).JumpToMatchingBrace, "None": (*BufPane).None, "InsertEnter": (*BufPane).InsertNewline, }
BufKeyActions contains the list of all possible key actions the bufhandler could execute
var BufKeyBindings map[Event]BufKeyAction
var BufKeyStrings map[Event]string
var BufMouseActions = map[string]BufMouseAction{ "MousePress": (*BufPane).MousePress, "MouseMultiCursor": (*BufPane).MouseMultiCursor, }
BufMouseActions contains the list of all possible mouse actions the bufhandler could execute
var BufMouseBindings map[MouseEvent]BufMouseAction
var InfoNones = []string{
"Save",
"SaveAll",
"SaveAs",
"Find",
"FindNext",
"FindPrevious",
"Center",
"DuplicateLine",
"MoveLinesUp",
"MoveLinesDown",
"OpenFile",
"Start",
"End",
"PageUp",
"PageDown",
"SelectPageUp",
"SelectPageDown",
"HalfPageUp",
"HalfPageDown",
"ToggleHelp",
"ToggleKeyMenu",
"ToggleRuler",
"JumpLine",
"ClearStatus",
"ShellMode",
"CommandMode",
"AddTab",
"PreviousTab",
"NextTab",
"NextSplit",
"PreviousSplit",
"Unsplit",
"VSplit",
"HSplit",
"ToggleMacro",
"PlayMacro",
"Suspend",
"ScrollUp",
"ScrollDown",
"SpawnMultiCursor",
"SpawnMultiCursorSelect",
"RemoveMultiCursor",
"RemoveAllMultiCursors",
"SkipMultiCursor",
}
InfoNones is a list of actions that should have no effect when executed by an infohandler
var InfoOverrides = map[string]InfoKeyAction{ "CursorUp": (*InfoPane).CursorUp, "CursorDown": (*InfoPane).CursorDown, "InsertNewline": (*InfoPane).InsertNewline, "Autocomplete": (*InfoPane).Autocomplete, "OutdentLine": (*InfoPane).CycleBack, "Escape": (*InfoPane).Escape, "Quit": (*InfoPane).Quit, "QuitAll": (*InfoPane).QuitAll, }
InfoOverrides is the list of actions which have been overridden by the infohandler
var MultiActions = map[string]bool{ "CursorUp": true, "CursorDown": true, "CursorPageUp": true, "CursorPageDown": true, "CursorLeft": true, "CursorRight": true, "CursorStart": true, "CursorEnd": true, "SelectToStart": true, "SelectToEnd": true, "SelectUp": true, "SelectDown": true, "SelectLeft": true, "SelectRight": true, "WordRight": true, "WordLeft": true, "SelectWordRight": true, "SelectWordLeft": true, "DeleteWordRight": true, "DeleteWordLeft": true, "SelectLine": true, "SelectToStartOfLine": true, "SelectToEndOfLine": true, "ParagraphPrevious": true, "ParagraphNext": true, "InsertNewline": true, "Backspace": true, "Delete": true, "InsertTab": true, "FindNext": true, "FindPrevious": true, "Cut": true, "CutLine": true, "DuplicateLine": true, "DeleteLine": true, "MoveLinesUp": true, "MoveLinesDown": true, "IndentSelection": true, "OutdentSelection": true, "OutdentLine": true, "Paste": true, "PastePrimary": true, "SelectPageUp": true, "SelectPageDown": true, "StartOfLine": true, "EndOfLine": true, "JumpToMatchingBrace": true, }
MultiActions is a list of actions that should be executed multiple times if there are multiple cursors (one per cursor) Generally actions that modify global editor state like quitting or saving should not be included in this list
var PluginCmds = []string{"list", "info", "version"}
Functions ¶
func BufMapMouse ¶
func BufMapMouse(k MouseEvent, action string)
BufMapMouse maps a mouse event to an action
func CommandComplete ¶
CommandComplete autocompletes commands
func DefaultBindings ¶
DefaultBindings returns a map containing micro's default keybindings
func HelpComplete ¶
HelpComplete autocompletes help topics
func InitBindings ¶
func InitBindings()
func InitCommands ¶
func InitCommands()
func InitGlobals ¶
func InitGlobals()
func LuaFunctionCommand ¶
LuaFunctionCommand returns a normal function so that a command can be bound to a lua function
func LuaMakeCommand ¶
MakeCommand is a function to easily create new commands This can be called by plugins in Lua so that plugins can define their own commands
func OpenLogBuf ¶
func OpenLogBuf(h *BufPane)
func OptionComplete ¶
OptionComplete autocompletes options
func OptionValueComplete ¶
OptionValueComplete completes values for various options
func PluginCmdComplete ¶
OptionComplete autocompletes options
func PluginComplete ¶
PluginComplete completes values for the plugin command
func ReloadConfig ¶
func ReloadConfig()
func RunTermEmulator ¶
func SetGlobalOption ¶
func SetGlobalOptionNative ¶
func TryBindKey ¶
TryBindKey tries to bind a key by writing to config.ConfigDir/bindings.json Returns true if the keybinding already existed and a possible error
Types ¶
type BufKeyAction ¶
func CommandAction ¶
func CommandAction(cmd string) BufKeyAction
CommandAction returns a bindable function which executes the given command
func CommandEditAction ¶
func CommandEditAction(prompt string) BufKeyAction
CommandEditAction returns a bindable function that opens a prompt with the given string and executes the command when the user presses enter
type BufMouseAction ¶
type BufMouseAction func(*BufPane, *tcell.EventMouse) bool
type BufPane ¶
type BufPane struct { display.BWindow Buf *buffer.Buffer Cursor *buffer.Cursor // the active cursor // contains filtered or unexported fields }
The BufPane connects the buffer and the window It provides a cursor (or multiple) and defines a set of actions that can be taken on the buffer The ActionHandler can access the window for necessary info about visual positions for mouse clicks and scrolling
var LogBufPane *BufPane
func NewBufPaneFromBuf ¶
func (*BufPane) Autocomplete ¶
Autocomplete cycles the suggestions and performs autocompletion if there are suggestions
func (*BufPane) ClearStatus ¶
ClearStatus clears the messenger bar
func (*BufPane) CommandMode ¶
CommandMode lets the user enter a command
func (*BufPane) CursorPageDown ¶
CursorPageDown places the cursor a page up
func (*BufPane) CursorPageUp ¶
CursorPageUp places the cursor a page up
func (*BufPane) CursorRight ¶
CursorRight moves the cursor right
func (*BufPane) CursorStart ¶
CursorStart moves the cursor to the start of the buffer
func (*BufPane) DeleteLine ¶
DeleteLine deletes the current line
func (*BufPane) DeleteWordLeft ¶
DeleteWordLeft deletes the word to the left of the cursor
func (*BufPane) DeleteWordRight ¶
DeleteWordRight deletes the word to the right of the cursor
func (*BufPane) DoKeyEvent ¶
DoKeyEvent executes a key event by finding the action it is bound to and executing it (possibly multiple times for multiple cursors)
func (*BufPane) DoMouseEvent ¶
func (h *BufPane) DoMouseEvent(e MouseEvent, te *tcell.EventMouse) bool
DoMouseEvent executes a mouse event by finding the action it is bound to and executing it
func (*BufPane) DoRuneInsert ¶
DoRuneInsert inserts a given rune into the current buffer (possibly multiple times for multiple cursors)
func (*BufPane) DuplicateLine ¶
DuplicateLine duplicates the current line or selection
func (*BufPane) FindPrevious ¶
FindPrevious searches backwards for the last used search term
func (*BufPane) GotoCmd ¶
GotoCmd is a command that will send the cursor to a certain position in the buffer For example: `goto line`, or `goto line:col`
func (*BufPane) HSplitAction ¶
HSplitAction opens an empty horizontal split
func (*BufPane) HSplitCmd ¶
HSplitCmd opens a horizontal split with file given in the first argument If no file is given, it opens an empty buffer in a new split
func (*BufPane) HalfPageDown ¶
HalfPageDown scrolls the view down half a page
func (*BufPane) HalfPageUp ¶
HalfPageUp scrolls the view up half a page
func (*BufPane) HandleCommand ¶
HandleCommand handles input from the user
func (*BufPane) HandleEvent ¶
HandleEvent executes the tcell event properly
func (*BufPane) HasKeyEvent ¶
func (*BufPane) IndentSelection ¶
IndentSelection indents the current selection
func (*BufPane) InsertNewline ¶
InsertNewline inserts a newline plus possible some whitespace if autoindent is on
func (*BufPane) JumpToMatchingBrace ¶
JumpToMatchingBrace moves the cursor to the matching brace if it is currently on a brace
func (*BufPane) MemUsageCmd ¶
MemUsageCmd prints micro's memory usage Alloc shows how many bytes are currently in use Sys shows how many bytes have been requested from the operating system NumGC shows how many times the GC has been run Note that Go commonly reserves more memory from the OS than is currently in-use/required Additionally, even if Go returns memory to the OS, the OS does not always claim it because there may be plenty of memory to spare
func (*BufPane) MouseMultiCursor ¶
func (h *BufPane) MouseMultiCursor(e *tcell.EventMouse) bool
MouseMultiCursor is a mouse action which puts a new cursor at the mouse position
func (*BufPane) MousePress ¶
func (h *BufPane) MousePress(e *tcell.EventMouse) bool
MousePress is the event that should happen when a normal click happens This is almost always bound to left click
func (*BufPane) MoveLinesDown ¶
MoveLinesDown moves down the current line or selected lines if any
func (*BufPane) MoveLinesUp ¶
MoveLinesUp moves up the current line or selected lines if any
func (*BufPane) OpenBuffer ¶
func (*BufPane) OutdentLine ¶
OutdentLine moves the current line back one indentation
func (*BufPane) OutdentSelection ¶
OutdentSelection takes the current selection and moves it back one indent level
func (*BufPane) ParagraphNext ¶
ParagraphNext moves the cursor to the next empty line, or end of the buffer if there's none
func (*BufPane) ParagraphPrevious ¶
ParagraphPrevious moves the cursor to the previous empty line, or beginning of the buffer if there's none
func (*BufPane) Paste ¶
Paste whatever is in the system clipboard into the buffer Delete and paste if the user has a selection
func (*BufPane) PastePrimary ¶
PastePrimary pastes from the primary clipboard (only use on linux)
func (*BufPane) PluginCB ¶
PluginCB calls all plugin callbacks with a certain name and displays an error if there is one and returns the aggregrate boolean response
func (*BufPane) PluginCBRune ¶
PluginCBRune is the same as PluginCB but also passes a rune to the plugins
func (*BufPane) PluginCmd ¶
PluginCmd installs, removes, updates, lists, or searches for given plugins
func (*BufPane) PreviousSplit ¶
PreviousSplit changes the view to the previous split
func (*BufPane) PreviousTab ¶
PreviousTab switches to the previous tab in the tab list
func (*BufPane) RawCmd ¶
RawCmd opens a new raw view which displays the escape sequences micro is receiving in real-time
func (*BufPane) RemoveAllMultiCursors ¶
RemoveAllMultiCursors removes all cursors except the base cursor
func (*BufPane) RemoveMultiCursor ¶
RemoveMultiCursor removes the latest multiple cursor
func (*BufPane) ReplaceAllCmd ¶
ReplaceAllCmd replaces search term all at once
func (*BufPane) ReplaceCmd ¶
ReplaceCmd runs search and replace
func (*BufPane) Retab ¶
Retab changes all tabs to spaces or all spaces to tabs depending on the user's settings
func (*BufPane) RetabCmd ¶
RetabCmd changes all spaces to tabs or all tabs to spaces depending on the user's settings
func (*BufPane) ScrollDownAction ¶
ScrollDownAction scrolls the view up
func (*BufPane) ScrollUpAction ¶
ScrollUpAction scrolls the view up
func (*BufPane) SelectLeft ¶
SelectLeft selects the character to the left of the cursor
func (*BufPane) SelectLine ¶
SelectLine selects the entire current line
func (*BufPane) SelectPageDown ¶
SelectPageDown selects down one page
func (*BufPane) SelectPageUp ¶
SelectPageUp selects up one page
func (*BufPane) SelectRight ¶
SelectRight selects the character to the right of the cursor
func (*BufPane) SelectToEnd ¶
SelectToEnd selects the text from the cursor to the end of the buffer
func (*BufPane) SelectToEndOfLine ¶
SelectToEndOfLine selects to the end of the current line
func (*BufPane) SelectToStart ¶
SelectToStart selects the text from the cursor to the start of the buffer
func (*BufPane) SelectToStartOfLine ¶
SelectToStartOfLine selects to the start of the current line
func (*BufPane) SelectWordLeft ¶
SelectWordLeft selects the word to the left of the cursor
func (*BufPane) SelectWordRight ¶
SelectWordRight selects the word to the right of the cursor
func (*BufPane) SetLocalCmd ¶
SetLocalCmd sets an option local to the buffer
func (*BufPane) ShowKeyCmd ¶
ShowKeyCmd displays the action that a key is bound to
func (*BufPane) SkipMultiCursor ¶
SkipMultiCursor moves the current multiple cursor to the next available position
func (*BufPane) SpawnMultiCursor ¶
SpawnMultiCursor creates a new multiple cursor at the next occurrence of the current selection or current word
func (*BufPane) SpawnMultiCursorSelect ¶
SpawnMultiCursorSelect adds a cursor at the beginning of each line of a selection
func (*BufPane) StartOfLine ¶
StartOfLine moves the cursor to the start of the line
func (*BufPane) Suspend ¶
Suspend sends micro to the background. This is the same as pressing CtrlZ in most unix programs. This only works on linux and has no default binding. This code was adapted from the suspend code in nsf/godit
func (*BufPane) TabSwitchCmd ¶
TabSwitchCmd switches to a given tab either by name or by number
func (*BufPane) TextFilterCmd ¶
TextFilterCmd filters the selection through the command. Selection goes to the command input. On successful run command output replaces the current selection.
func (*BufPane) ToggleKeyMenu ¶
ToggleKeyMenu toggles the keymenu option and resizes all tabs
func (*BufPane) ToggleLogCmd ¶
ToggleLogCmd toggles the log view
func (*BufPane) ToggleMacro ¶
ToggleMacro toggles recording of a macro
func (*BufPane) ToggleOverwriteMode ¶
ToggleOverwriteMode lets the user toggle the text overwrite mode
func (*BufPane) ToggleRuler ¶
ToggleRuler turns line numbers off and on
func (*BufPane) VSplitAction ¶
VSplitAction opens an empty vertical split
func (*BufPane) VSplitCmd ¶
VSplitCmd opens a vertical split with file given in the first argument If no file is given, it opens an empty buffer in a new split
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
A Command contains information about how to execute a command It has the action for that command as well as a completer function
type InfoKeyAction ¶
type InfoKeyAction func(*InfoPane)
type InfoPane ¶
var InfoBar *InfoPane
func GetInfoBar ¶
func GetInfoBar() *InfoPane
func NewInfoBar ¶
func NewInfoBar() *InfoPane
func (*InfoPane) Autocomplete ¶
func (h *InfoPane) Autocomplete()
Autocomplete begins autocompletion
func (*InfoPane) CycleBack ¶
func (h *InfoPane) CycleBack()
CycleBack cycles back in the autocomplete suggestion list
func (*InfoPane) DoKeyEvent ¶
func (*InfoPane) HandleEvent ¶
func (*InfoPane) InsertNewline ¶
func (h *InfoPane) InsertNewline()
InsertNewline completes the prompt
type KeyEvent ¶
type KeyEvent struct {
// contains filtered or unexported fields
}
KeyEvent is a key event containing a key code, some possible modifiers (alt, ctrl, etc...) and a rune if it was simply a character press Note: to be compatible with tcell events, for ctrl keys r=code
type MouseAction ¶
type MouseAction func(Handler, tcell.EventMouse) bool
type MouseEvent ¶
type MouseEvent struct {
// contains filtered or unexported fields
}
MouseEvent is a mouse event with a mouse button and any possible key modifiers
type RawEvent ¶
type RawEvent struct {
// contains filtered or unexported fields
}
RawEvent is simply an escape code We allow users to directly bind escape codes to get around some of a limitations of terminals
type RawPane ¶
type RawPane struct {
*BufPane
}
func NewRawPane ¶
func NewRawPane() *RawPane
func (*RawPane) HandleEvent ¶
type Tab ¶
type Tab struct { *views.Node *display.UIWindow Panes []Pane // contains filtered or unexported fields }
A Tab represents a single tab It consists of a list of edit panes (the open buffers), a split tree (stored as just the root node), and a uiwindow to display the UI elements like the borders between splits
func NewTabFromBuffer ¶
NewTabFromBuffer creates a new tab from the given buffer
func NewTabFromPane ¶
func (*Tab) HandleEvent ¶
HandleEvent takes a tcell event and usually dispatches it to the current active pane. However if the event is a resize or a mouse event where the user is interacting with the UI (resizing splits) then the event is consumed here If the event is a mouse event in a pane, that pane will become active and get the event
func (*Tab) RemovePane ¶
Remove pane removes the pane with the given index
type TabList ¶
The TabList is a list of tabs and a window to display the tab bar at the top of the screen
var Tabs *TabList
Tabs is the global tab list
func NewTabList ¶
NewTabList creates a TabList from a list of buffers by creating a Tab for each buffer
func (*TabList) Display ¶
func (t *TabList) Display()
Display updates the names and then displays the tab bar
func (*TabList) HandleEvent ¶
HandleEvent checks for a resize event or a mouse event on the tab bar otherwise it will forward the event to the currently active tab
func (*TabList) Resize ¶
func (t *TabList) Resize()
Resize resizes all elements within the tab list One thing to note is that when there is only 1 tab the tab bar should not be drawn so resizing must take that into account
func (*TabList) UpdateNames ¶
func (t *TabList) UpdateNames()
UpdateNames makes sure that the list of names the tab window has access to is correct
type TermPane ¶
func (*TermPane) HandleCommand ¶
func (*TermPane) HandleEvent ¶
HandleEvent handles a tcell event by forwarding it to the terminal emulator If the event is a mouse event and the program running in the emulator does not have mouse support, the emulator will support selections and copy-paste