Sync OpenBSD patchset 945:

Add up/down/left/right keys in vi edit mode. From "livibetter" SF bug
3385651.
This commit is contained in:
Tiago Cunha 2011-08-21 12:37:26 +00:00
parent abb4af7a14
commit 5775074f73

View File

@ -126,12 +126,16 @@ const struct mode_key_cmdstr mode_key_cmdstr_copy[] = {
const struct mode_key_entry mode_key_vi_edit[] = { const struct mode_key_entry mode_key_vi_edit[] = {
{ '\003' /* C-c */, 0, MODEKEYEDIT_CANCEL }, { '\003' /* C-c */, 0, MODEKEYEDIT_CANCEL },
{ '\010' /* C-h */, 0, MODEKEYEDIT_BACKSPACE }, { '\010' /* C-h */, 0, MODEKEYEDIT_BACKSPACE },
{ '\025' /* C-u */, 0, MODEKEYEDIT_DELETELINE },
{ '\011' /* Tab */, 0, MODEKEYEDIT_COMPLETE }, { '\011' /* Tab */, 0, MODEKEYEDIT_COMPLETE },
{ '\025' /* C-u */, 0, MODEKEYEDIT_DELETELINE },
{ '\033' /* Escape */, 0, MODEKEYEDIT_SWITCHMODE }, { '\033' /* Escape */, 0, MODEKEYEDIT_SWITCHMODE },
{ '\r', 0, MODEKEYEDIT_ENTER }, { '\r', 0, MODEKEYEDIT_ENTER },
{ KEYC_BSPACE, 0, MODEKEYEDIT_BACKSPACE }, { KEYC_BSPACE, 0, MODEKEYEDIT_BACKSPACE },
{ KEYC_DC, 0, MODEKEYEDIT_DELETE }, { KEYC_DC, 0, MODEKEYEDIT_DELETE },
{ KEYC_DOWN, 0, MODEKEYEDIT_HISTORYDOWN },
{ KEYC_LEFT, 0, MODEKEYEDIT_CURSORLEFT },
{ KEYC_RIGHT, 0, MODEKEYEDIT_CURSORRIGHT },
{ KEYC_UP, 0, MODEKEYEDIT_HISTORYUP },
{ '$', 1, MODEKEYEDIT_ENDOFLINE }, { '$', 1, MODEKEYEDIT_ENDOFLINE },
{ '0', 1, MODEKEYEDIT_STARTOFLINE }, { '0', 1, MODEKEYEDIT_STARTOFLINE },