summaryrefslogtreecommitdiff
path: root/.local/src/blesh/keymap/vi_digraph.sh
diff options
context:
space:
mode:
authorSaumit Dinesan <justsaumit@protonmail.com>2022-09-05 03:26:33 +0530
committerSaumit Dinesan <justsaumit@protonmail.com>2022-09-05 03:26:33 +0530
commit4a94495f747fef1b32bb8ea3aa8adbe81314795a (patch)
tree8471f4c33dfdc6cdc9136821682d5fd5f671ee47 /.local/src/blesh/keymap/vi_digraph.sh
parente96cda8f3d313e3e95b5d5e9c9a0ccce0f81960f (diff)
spring cleaning 0.3
Diffstat (limited to '.local/src/blesh/keymap/vi_digraph.sh')
-rw-r--r--.local/src/blesh/keymap/vi_digraph.sh51
1 files changed, 0 insertions, 51 deletions
diff --git a/.local/src/blesh/keymap/vi_digraph.sh b/.local/src/blesh/keymap/vi_digraph.sh
deleted file mode 100644
index dce0bf4..0000000
--- a/.local/src/blesh/keymap/vi_digraph.sh
+++ /dev/null
@@ -1,51 +0,0 @@
-# this script is a part of blesh (https://github.com/akinomyoga/ble.sh) under BSD-3-Clause license
-_ble_keymap_vi_digraph__hook=
-function ble/widget/vi_digraph/.proc {
- local code=$1
- local hook=${_ble_keymap_vi_digraph__hook:-ble-decode-key}
- _ble_keymap_vi_digraph__hook=
- ble/decode/keymap/pop
- builtin eval -- "$hook $code"
-}
-function ble/widget/vi_digraph/defchar {
- ble/widget/vi_digraph/.proc "${KEYS[0]}"
-}
-function ble/widget/vi_digraph/default {
- local key=${KEYS[0]}
- local flag=$((key&_ble_decode_MaskFlag)) char=$((key&_ble_decode_MaskChar))
- if ((flag==_ble_decode_Ctrl&&63<=char&&char<128&&(char&0x1F)!=0)); then
- ((char=char==63?127:char&0x1F))
- ble/widget/vi_digraph/.proc "$char"
- return 0
- fi
- ble/widget/.bell
- return 0
-}
-function ble-decode/keymap:vi_digraph/define {
- ble-bind -f __defchar__ vi_digraph/defchar
- ble-bind -f __default__ vi_digraph/default
- ble-bind -f __line_limit__ nop
- local lines; ble/util/mapfile lines < "$_ble_base/keymap/vi_digraph.txt"
- local line field ch1 ch2 code
- for line in "${lines[@]}"; do
- [[ $line == ??' '* ]] || continue
- ch1=${line::1}
- ch2=${line:1:1}
- code=${line:3}
- ble-bind -f "$ch1 $ch2" "vi_digraph/.proc $code"
- done
-}
-function ble-decode/keymap:vi_digraph/initialize {
- local fname_keymap_cache=$_ble_base_cache/keymap.vi_digraph
- if [[ -s $fname_keymap_cache &&
- $fname_keymap_cache -nt $_ble_base/keymap/vi_digraph.sh &&
- $fname_keymap_cache -nt $_ble_base/keymap/vi_digraph.txt ]]; then
- source "$fname_keymap_cache"
- return 0
- fi
- ble/edit/info/immediate-show text "ble.sh: updating cache/keymap.vi_digraph..."
- : >| "$fname_keymap_cache"
- ble/decode/keymap#load vi_digraph dump 3>> "$fname_keymap_cache"
- ble/edit/info/immediate-show text "ble.sh: updating cache/keymap.vi_digraph... done"
-}
-ble-decode/keymap:vi_digraph/initialize