---
mode-key.c | 13 ++++++++++---
status.c | 3 +++
tmux.h | 3 +++
3 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/mode-key.c b/mode-key.c
index 94115eb..2d6d468 100644
--- a/mode-key.c
+++ b/mode-key.c
@@ -35,9 +35,7 @@
*
* vi command mode is handled by having a mode flag in the struct which allows
* two sets of bindings to be swapped between. A couple of editing commands
- * (MODEKEYEDIT_SWITCHMODE, MODEKEYEDIT_SWITCHMODEAPPEND,
- * MODEKEYEDIT_SWITCHMODEAPPENDLINE, and MODEKEYEDIT_SWITCHMODEBEGINLINE)
- * are special-cased to do this.
+ * (any matching MODEKEYEDIT_SWITCHMODE*) are special-cased to do this.
*/
/* Edit keys command strings. */
@@ -67,6 +65,9 @@ const struct mode_key_cmdstr mode_key_cmdstr_edit[] = {
{ MODEKEYEDIT_SWITCHMODEAPPEND, "switch-mode-append" },
{ MODEKEYEDIT_SWITCHMODEAPPENDLINE, "switch-mode-append-line" },
{ MODEKEYEDIT_SWITCHMODEBEGINLINE, "switch-mode-begin-line" },
+ { MODEKEYEDIT_SWITCHMODECHANGELINE, "switch-mode-change-line" },
+ { MODEKEYEDIT_SWITCHMODESUBSTITUTE, "switch-mode-substitute" },
+ { MODEKEYEDIT_SWITCHMODESUBSTITUTELINE, "switch-mode-substitute-line" },
{ MODEKEYEDIT_TRANSPOSECHARS, "transpose-chars" },
{ 0, NULL }
@@ -166,9 +167,11 @@ const struct mode_key_entry mode_key_vi_edit[] = {
{ '0', 1, MODEKEYEDIT_STARTOFLINE },
{ 'A', 1, MODEKEYEDIT_SWITCHMODEAPPENDLINE },
{ 'B', 1, MODEKEYEDIT_PREVIOUSSPACE },
+ { 'C', 1, MODEKEYEDIT_SWITCHMODECHANGELINE },
{ 'D', 1, MODEKEYEDIT_DELETETOENDOFLINE },
{ 'E', 1, MODEKEYEDIT_NEXTSPACEEND },
{ 'I', 1, MODEKEYEDIT_SWITCHMODEBEGINLINE },
+ { 'S', 1, MODEKEYEDIT_SWITCHMODESUBSTITUTELINE },
{ 'W', 1, MODEKEYEDIT_NEXTSPACE },
{ 'X', 1, MODEKEYEDIT_BACKSPACE },
{ '\003' /* C-c */, 1, MODEKEYEDIT_CANCEL },
@@ -185,6 +188,7 @@ const struct mode_key_entry mode_key_vi_edit[] = {
{ 'k', 1, MODEKEYEDIT_HISTORYUP },
{ 'l', 1, MODEKEYEDIT_CURSORRIGHT },
{ 'p', 1, MODEKEYEDIT_PASTE },
+ { 's', 1, MODEKEYEDIT_SWITCHMODESUBSTITUTE },
{ 'w', 1, MODEKEYEDIT_NEXTWORD },
{ 'x', 1, MODEKEYEDIT_DELETE },
{ KEYC_BSPACE, 1, MODEKEYEDIT_BACKSPACE },
@@ -545,6 +549,9 @@ mode_key_lookup(struct mode_key_data *mdata, int key, const
char **arg)
case MODEKEYEDIT_SWITCHMODEAPPEND:
case MODEKEYEDIT_SWITCHMODEAPPENDLINE:
case MODEKEYEDIT_SWITCHMODEBEGINLINE:
+ case MODEKEYEDIT_SWITCHMODECHANGELINE:
+ case MODEKEYEDIT_SWITCHMODESUBSTITUTE:
+ case MODEKEYEDIT_SWITCHMODESUBSTITUTELINE:
mdata->mode = 1 - mdata->mode;
/* FALLTHROUGH */
default:
diff --git a/status.c b/status.c
index 385ec8e..de56750 100644
--- a/status.c
+++ b/status.c
@@ -1099,6 +1099,7 @@ status_prompt_key(struct client *c, int key)
}
break;
case MODEKEYEDIT_DELETE:
+ case MODEKEYEDIT_SWITCHMODESUBSTITUTE:
if (c->prompt_index != size) {
memmove(c->prompt_buffer + c->prompt_index,
c->prompt_buffer + c->prompt_index + 1,
@@ -1107,11 +1108,13 @@ status_prompt_key(struct client *c, int key)
}
break;
case MODEKEYEDIT_DELETELINE:
+ case MODEKEYEDIT_SWITCHMODESUBSTITUTELINE:
*c->prompt_buffer = '\0';
c->prompt_index = 0;
c->flags |= CLIENT_STATUS;
break;
case MODEKEYEDIT_DELETETOENDOFLINE:
+ case MODEKEYEDIT_SWITCHMODECHANGELINE:
if (c->prompt_index < size) {
c->prompt_buffer[c->prompt_index] = '\0';
c->flags |= CLIENT_STATUS;
diff --git a/tmux.h b/tmux.h
index 9ab9f58..3ae4195 100644
--- a/tmux.h
+++ b/tmux.h
@@ -544,6 +544,9 @@ enum mode_key_cmd {
MODEKEYEDIT_SWITCHMODEAPPEND,
MODEKEYEDIT_SWITCHMODEAPPENDLINE,
MODEKEYEDIT_SWITCHMODEBEGINLINE,
+ MODEKEYEDIT_SWITCHMODECHANGELINE,
+ MODEKEYEDIT_SWITCHMODESUBSTITUTE,
+ MODEKEYEDIT_SWITCHMODESUBSTITUTELINE,
MODEKEYEDIT_TRANSPOSECHARS,
/* Menu (choice) keys. */
--
1.8.2.1
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
tmux-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tmux-users