Package org.aesh.readline.editing
Class Vi
java.lang.Object
org.aesh.readline.editing.Vi
- All Implemented Interfaces:
EditMode
Vi-style line editing mode implementation.
- Author:
- Ståle W. Pedersen
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.aesh.readline.editing.EditMode
EditMode.Mode, EditMode.Status -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd an action mapping by key input and action name.addAction(int[] input, org.aesh.readline.editing.Vi.ActionStatus status) Add an action mapping for input code points with action status.Add an action mapping for a key by action name.addAction(org.aesh.terminal.Key key, String action, EditMode.Status status) Add an action mapping for a key with action name and status.addAction(org.aesh.terminal.Key key, String action, EditMode.Status status, EditMode.Status after) Add an action mapping for a key with action name, current and next status.Add an action mapping for a key.addAction(org.aesh.terminal.Key key, Action action, EditMode.Status status) Add an action mapping for a key with status.addAction(org.aesh.terminal.Key key, Action action, EditMode.Status status, EditMode.Status after) Add an action mapping for a key with current and next status.addAction(org.aesh.terminal.Key key, Action action, EditMode.Status status, EditMode.Status after, EditMode.Status actionStatus) Add an action mapping for a key with full status configuration.addAction(org.aesh.terminal.Key key, org.aesh.readline.editing.Vi.ActionStatus status) Add an action mapping for a key with action status.addActionGroup(int[] input, org.aesh.readline.editing.Vi.ActionStatusGroup group) Add an action group mapping for input code points.addActionGroup(org.aesh.terminal.Key key, org.aesh.readline.editing.Vi.ActionStatusGroup group) Add an action group mapping for a key.voidaddVariable(Variable variable, String value) Add a variable with its value.booleanCheck if currently in a chained action sequence.org.aesh.terminal.KeyAction[]keys()Get the key actions for this mode.mode()Get the editing mode type.parse(org.aesh.terminal.KeyAction event) Parse a key event and return the corresponding action.org.aesh.terminal.KeyActionprevKey()Get the previous key action.voidremapKeysFromDevice(org.aesh.terminal.Device device) Remap keys based on device capabilities.voidsetPrevKey(org.aesh.terminal.KeyAction event) Set the previous key action.voidsetStatus(EditMode.Status status) Set the edit status.status()Get the current edit status.voidupdateIgnoreEOF(int eof) Update the ignore-EOF counter.Get the value of a variable, wrapped in an Optional.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.aesh.readline.editing.EditMode
createKeyEvent
-
Method Details
-
addAction
Description copied from interface:EditModeAdd an action mapping by key input and action name. -
remapKeysFromDevice
public void remapKeysFromDevice(org.aesh.terminal.Device device) Description copied from interface:EditModeRemap keys based on device capabilities.- Specified by:
remapKeysFromDevicein interfaceEditMode- Parameters:
device- the terminal device
-
prevKey
public org.aesh.terminal.KeyAction prevKey()Description copied from interface:EditModeGet the previous key action. -
setPrevKey
public void setPrevKey(org.aesh.terminal.KeyAction event) Description copied from interface:EditModeSet the previous key action.- Specified by:
setPrevKeyin interfaceEditMode- Parameters:
event- the key action to set as previous
-
addVariable
Description copied from interface:EditModeAdd a variable with its value.- Specified by:
addVariablein interfaceEditMode- Parameters:
variable- the variable to setvalue- the value to assign
-
variable
Description copied from interface:EditModeGet the value of a variable, wrapped in an Optional. -
addAction
Add an action mapping for a key by action name.- Parameters:
key- the key to mapaction- the action name- Returns:
- this Vi instance for chaining
-
addAction
Add an action mapping for a key with action status.- Parameters:
key- the key to mapstatus- the action status- Returns:
- this Vi instance for chaining
-
addAction
Add an action mapping for input code points with action status.- Parameters:
input- the input code pointsstatus- the action status- Returns:
- this Vi instance for chaining
-
addAction
Add an action mapping for a key with action name and status.- Parameters:
key- the key to mapaction- the action namestatus- the status when this action is active- Returns:
- this Vi instance for chaining
-
addAction
public Vi addAction(org.aesh.terminal.Key key, String action, EditMode.Status status, EditMode.Status after) Add an action mapping for a key with action name, current and next status.- Parameters:
key- the key to mapaction- the action namestatus- the current status when this action is activeafter- the status to transition to after the action- Returns:
- this Vi instance for chaining
-
addAction
Add an action mapping for a key. -
addAction
Add an action mapping for a key with status.- Parameters:
key- the key to mapaction- the action to performstatus- the status when this action is active- Returns:
- this Vi instance for chaining
-
addAction
public Vi addAction(org.aesh.terminal.Key key, Action action, EditMode.Status status, EditMode.Status after) Add an action mapping for a key with current and next status.- Parameters:
key- the key to mapaction- the action to performstatus- the current status when this action is activeafter- the status to transition to after the action- Returns:
- this Vi instance for chaining
-
addAction
public Vi addAction(org.aesh.terminal.Key key, Action action, EditMode.Status status, EditMode.Status after, EditMode.Status actionStatus) Add an action mapping for a key with full status configuration.- Parameters:
key- the key to mapaction- the action to performstatus- the current status when this action is activeafter- the status to transition to after the actionactionStatus- the action's internal status- Returns:
- this Vi instance for chaining
-
addActionGroup
public Vi addActionGroup(org.aesh.terminal.Key key, org.aesh.readline.editing.Vi.ActionStatusGroup group) Add an action group mapping for a key.- Parameters:
key- the key to mapgroup- the action status group- Returns:
- this Vi instance for chaining
-
addActionGroup
Add an action group mapping for input code points.- Parameters:
input- the input code pointsgroup- the action status group- Returns:
- this Vi instance for chaining
-
updateIgnoreEOF
public void updateIgnoreEOF(int eof) Description copied from interface:EditModeUpdate the ignore-EOF counter.- Specified by:
updateIgnoreEOFin interfaceEditMode- Parameters:
eof- the EOF value to update
-
mode
Description copied from interface:EditModeGet the editing mode type. -
keys
public org.aesh.terminal.KeyAction[] keys()Description copied from interface:EditModeGet the key actions for this mode. -
status
Description copied from interface:EditModeGet the current edit status. -
setStatus
Description copied from interface:EditModeSet the edit status. -
parse
Description copied from interface:EditModeParse a key event and return the corresponding action. -
isInChainedAction
public boolean isInChainedAction()Description copied from interface:EditModeCheck if currently in a chained action sequence.- Specified by:
isInChainedActionin interfaceEditMode- Returns:
- true if in a chained action
-