vi_keybind.txt 263 B

12345678910
  1. typeset -A Keytable
  2. trap 'eval "${Keytable[${.sh.edchar}]}"' KEYBD
  3. function vi_keybind
  4. {
  5. keybind $'\E[A' k # Up key
  6. keybind $'\E[B' j # Down key
  7. keybind $'\E[C' l # Right key
  8. keybind $'\E[D' h # Left key
  9. keybind $'\t' '\' # Tab for command-line completion
  10. }