Editor Functions

This file contains functions to manipulate the content of textareas/input fields/contenteditable elements.

If you want to bind them to keyboard shortcuts, be sure to prefix them with "text.". For example, if you want to bind control-a to beginning_of_line in all modes, use:

bind --mode=ex <C-a> text.beginning_of_line
bind --mode=input <C-a> text.beginning_of_line
bind --mode=insert <C-a> text.beginning_of_line

Also keep in mind that if you want to bind something in insert mode, you'll probably also want to bind it in input mode (insert mode is entered by clicking on text areas while input mode is entered by using gi).

If you're looking for command-line only functions, go there.

Contrary to the main tridactyl help page, this one doesn't tell you whether a specific function is bound to something. For now, you'll have to make do with with :bind and :viewconfig.

backward_char
backward_kill_line
backward_kill_word
backward_word
beginning_of_line
capitalize_word
delete_backward_char
delete_char
downcase_word
end_of_line
forward_char
forward_word
insert_text
jumble
kill_line
kill_whole_line
kill_word
next_line
previous_line
rot13
tab_insert
transpose_chars
transpose_words
upcase_word
backward_char: (e: HTMLElement, arg?: any) => boolean = ...

Behaves like readline's backward_char. Moves the caret one character to the left.

Type Declaration

backward_kill_line: (e: HTMLElement, arg?: any) => boolean = ...

Behaves like readline's backward_kill_line, i.e. deletes every character to the left of the caret until either the beginning of the text is found or a newline character ("\n") is reached.

Type Declaration

backward_kill_word: (e: HTMLElement, arg?: any) => boolean = ...

Behaves like readline's backward_kill_word. Deletes every character from the caret to the beginning of a word with word being defined by the wordpattern setting.

Type Declaration

backward_word: (e: HTMLElement, arg?: any) => boolean = ...

Behaves like readline's backward_word. Moves the caret one word to the left, with words being defined by the wordpattern setting.

Type Declaration

beginning_of_line: (e: HTMLElement, arg?: any) => boolean = ...

Behaves like readline's beginning_of_line. Moves the caret to the right of the first newline character found at the left of the caret. If no newline can be found, move the caret to the beginning of the text.

Type Declaration

capitalize_word: (e: HTMLElement, arg?: any) => boolean = ...

Behaves like readline's capitalize_word. Makes the initial character of the word the caret is in uppercase.

Type Declaration

delete_backward_char: (e: HTMLElement, arg?: any) => boolean = ...

Behaves like readline's delete_backward_char, i.e. deletes the character to the left of the caret.

Type Declaration

delete_char: (e: HTMLElement, arg?: any) => boolean = ...

Behaves like readline's delete_char, i.e. deletes the character to the right of the caret.

Type Declaration

downcase_word: (e: HTMLElement, arg?: any) => boolean = ...

Behaves like readline's downcase_word. Makes the word the caret is in lowercase.

Type Declaration

end_of_line: (e: HTMLElement, arg?: any) => boolean = ...

Behaves like readline's end_of_line. Moves the caret to the left of the first newline character found at the right of the caret. If no newline can be found, move the caret to the end of the text.

Type Declaration

forward_char: (e: HTMLElement, arg?: any) => boolean = ...

Behaves like readline's forward_char. Moves the caret one character to the right.

Type Declaration

forward_word: (e: HTMLElement, arg?: any) => boolean = ...

Behaves like readline's forward_word. Moves the caret one word to the right, with words being defined by the wordpattern setting.

Type Declaration

insert_text: (e: HTMLElement, arg?: any) => boolean = ...

Insert text in the current input.

Type Declaration

jumble: (e: HTMLElement, arg?: any) => boolean = ...

Type Declaration

kill_line: (e: HTMLElement, arg?: any) => boolean = ...

Behaves like readline's kill_line, i.e. deletes every character to the right of the caret until reaching either the end of the text or the newline character (\n).

Type Declaration

kill_whole_line: (e: HTMLElement, arg?: any) => boolean = ...

Behaves like readline's kill_whole_line. Deletes every character between the two newlines the caret is in. If a newline can't be found on the left of the caret, everything is deleted until the beginning of the text is reached. If a newline can't be found on the right, everything is deleted until the end of the text is found.

Type Declaration

kill_word: (e: HTMLElement, arg?: any) => boolean = ...

Behaves like readline's kill_word. Deletes every character from the caret to the end of a word, with words being defined by the wordpattern setting.

Type Declaration

next_line: (e: HTMLElement, arg?: any) => boolean = ...

Type Declaration

previous_line: (e: HTMLElement, arg?: any) => boolean = ...

Type Declaration

rot13: (e: HTMLElement, arg?: any) => boolean = ...

Type Declaration

tab_insert: (e: HTMLElement, arg?: any) => boolean = ...

Behaves like readline's tab_insert, i.e. inserts a tab character to the left of the caret.

Type Declaration

transpose_chars: (e: HTMLElement, arg?: any) => boolean = ...

Behaves like readline's transpose_chars, i.e. transposes the character to the left of the caret with the character to the right of the caret and then moves the caret one character to the right. If there are no characters to the right or to the left of the caret, uses the two characters the closest to the caret.

Type Declaration

transpose_words: (e: HTMLElement, arg?: any) => boolean = ...

Behaves like readline's transpose_words. Basically equivalent to im_transpose_chars, but using words as defined by the wordpattern setting.

Type Declaration

upcase_word: (e: HTMLElement, arg?: any) => boolean = ...

Behaves like readline's upcase_word. Makes the word the caret is in uppercase.

Type Declaration