Vim emulation class and helper methods to implement vim emulation in Editra’s text buffer.
Arrows | Basic arrow movement in vim. |
Change | Implementations for c/d/y commands. Also for <> (indentation) commands. |
Column | Goto specified column, with 1 being the default. |
Delete | Simple delete/change commands that are implemented in terms of more |
DoHandle | Call handler for command |
Dot | Repeat last insert command |
Ex | Command for opening the command bar. |
FindChar | Find character on current line and move the caret to it (if found). |
FindIdent | Find the next/previous occurance of identifier under caret |
GetHandler | Finds the function that handles command cmd |
GetMotion | Move cursor of editor to a new location according to motion |
InsertMode | Handler for basic commands that put vim in INSERT mode |
Join | Join lines command. |
Jump | Jump to a bookmark specified by a character label. |
Line | Motions to beginning/end of a line. |
Mark | Create a bookmark and associate it with a character label. |
minmax | |
NavExtra | Commands for navigating visible lines or scrolling. |
Para | Paragraph motions. |
Parse | Parses a command and (if applicable) executes it on an editor |
Put | Paste commands. |
Reg | Switch register (clipboard) command |
RegexSearch | Incremental search commands. |
RepeatFindChar | Repeat the last FindChar motion. |
ReplaceChar | Replace character under caret with another one. |
ReplaceMode | Enter into Replace Mode. |
SplitRepeat | Split the command strings into a pair (repeat, rest) |
Tilde | Invert case of character(s) under caret. Also operates on selection. |
Undo | Undo/Redo commands. |
vim_parser | Decorator for function that handle vim commands |
VisualMode | Enter visual mode |
Words | Word motions. |
EditraCommander | Proxy object that sends commands to the editor |
Basic arrow movement in vim.
See also
vim_parser
Implementations for c/d/y commands. Also for <> (indentation) commands.
Todo
This method is quite larger than other methods in this module, needs to be simplified.
See also
vim_parser
Goto specified column, with 1 being the default.
See also
vim_parser
Simple delete/change commands that are implemented in terms of more advanced c/d commands.
See also
vim_parser
Call handler for command It’s necessary to use this function instead of calling the handler directly.
Repeat last insert command
See also
vim_parser
Command for opening the command bar.
See also
vim_parser
Find character on current line and move the caret to it (if found).
See also
vim_parser
Find the next/previous occurance of identifier under caret
Note
There’s a sublte difference from vim: if some text is already selected, it’s used as the search term instead of the identifier under the caret
See also
vim_parser
Finds the function that handles command cmd
Parameters: |
|
---|
Move cursor of editor to a new location according to motion Returns a method that handles this motion, or None
Handler for basic commands that put vim in INSERT mode
Join lines command.
See also
vim_parser
Jump to a bookmark specified by a character label.
See also
vim_parser
Motions to beginning/end of a line.
See also
vim_parser
Create a bookmark and associate it with a character label.
See also
vim_parser
Commands for navigating visible lines or scrolling.
See also
vim_parser
Paragraph motions.
See also
vim_parser
Parses a command and (if applicable) executes it on an editor
Parameters: |
|
---|---|
Returns: | boolean as a signal to the caller as to whether it should clear its command buffer. i.e. True if command is handled or invalid False if we need more input before we can execute the command |
Paste commands.
See also
vim_parser
Switch register (clipboard) command
Note
This command is stand-alone, not prefix to other commands.
See also
vim_parser
Incremental search commands.
Note
Uses the find bar in editra.
See also
vim_parser
Repeat the last FindChar motion.
See also
vim_parser
Replace character under caret with another one.
Note
Does not enter into Insert mode.
See also
vim_parser
Enter into Replace Mode.
See also
vim_parser
Split the command strings into a pair (repeat, rest)
>>>SplitRepeat( ‘3ab’ ) (3, ‘ab’) >>>SplitRepeat( ‘13ab’ ) (13, ‘ab’) >>>SplitRepeat( ‘abc’ ) (None, ‘abc’) >>>SplitRepeat( ‘ab2’ ) (None, ‘ab2’) >>>SplitRepeat( ‘0’ ) (None, ‘0’) >>>SplitRepeat( ‘0ab’ ) (None, ‘0ab’) >>>SplitRepeat(‘8’) (8, ‘’)
Invert case of character(s) under caret. Also operates on selection.
See also
vim_parser
Undo/Redo commands.
Note
unlike vim, U is used for redo.
See also
vim_parser
Decorator for function that handle vim commands
Command Handling functions must follow the signature:
function( editor, repeat, cmd )
These functions should never be called directly, but instead be called through the GetHandler and DoHandle functions.
The handler functions should always decorate themselves with this decorator.
Enter visual mode
See also
vim_parser
Word motions.
Note
[] is based on what scintilla calls “word parts”, these motions are not in vim
See also
vim_parser