pub enum Action {
Show 79 variants
InsertText(String),
Paste(String),
InsertTab,
InsertNewline,
DeleteBackward,
DeleteForward,
DeleteWordBackward,
DeleteWordForward,
MoveCursor {
motion: Motion,
extend: bool,
},
SelectAll,
SelectWord,
SelectLine,
AddCursorAbove,
AddCursorBelow,
CollapseSelections,
SetSelections(SelectionSet),
ColumnSelect {
anchor_line: usize,
anchor_col: VisualCol,
head_line: usize,
head_col: VisualCol,
},
ColumnExtend(Direction),
PasteBlock(String),
Find {
query: SearchQuery,
backward: bool,
},
Replace {
query: SearchQuery,
replacement: String,
},
ReplaceAll {
query: SearchQuery,
replacement: String,
},
SelectAllMatches(SearchQuery),
MultiSelectNext {
match_case: bool,
whole_word: bool,
},
MultiSelectAll {
match_case: bool,
whole_word: bool,
},
ConvertCase(CaseMode),
SortLines(SortOptions),
ShuffleLines {
seed: u64,
},
TrimTrailingWhitespace,
DuplicateLine,
MoveLinesUp,
MoveLinesDown,
JoinLines,
SplitLines {
width: usize,
},
RemoveEmptyLines {
include_whitespace: bool,
},
RemoveDuplicateLines {
consecutive_only: bool,
},
DeleteLine,
TransposeLines,
InsertLineAbove,
InsertLineBelow,
ReverseLines,
TrimLeadingWhitespace,
TrimLeadingAndTrailingWhitespace,
EolToSpace,
TabsToSpaces,
SpacesToTabs,
ColumnInsert(ColumnInsert),
Fold,
Unfold,
ToggleFold,
FoldAll,
UnfoldAll,
FoldLevel(usize),
UnfoldLevel(usize),
GoToLine {
line: usize,
column: usize,
},
Indent,
Unindent,
ToggleLineComment,
CommentLines,
UncommentLines,
ToggleBlockComment,
ConvertIndentation {
to_spaces: bool,
},
GoToMatchingBracket,
SelectToMatchingBracket,
FormatJson {
indent: Option<Indent>,
},
MinifyJson,
Encode(Codec),
Decode(Codec),
ToggleBookmark,
NextBookmark,
PrevBookmark,
ClearBookmarks,
InverseBookmarks,
BookmarkMatches(SearchQuery),
RemoveBookmarkedLines,
RemoveUnbookmarkedLines,
ReplaceBookmarkedLines(String),
Undo,
Redo,
}Variants§
InsertText(String)
Paste(String)
Like InsertText, but when there are several selections and the text
has exactly that many lines, each selection gets one line.
InsertTab
Tab key: a tab character, or spaces to the next tab stop when the editor is set to indent with spaces.
InsertNewline
Newline plus the current line’s leading whitespace (auto-indent).
DeleteBackward
DeleteForward
DeleteWordBackward
DeleteWordForward
MoveCursor
SelectAll
SelectWord
SelectLine
AddCursorAbove
AddCursorBelow
CollapseSelections
Collapse to a caret at the primary selection’s head.
SetSelections(SelectionSet)
Replace the selections (mouse clicks and drags). Positions are clamped into the document and onto char boundaries.
ColumnSelect
Rectangular selection in visual columns: one selection per line from the anchor corner to the head corner. Lines shorter than the rectangle get an empty selection at their end (no virtual space).
ColumnExtend(Direction)
Grow or shrink the rectangle by moving its head corner (Alt+Shift+ arrows); starts a rectangle at the primary caret if there is none.
PasteBlock(String)
Paste a rectangular clip: line i goes to the caret’s visual column
on the i-th line below it, padding short lines with spaces and
adding lines at the end of the document as needed. With several
selections or a non-empty one it behaves like Paste.
Find
Select the next (or previous) match after the primary selection.
Fails with NotFound when there is none (macros stop there).
Replace
Replace the primary selection if it is exactly a match, then find the next match.
ReplaceAll
Replace every match (inside the selections with “in selection”) as one undo step.
SelectAllMatches(SearchQuery)
One selection per match.
MultiSelectNext
Multi-select Next: add the next occurrence of the primary selection’s text (after it, going round from the end) as a new primary selection. With a caret, select the word at it first.
MultiSelectAll
Multi-select All: a selection on every occurrence of the primary selection’s text (or of the word at the caret).
ConvertCase(CaseMode)
Convert each selection (or the caret’s line) to a case.
SortLines(SortOptions)
Sort the selected lines, the rectangle’s lines keyed by the text in the rectangle, or the whole document when nothing is selected.
ShuffleLines
Put the lines Sort Lines would sort in a random order (Randomize Line Order); the seed decides the order, so a macro replays it.
TrimTrailingWhitespace
Remove trailing spaces and tabs from the selected lines (all lines when nothing is selected).
DuplicateLine
Duplicate the caret’s line, or each selection.
MoveLinesUp
MoveLinesDown
JoinLines
Join the selected lines (or the caret’s line and the next).
SplitLines
Split each selected line (or the caret’s line) wider than width
columns at the blanks between words, as Notepad++’s Split Lines;
the new lines start with the line’s indentation.
RemoveEmptyLines
Remove empty lines from the selected lines (all lines when nothing
is selected); with include_whitespace, also lines of only spaces
and tabs.
RemoveDuplicateLines
Remove lines equal to an earlier selected line (all lines when
nothing is selected), keeping the order; with consecutive_only,
only lines equal to the line right before them.
DeleteLine
Delete the lines the selections touch (the caret’s line), with their line breaks: Notepad++’s Line Delete (Ctrl+Shift+L).
TransposeLines
Swap each caret’s line with the line above it (Ctrl+T); the caret goes to the start of its line, as in Notepad++.
InsertLineAbove
Insert a line above each caret’s line (a selection’s first line), indented like it, and move the caret there (Ctrl+Alt+Enter).
InsertLineBelow
Insert a line below each caret’s line (a selection’s last line), indented like it, and move the caret there (Ctrl+Alt+Shift+Enter).
ReverseLines
Reverse the order of the selected lines (every line when nothing is selected).
TrimLeadingWhitespace
Remove leading spaces and tabs from the selected lines (all lines when nothing is selected).
TrimLeadingAndTrailingWhitespace
Remove leading and trailing spaces and tabs from the selected lines (all lines when nothing is selected).
EolToSpace
Replace the line breaks between the selected lines (all lines) with spaces, keeping the blanks around them.
TabsToSpaces
Replace every tab on the selected lines (all lines) with spaces to the same tab stop.
SpacesToTabs
Replace spaces with tabs on the selected lines (all lines) wherever the columns stay the same: the indentation, and runs of two or more spaces reaching a tab stop.
ColumnInsert(ColumnInsert)
The Column Editor: insert text or a number sequence at one column
on many lines (see ColumnInsert).
Fold
Fold the region holding the caret: the caret’s line if it starts a region, else the innermost region around it. Fold actions change the view only (no undo step) and are not recorded in macros.
Unfold
Unfold the caret’s line, or every fold inside the region around it.
ToggleFold
Unfold the caret’s line if it is folded, else Fold.
FoldAll
UnfoldAll
FoldLevel(usize)
Fold every region of this level: the nesting depth for indentation (1 is outermost), the heading level in Markdown.
UnfoldLevel(usize)
GoToLine
Move the caret to a line and visual column, both counted from 1 as in the status bar (column 1 is the line start).
Indent
Indent the selected lines, or the caret’s line, by one level (Tab does this only when a selection spans lines).
Unindent
Shift+Tab: remove one level of indentation from the selected lines, or the caret’s line. (Tab with a selection over several lines indents them.)
ToggleLineComment
Comment the selected lines (or the caret’s line) with the language’s line comment, or uncomment them if they all are. Languages with only block comments get a block comment around the lines.
CommentLines
Comment the selected lines (or the caret’s line) even if they already are, as Notepad++’s Single Line Comment. Languages with only block comments get a block comment around the lines unless they are in one.
UncommentLines
Remove one line comment from each selected line that has one (or the block comment around the lines), as Notepad++’s Single Line Uncomment. Other lines are left alone.
ToggleBlockComment
Wrap each selection (or the caret’s line) in a block comment, or unwrap it.
ConvertIndentation
Rewrite every line’s leading whitespace as spaces or as tabs, keeping its width, and indent with that from now on.
GoToMatchingBracket
Move the caret to the bracket matching the one beside it.
SelectToMatchingBracket
Select from the bracket beside the caret to its match, both included.
FormatJson
Pretty-print the JSON in each selection, or the whole document when
nothing is selected: one member or element per line, indented with
indent (the document’s indentation when None). Key order,
numbers and strings are kept exactly. Fails on invalid JSON.
MinifyJson
Remove the whitespace between the JSON tokens of each selection (or the whole document).
Encode(Codec)
Encode each selection, or the whole document when nothing is selected, as UTF-8 with the document’s line endings.
Decode(Codec)
Decode each selection (or the whole document). Fails when it is not valid or the bytes are not UTF-8 text.
ToggleBookmark
Bookmark each caret’s line, or remove the bookmarks if every one of those lines has one (Ctrl+F2). Bookmarks belong to the document; changing them is not an undo step.
NextBookmark
Move the caret to the start of the next bookmarked line, wrapping around to the first (F2).
PrevBookmark
Move the caret to the start of the previous bookmarked line, wrapping around to the last (Shift+F2).
ClearBookmarks
Remove every bookmark.
InverseBookmarks
Bookmark every line without a bookmark, and remove the others.
BookmarkMatches(SearchQuery)
Bookmark every line holding the start of a match (in the selections with “in selection”), keeping the bookmarks already there.
RemoveBookmarkedLines
Delete the bookmarked lines with their line breaks.
RemoveUnbookmarkedLines
Delete every line without a bookmark.
ReplaceBookmarkedLines(String)
Replace the text of each bookmarked line (not its line break) with this text: Paste to (Replace) Bookmarked Lines.