initial checkin
[zsh-lovers.git] / zsh_people / strcat / zshbindings
1 # To find out the keynames you can use
2 #  | cat > /dev/null 
3 #  or
4 #  | od -c
5 #
6 # Some useful keybindings
7 #  | $ xterm -version
8 #  |   XFree86 4.3/OpenBSD 3.3(174)
9 #  | $ echo $TERM
10 #  |   xterm
11 #
12 #  bindkey "^Y"    yank                                # <STRG>-Y
13 #  bindkey "\e[3~" delete-char                         # Delete
14 #  bindkey '^[[7~' beginning-of-line                   # Home (xterm)
15 #  bindkey '^[[8~'  end-of-line                        # End (xterm)
16 #  bindkey '^[[5~'  history-beginning-search-backward  # Page Up
17 #  bindkey '^[[6~'  history-beginning-search-forward   # Page Down
18 #  bindkey '^[[2~' overwrite-mode                      # Insert
19 #  bindkey "^[[A"  up-line-or-search                   # <ESC>-N
20 #  bindkey "^[[B"  down-line-or-search                 # <ESC>-
21 #  bindkey "^Q"  edit-command-line                     # <STRG>-Q
22 #  bindkey " "     magic-space                         # ' ' (Space>
23 #  bindkey "^B"    backward-word                       # <STRG>-B
24 #  bindkey "^E"    expand-cmd-path                     # <STRG>-E
25 #  bindkey "^N"    forward-word                        # <STRG>-N
26 #  bindkey "^R"    history-incremental-search-backward # <STRG>-R
27 #  bindkey "^P"    quote-line                          # <STRG>-P
28 #  bindkey "^K"    run-help                            # <STRG>-K
29 #  bindkey "^Z"    which-command                       # <STRG>-Z
30 #  bindkey "^X"    what-cursor-position                # <STRG>-X
31 #  bindkey -v
32
33 case $TERM in
34         xterm*)
35         # Pos1 && End
36         bindkey "^[[H" beginning-of-line
37         bindkey "^[[F" end-of-line
38         ;;
39         screen*)
40         bindkey "^[[1~" beginning-of-line
41         bindkey "^[[4~" end-of-line
42         ;;
43         linux*)
44         bindkey "^[[1~" beginning-of-line
45         bindkey "^[[4~" end-of-line
46         ;;
47         rxvt*)
48         bindkey "^[[1~" beginning-of-line
49         bindkey "^[[4~" end-of-line
50         ;;
51         Eterm*)
52         bindkey "^[[7~" beginning-of-line
53         bindkey "^[[8~" end-of-line
54         ;;
55 esac
56         bindkey "^[[2~" yank                    # Einfg
57         bindkey "^[[5~" up-line-or-history      # PageUp
58         bindkey "^[[6~" down-line-or-history    # PageDown
59         bindkey "^[e" expand-cmd-path           # C-e for expanding path of typed command
60         bindkey "^[[A" up-line-or-search        # up arrow for back-history-search
61         bindkey "^[[B" down-line-or-search      # down arrow for fwd-history-search
62         bindkey " " magic-space                 # do history expansion on space
63         bindkey -v                              # vi keybindings
64         bindkey "\e[3~" delete-char             # "Entf" or "Del"
65         bindkey "^[[A" history-search-backward  # PgUp
66         bindkey "\e[B" history-search-forward    # PgDown
67         bindkey "\e[C" forward-char              # ->
68         bindkey "\e[D" backward-char             # <-
69         bindkey "\eq" push-line                  # Kill the *complete* line! (ESC+q)
70         bindkey "^R" history-incremental-search-backward # Search in my $HISTFILE (STRG+R)
71         bindkey "^[[2;5~" insert-last-word      # STRG+Einfg
72         bindkey "\ea" accept-and-hold            # ESC+a
73         bindkey "^B"  backward-word             # One word back
74         bindkey "^N"  forward-word              # One word forward
75         bindkey "^P" quote-line                 # quote the whole line
76         bindkey "^K" run-help                   #  i. e. "run-help foo" == "man foo"
77         bindkey -s "\C-t" "dirs -v\rcd ~"       # STRG+t
78         bindkey "^I" expand-or-complete         # assimilable to "ls<TAB>"
79         bindkey "^E" expand-cmd-path            # $ ls<STRG+E> == /bin/ls
80         bindkey "^X" which-command              # <STRG>+Z == which foo
81         bindkey " " my-expand-abbrev            # See ~/.zsh/zshmisc "/^myiabs" for details
82         #--------------------------------------------------
83         # # VI-like ;-)
84         #   bindkey -M vicmd "^R" redo
85         #   bindkey -M vicmd "u" undo
86         #   bindkey -M vicmd "ga" what-cursor-position
87         #   bindkey -M viins "\e^R" redisplay
88         #   bindkey -M vicmd "^R" redisplay2
89         #   bindkey "^L" clear-screen
90         #   bindkey -M vicmd "A" vi-add-eol
91         #   bindkey -M vicmd "a" vi-add-next
92         #   bindkey "^Xl" screenclearx
93         #   bindkey -M vicmd "c" vi-change
94         #   bindkey -M vicmd "C" vi-change-eol
95         #   bindkey -M vicmd "S" vi-change-whole-line
96         #   bindkey -M vicmd "i" vi-insert
97         #   bindkey -M vicmd "I" vi-insert-bol
98         #   bindkey -M vicmd "O" vi-open-line-above
99         #   bindkey -M vicmd "o" vi-open-line-below
100         #   bindkey -M vicmd "s" vi-substitute
101         #   bindkey -M vicmd "R" vi-replace
102         #   bindkey -M viins "\e" vi-cmd-mode
103         #   bindkey -M vicmd "g~" vi-oper-swap-case
104         #-------------------------------------------------- 
105 #;;
106 #esac