8 bindkey
'^Z' push-input
# "suspend" current line
10 linux
) # Linux console
11 bindkey
'\e[1~' beginning-of-line
# Home
12 bindkey
'\e[4~' end-of-line
# End
13 bindkey
'\e[3~' delete-char
# Del
14 bindkey
'\e[2~' overwrite-mode
# Insert
16 screen
) # The textmode window manager
18 bindkey
'\e[1~' beginning-of-line
# Home
19 bindkey
'\e[4~' end-of-line
# End
20 bindkey
'\e[3~' delete-char
# Del
21 bindkey
'\e[2~' overwrite-mode
# Insert
22 bindkey
'\e[7~' beginning-of-line
# home
23 bindkey
'\e[8~' end-of-line
# end
25 bindkey
'\eOc' forward-word
# ctrl cursor right
26 bindkey
'\eOd' backward-word
# ctrl cursor left
29 bindkey
'\e[7~' beginning-of-line
# home
30 bindkey
'\e[8~' end-of-line
# end
31 bindkey
'\eOc' forward-word
# ctrl cursor right
32 bindkey
'\eOd' backward-word
# ctrl cursor left
33 bindkey
'\e[3~' delete-char
34 bindkey
'\e[2~' overwrite-mode
# Insert
37 bindkey
'\e[H' beginning-of-line
# Home
38 bindkey
'\e[F' end-of-line
# End
39 # I need the next two when in rxvt via ssh.
40 bindkey
'\e[7~' beginning-of-line
# home
41 bindkey
'\e[8~' end-of-line
# end
42 bindkey
'\e[3~' delete-char
# Del
43 bindkey
'\e[2~' overwrite-mode
# Insert
44 bindkey
"^[[5C" forward-word
# ctrl cursor right
45 bindkey
"^[[5D" backward-word
# ctrl cursor left
49 #k# Insert a timestamp on the command line (yyyy-mm-dd)
50 zle
-N insert-datestamp
51 bindkey
'^Ed' insert-datestamp
53 #k# Put the current command line into a \kbd{sudo} call
54 zle
-N sudo-command-line
55 bindkey
"^Os" sudo-command-line
57 ## This function allows you type a file pattern,
58 ## and see the results of the expansion at each step.
59 ## When you hit return, they will be inserted into the command line.
60 if is4
&& zrcautoload insert-files
&& zle
-N insert-files
; then
61 #k# Insert files and test globbing
62 bindkey
"^Xf" insert-files
## C-x-f
65 ## This set of functions implements a sort of magic history searching.
66 ## After predict-on, typing characters causes the editor to look backward
67 ## in the history for the first line beginning with what you have typed so
68 ## far. After predict-off, editing returns to normal for the line found.
69 ## In fact, you often don't even need to use predict-off, because if the
70 ## line doesn't match something in the history, adding a key performs
71 ## standard completion - though editing in the middle is liable to delete
72 ## the rest of the line.
73 if is4
&& zrcautoload predict-on
&& zle
-N predict-on
; then
75 bindkey
"^X^R" predict-on
## C-x C-r
76 #bindkey "^U" predict-off ## C-u
79 # used when you press M-? on a command line
80 alias which-command
='whence -a'
82 # in 'foo bar | baz' make a second ^W not eat 'bar |', but only '|'
83 # this has the disadvantage that in 'bar|baz' it eats all of it.
84 typeset WORDCHARS
='|'$WORDCHARS
86 # press ctrl-x ctrl-e for editing command line in $EDITOR or $VISUAL
87 if is4
&& zrcautoload edit-command-line
&& zle
-N edit-command-line
; then
88 bindkey
'\C-x\C-e' edit-command-line
91 # move cursor between chars when typing '', "", (), [], and {}
92 magic-single-quotes
() { if [[ $LBUFFER[-1] == \' ]]; then zle self-insert
; zle .backward-char
; else zle self-insert
; fi };
93 magic-double-quotes
() { if [[ $LBUFFER[-1] == \" ]]; then zle self-insert
; zle .backward-char
; else zle self-insert
; fi };
94 magic-parentheses
() { if [[ $LBUFFER[-1] == \
( ]]; then zle self-insert
; zle .backward-char
; else zle self-insert
; fi };
95 magic-square-brackets
() { if [[ $LBUFFER[-1] == \
[ ]]; then zle self-insert
; zle .backward-char
; else zle self-insert
; fi };
96 magic-curly-brackets
() { if [[ $LBUFFER[-1] == \
{ ]]; then zle self-insert
; zle .backward-char
; else zle self-insert
; fi };
97 magic-angle-brackets
() { if [[ $LBUFFER[-1] == \
< ]]; then zle self-insert
; zle .backward-char
; else zle self-insert
; fi };
98 bindkey
\' magic-single-quotes
99 bindkey
\" magic-double-quotes
100 bindkey \
) magic-parentheses
101 bindkey \
] magic-square-brackets
102 bindkey \
} magic-curly-brackets
103 bindkey \
> magic-angle-brackets
104 zle
-N magic-single-quotes
105 zle
-N magic-double-quotes
106 zle
-N magic-parentheses
107 zle
-N magic-square-brackets
108 zle
-N magic-curly-brackets
109 zle
-N magic-angle-brackets
111 # Show what the completion system is trying to complete with at a given point
112 bindkey
'^Xh' _complete_help