Documentation ¶
Overview ¶
This package implements a couple of standard commands available to the editor.
Typically the package is imported by a frontend via
import ( _ "github.com/jxo/lime/commands" )
See the wiki page for more details on implementing commands: https://github.com/limetext/lime/wiki/Implementing-commands
Index ¶
- type Close
- type CloseAll
- type CloseFolderList
- type CloseProject
- type CloseWindow
- type CloseWindowApp
- type Copy
- type Cut
- type DecreaseFontSize
- type DeleteWord
- type DuplicateLine
- type FindAll
- type FindNext
- type FindUnderExpand
- type GlueMarkedUndoGroups
- type IncreaseFontSize
- type Indent
- type Insert
- type JoinLines
- type LeftDelete
- type LowerCase
- type MarkUndoGroupsForGluing
- type MaybeMarkUndoGroupsForGluing
- type Move
- type MoveByType
- type MoveTo
- type MoveToType
- type NewFile
- type NewWindow
- type NewWindowApp
- type NextView
- type NopApplication
- type NopText
- type NopWindow
- type Paste
- type PrevView
- type PromptAddFolder
- type PromptOpenFile
- type PromptOpenProject
- type PromptSaveAs
- type Redo
- type ReplaceAll
- type ReplaceNext
- type RightDelete
- type Save
- type SaveAll
- type SaveProjectAs
- type ScrollLines
- type SelectAll
- type SelectLines
- type SetFileType
- type SetSetting
- type SingleSelection
- type SortLines
- type SortSelection
- type SplitSelectionIntoLines
- type SwapCase
- type SwapLineDown
- type SwapLineUp
- type TitleCase
- type ToggleComment
- type ToggleDistractionFree
- type ToggleFullScreen
- type ToggleMinimap
- type ToggleSetting
- type ToggleSideBar
- type ToggleStatusBar
- type ToggleTabs
- type Transpose
- type Undo
- type Unindent
- type UnmarkUndoGroupsForGluing
- type UpperCase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Close ¶
type Close struct {
lime.DefaultCommand
}
Close command closes the currently opened view.
type CloseAll ¶
type CloseAll struct {
lime.DefaultCommand
}
CloseAll command closes all the open views inside the current window.
type CloseFolderList ¶
type CloseFolderList struct {
lime.DefaultCommand
}
CloseFolderList removes the folder list from the opened project.
type CloseProject ¶
type CloseProject struct {
lime.DefaultCommand
}
CloseProject command enables us to close an existing open project.
type CloseWindow ¶
type CloseWindow struct {
lime.DefaultCommand
}
CloseWindow command lets us close the current window.
type CloseWindowApp ¶
type CloseWindowApp struct {
lime.DefaultCommand
}
CloseWindowApp command closes all the active windows.
func (*CloseWindowApp) IsChecked ¶
func (c *CloseWindowApp) IsChecked() bool
IsChecked shows if CloseWindowApp has a checkbox in the frontend.
func (*CloseWindowApp) Run ¶
func (c *CloseWindowApp) Run() error
Run executes the CloseWindowApp command.
type Copy ¶
type Copy struct {
lime.DefaultCommand
}
Copy copies the current selection to the clipboard. If there are multiple selections, they are concatenated in order from top to bottom of the file, separated by newlines
type Cut ¶
type Cut struct {
lime.DefaultCommand
}
Cut copies the current selection to the clipboard, removing it from the buffer. If there are multiple selections, they are concatenated in order from top to bottom of the file, separated by newlines.
type DecreaseFontSize ¶
type DecreaseFontSize struct {
lime.DefaultCommand
}
DecreaseFontSize command decreases the font size by 1.
type DeleteWord ¶
type DeleteWord struct { lime.DefaultCommand Forward bool }
DeleteWord Command deletes one word to right or left depending on forward variable.
type DuplicateLine ¶
type DuplicateLine struct {
lime.DefaultCommand
}
Duplicate copies all of the current selections, inserting each copy before the original. If any of the selections are empty, instead, the entire line containing that cursor is copied and inserted before the original.
type FindAll ¶
type FindAll struct { lime.DefaultCommand SearchText []rune }
type FindNext ¶
type FindNext struct {
lime.DefaultCommand
}
FindNext command searches for the last search term, starting at the end of the last selection in the buffer, and wrapping around. If it finds the term, it clears the current selections and selects the newly-found regions.
type FindUnderExpand ¶
type FindUnderExpand struct {
lime.DefaultCommand
}
FindUnderExpand Command extends the selection to the current word if the current selection region is empty. If one character or more is selected, the text buffer is scanned for the next occurrence of the selection and that region too is added to the selection set.
type GlueMarkedUndoGroups ¶
type GlueMarkedUndoGroups struct {
lime.BypassUndoCommand
}
GlueMarkedUndoGroups Command merges commands from the previously marked undo stack location to the current location into a single entry in the undo stack.
type IncreaseFontSize ¶
type IncreaseFontSize struct {
lime.DefaultCommand
}
IncreaseFontSize command increases the font size by 1.
type Indent ¶
type Indent struct {
lime.DefaultCommand
}
Indent Command increments indentation of selection.
type Insert ¶
type Insert struct { lime.DefaultCommand // The characters to insert Characters string }
Insert Command inserts the given characters, at all of the current selection locations, possibly replacing text if the selection area covers one or more characters.
type JoinLines ¶
type JoinLines struct {
lime.DefaultCommand
}
JoinLines removes every new line in the selections and the first new line after.
type LeftDelete ¶
type LeftDelete struct {
lime.DefaultCommand
}
LeftDelete Command deletes characters to the left of the current selection or the current selection if it is not empty.
type LowerCase ¶
type LowerCase struct {
lime.DefaultCommand
}
LowerCase Command transforms all selections so that each character in the selection is in its lower case equivalent.
type MarkUndoGroupsForGluing ¶
type MarkUndoGroupsForGluing struct {
lime.BypassUndoCommand
}
MarkUndoGroupsForGluing Command marks the current position in the undo stack as the start of commands to glue, potentially overwriting any existing marks.
type MaybeMarkUndoGroupsForGluing ¶
type MaybeMarkUndoGroupsForGluing struct {
lime.BypassUndoCommand
}
MaybeMarkUndoGroupsForGluing Command is similar to MarkUndoGroupsForGluingCommand with the exception that if there is already a mark set, it is not overwritten.
type Move ¶
type Move struct { lime.DefaultCommand // Specifies the type of "move" operation. By MoveByType // Whether the current selection should be extended or not. Extend bool // Whether to move forward or backwards. Forward bool // Used together with By=Stops, extends "word_separators" defined by settings. Separators string // Used together with By=Stops, go to word begin. WordBegin bool // Used together with By=Stops, go to word end. WordEnd bool // Used together with By=Stops, go to punctuation begin. PunctBegin bool // Used together with By=Stops, go to punctuation end. PunctEnd bool // Used together with By=Stops, go to an empty line. EmptyLine bool // Used together with By=Stops, TODO: ??? ClipToLine bool }
Move Command moves the current selection.
type MoveByType ¶
type MoveByType int
MoveByType Specifies the type of "move" operation.
const ( // Characters by Characters. Characters MoveByType = iota // Stops will move by Stops (TODO(.): what exactly is a stop?). Stops // Lines will move by Lines. Lines // Words will move by Words. Words // WordEnds will move by Word Ends. WordEnds // SubWords will move by Sub Words. SubWords // SubWordEnds will Move by Sub Word Ends. SubWordEnds // Pages will move by Page. Pages )
type MoveTo ¶
type MoveTo struct { lime.DefaultCommand // The type of "move_to" operation to perform. To MoveToType // Whether the current selection should be extended or not. Extend bool }
MoveTo Command moves or extends the current selection to the specified location.
type MoveToType ¶
type MoveToType int
MoveToType Specifies the type of "move_to" operation to perform.
const ( // BOL is Beginning of line. BOL MoveToType = iota // EOL is End of line EOL //BOF is Beginning of file. BOF // EOF is End of file. EOF // Brackets >-> Current level close bracket. Brackets )
func (*MoveToType) Set ¶
func (mt *MoveToType) Set(v interface{}) error
Set will define the type of move
type NewWindow ¶
type NewWindow struct {
lime.DefaultCommand
}
NewWindow command opens a new window.
type NewWindowApp ¶
type NewWindowApp struct {
lime.DefaultCommand
}
NewWindowApp creates a new window, setting it as active.
func (*NewWindowApp) IsChecked ¶
func (c *NewWindowApp) IsChecked() bool
IsChecked shows if NewWindowApp has a checkbox in the frontend.
func (*NewWindowApp) Run ¶
func (c *NewWindowApp) Run() error
Run executes the NewWindowApp command.
type NextView ¶
type NextView struct {
lime.DefaultCommand
}
NextView command switches to the view which is immediately to the next of the current view.
type NopApplication ¶
type NopApplication struct {
lime.BypassUndoCommand
}
NopApplication performs NOP.
func (*NopApplication) IsChecked ¶
func (c *NopApplication) IsChecked() bool
IsChecked represents if the command contains a checkbox in the frontend
func (*NopApplication) Run ¶
func (c *NopApplication) Run() error
Run executes the NopApplication command.
type Paste ¶
type Paste struct {
lime.DefaultCommand
}
Paste pastes the contents of the clipboard, overwriting the current selection, if any. If there are multiple selections, the clipboard is split into lines. If the number of lines equals the number of selections, the lines are pasted separately into each selection in order from top to bottom of the file. Otherwise the entire clipboard is pasted over every selection.
type PrevView ¶
type PrevView struct {
lime.DefaultCommand
}
PrevView command switches to the view which is immediately before hte current view.
type PromptAddFolder ¶
type PromptAddFolder struct {
lime.DefaultCommand
}
PromptAddFolder adds a folder to the existing opened project.
type PromptOpenFile ¶
type PromptOpenFile struct {
lime.DefaultCommand
}
PromptOpenFile command prompts opening an existing file from the filesystem.
type PromptOpenProject ¶
type PromptOpenProject struct {
lime.DefaultCommand
}
PromptOpenProject command enables us to open the project file saved using the SaveProjectAs command.
type PromptSaveAs ¶
type PromptSaveAs struct {
lime.DefaultCommand
}
PromptSaveAs command lets us save the currently active file with a different name.
type Redo ¶
type Redo struct { lime.BypassUndoCommand // contains filtered or unexported fields }
type ReplaceAll ¶
type ReplaceAll struct { lime.DefaultCommand SearchText []rune ReplaceText []rune }
type ReplaceNext ¶
type ReplaceNext struct {
lime.DefaultCommand
}
ReplaceNext Command searches for the "old" argument text, and at the first occurance of the text, replaces it with the "new" argument text. If there are multiple regions, the find starts from the max region.
type RightDelete ¶
type RightDelete struct {
lime.DefaultCommand
}
RightDelete Command deletes characters to the right of the current selection or the current selection if it is not empty.
type Save ¶
type Save struct {
lime.DefaultCommand
}
Save command writes the currently opened file to the disk.
type SaveAll ¶
type SaveAll struct {
lime.DefaultCommand
}
SaveAll command saves all the open files to the disk.
type SaveProjectAs ¶
type SaveProjectAs struct {
lime.DefaultCommand
}
SaveProjectAs command enables us to save the project as a text file, which can then be imported into lime using PromptOpenProject command.
type ScrollLines ¶
type ScrollLines struct { lime.BypassUndoCommand // The number of lines to scroll (positive or negative direction). Amount int }
ScrollLines Command moves the viewpoint "Amount" lines from the current location.
type SelectAll ¶
type SelectAll struct {
lime.DefaultCommand
}
SelectAll command selects the whole buffer of the current file.
type SelectLines ¶
type SelectLines struct { lime.DefaultCommand Forward bool }
SelectLines makes the selection fill the lines covered by it currently.
type SetFileType ¶
type SetFileType struct { lime.DefaultCommand Syntax string }
SetFileType command will let us set the file type for the currently active view, eg: for Syntax highlighting.
type SetSetting ¶
type SetSetting struct { lime.BypassUndoCommand Setting string Value interface{} }
SetSetting Command set the value of a setting.
type SingleSelection ¶
type SingleSelection struct {
lime.DefaultCommand
}
SingleSelection command merges multiple cursors into a single one.
type SortLines ¶
type SortLines struct { lime.DefaultCommand CaseSensitive bool Reverse bool RemoveDuplicates bool }
SortLines Command sorts all lines intersecting a selection region.
type SortSelection ¶
type SortSelection struct { lime.DefaultCommand CaseSensitive bool Reverse bool RemoveDuplicates bool }
SortSelection Command sorts contents of each selection region with respect to each other.
type SplitSelectionIntoLines ¶
type SplitSelectionIntoLines struct {
lime.DefaultCommand
}
SplitSelectionIntoLines will split the current selection into lines.
type SwapCase ¶
type SwapCase struct {
lime.DefaultCommand
}
SwapCase Command transforms all selections so that each character in the selection is the opposite case. For example, the text: "Hello, World!" turns in to: "hELLO, wORLD!".
type SwapLineDown ¶
type SwapLineDown struct {
lime.DefaultCommand
}
SwapLineDown swaps the currently selected lines with the ones below.
type SwapLineUp ¶
type SwapLineUp struct {
lime.DefaultCommand
}
SwapLineUp swaps the currently selected lines with the ones above.
type TitleCase ¶
type TitleCase struct {
lime.DefaultCommand
}
TitleCase Command transforms all selections to be in Title Case. For instance, the text: "this is some sample text" turns in to: "This Is Some Sample Text".
type ToggleComment ¶
type ToggleComment struct {
lime.DefaultCommand
}
ToggleComment toggles the comment status for the current selection. If the current selection has any content which is not currently contained within a comment, the entire selection is commented out, with existing comments being commented by an extra level. If the current selection has only content contained within comments, all of the comments are reduced by one level. All lines containing only whitespace are ignored in every case.
type ToggleDistractionFree ¶
type ToggleDistractionFree struct {
// contains filtered or unexported fields
}
type ToggleFullScreen ¶
type ToggleFullScreen struct {
// contains filtered or unexported fields
}
ToggleFullScreen command enables us to toggle full screen.
type ToggleMinimap ¶
type ToggleMinimap struct {
// contains filtered or unexported fields
}
type ToggleSetting ¶
type ToggleSetting struct { lime.BypassUndoCommand Setting string }
ToggleSetting Command toggles the value of a setting, making it false when it was true or true when it was false.
type ToggleSideBar ¶
type ToggleSideBar struct {
// contains filtered or unexported fields
}
ToggleSideBar Command enables us to toggle the sidebar when the sidebar is visible, it'll be made invisible and vice versa.
type ToggleStatusBar ¶
type ToggleStatusBar struct {
// contains filtered or unexported fields
}
ToggleStatusBar command enables us to toggle the status bar.
type ToggleTabs ¶
type ToggleTabs struct {
// contains filtered or unexported fields
}
type Transpose ¶
type Transpose struct {
lime.DefaultCommand
}
Transpose will Swap the characters on either side of the cursor, then move the cursor forward one character.
type Undo ¶
type Undo struct { lime.BypassUndoCommand // contains filtered or unexported fields }
type Unindent ¶
type Unindent struct {
lime.DefaultCommand
}
Unindent Command decrements indentation of selection.
type UnmarkUndoGroupsForGluing ¶
type UnmarkUndoGroupsForGluing struct {
lime.BypassUndoCommand
}
UnmarkUndoGroupsForGluing Command removes the glue mark set by either MarkUndoGroupsForGluingCommand or MaybeMarkUndoGroupsForGluingCommand if it was set.
type UpperCase ¶
type UpperCase struct {
lime.DefaultCommand
}
UpperCase Command transforms all selections so that each character in the selection is in its upper case equivalent (if any.)