Skip to content

Commit

Permalink
keymap/vi (decompose-meta): translate "S-a" to "A"
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Apr 3, 2023
1 parent 62519a7 commit 9e0c187
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions keymap/vi.sh
Expand Up @@ -116,7 +116,9 @@ function ble/widget/vi_imap/__default__ {

local esc=27 # ESC
# local esc=$((_ble_decode_Ctrl|0x5b)) # もしくは C-[
ble-decode-key "$esc" $((KEYS[0]&~_ble_decode_Meta)) "${KEYS[@]:1}"
((flag&=~_ble_decode_Meta))
((flag==_ble_decode_Shft&&0x61<=code&&code<=0x7A&&(flag=0,code-=0x20)))
ble-decode-key "$esc" $((flag|code)) "${KEYS[@]:1}"
return 0
fi

Expand All @@ -142,7 +144,9 @@ function ble/widget/vi-command/decompose-meta {
old_suppress=$_ble_decode_keylog_depth
local _ble_decode_keylog_depth=$((old_suppress-1))

ble-decode-key "$esc" $((KEYS[0]&~_ble_decode_Meta)) "${KEYS[@]:1}"
((flag&=~_ble_decode_Meta))
((flag==_ble_decode_Shft&&0x61<=code&&code<=0x7A&&(flag=0,code-=0x20)))
ble-decode-key "$esc" $((flag|code)) "${KEYS[@]:1}"
return 0
fi

Expand Down Expand Up @@ -7613,7 +7617,7 @@ function ble-decode/keymap:vi_imap/define-meta-bindings {
ble-bind -f 'M-S-b' '@marked backward-cword'

ble-bind -f 'M-m' '@nomarked non-space-beginning-of-line'
ble-bind -f 'S-M-m' '@marked non-space-beginning-of-line'
ble-bind -f 'M-S-m' '@marked non-space-beginning-of-line'
ble-bind -f 'M-M' '@marked non-space-beginning-of-line'

#----------------------------------------------------------------------------
Expand Down

0 comments on commit 9e0c187

Please sign in to comment.