1 # Posted by Thomas Köhler on the Zsh-Mailinglist (since ~1999)
6 ( true ; show_mode "INSERT") &!
10 (true ; show_mode "COMMAND") &!
13 echo -n "\033[2J\033[400H"
14 builtin zle .redisplay
15 (true ; show_mode "INSERT") &!
20 local MYLINE="$LBUFFER$RBUFFER"
30 x=$(echo $PREBUFFER | wc -l )
33 echo -n "
\e7
\e[$x;A
\e[0;G"
35 echo -n "
\e[0;37;44m--$1--
\e[0m"
40 # Move to the end of the line and enter insert mode.
43 builtin zle .vi-add-eol
47 # Enter insert mode after the current cursor position, without changing lines.
50 builtin zle .vi-add-next
54 # Read a movement command from the keyboard, and kill from the
55 # cursor position to the endpoint of the movement. Then enter
56 # insert mode. If the command is vi-change.
59 builtin zle .vi-change
63 # Kill to the end of the line and enter insert mode.
66 builtin zle .vi-change-eol
69 # vi-change-whole-line
70 # Kill the current line and enter insert mode.
71 vi-change-whole-line() {
73 builtin zle .vi-change-whole-line
80 builtin zle .vi-insert
84 # Move to the first non-blank character on the line and enter insert mode.
87 builtin zle .vi-insert-bol
91 # Open a line above the cursor and enter insert mode.
92 vi-open-line-above() {
94 builtin zle .vi-open-line-above
98 # Open a line below the cursor and enter insert mode.
99 vi-open-line-below() {
101 builtin zle .vi-open-line-below
105 # Substitute the next character(s).
108 builtin zle .vi-substitute
112 # Enter overwrite mode.
115 builtin zle .vi-replace
119 # Enter command mode; that is, select the `vicmd' keymap. Yes,
120 # this is bound by default in emacs mode.
123 builtin zle .vi-cmd-mode