diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2009-07-27 12:11:11 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2009-07-27 12:11:11 +0000 |
commit | ad0aad21d5dcc7d8c09a6c76e85ae1e46cf6b0da (patch) | |
tree | eb08eb0c59cd214850b2da7eb36c8b5b3aa639e8 /mode-key.c | |
parent | fc65da1eed07708030c0ae491cb8f4a6614de390 (diff) |
Add a key to delete to end of line at the prompt (^K in emacs mode, C/D in vi).
From Kalle Olavi Niemitalo.
Diffstat (limited to 'mode-key.c')
-rw-r--r-- | mode-key.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -110,6 +110,12 @@ mode_key_lookup_vi(struct mode_key_data *mdata, int key) return (MODEKEYCMD_BACKTOINDENTATION); case '\033': return (MODEKEYCMD_CLEARSELECTION); + case 'C': + if (mdata->flags & MODEKEY_CANEDIT) + mdata->flags |= MODEKEY_EDITMODE; + return (MODEKEYCMD_DELETETOENDOFLINE); + case 'D': + return (MODEKEYCMD_DELETETOENDOFLINE); case 'j': case KEYC_DOWN: return (MODEKEYCMD_DOWN); @@ -169,6 +175,8 @@ mode_key_lookup_emacs(struct mode_key_data *mdata, int key) case '\027': case 'w' | KEYC_ESCAPE: return (MODEKEYCMD_COPYSELECTION); + case '\013': + return (MODEKEYCMD_DELETETOENDOFLINE); case '\016': case KEYC_DOWN: return (MODEKEYCMD_DOWN); |