zshrc.d/10-default-bindings.zrc
author Mikael Berthe <mikael@lilotux.net>
Sun, 15 Jul 2012 15:57:45 +0200
changeset 13 e1da4a7a9e92
child 30 e26330cd408f
permissions -rw-r--r--
More modularization
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     1
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     2
# Emacs mode bindings
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     3
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     4
bindkey -e
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     5
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     6
#bindkey '^Q'    quoted-insert
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     7
bindkey '[2~' overwrite-mode                    # Ins
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     8
bindkey '[3~' delete-char                       # Suppr
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     9
bindkey '[5~' history-beginning-search-backward # PgUp
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    10
bindkey '[6~' history-beginning-search-forward  # PgDn
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    11
bindkey '^[^I'  reverse-menu-complete             # ESC-Tab
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    12
bindkey '^Xc'   copy-prev-word
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    13
bindkey '^Xf'   _correct_filename
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    14
bindkey '^Xm'   _most_recent_file
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    15
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    16
bindkey -s '' '/'
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    17
bindkey -s '' ','
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    18
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    19
# Sur la console
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    20
if [[ "$TERM" == "console" || "$TERM" == "vt100" ]]; then
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    21
  bindkey '^[[1~' beginning-of-line       # Home
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    22
  bindkey '^[[4~' end-of-line             # End
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    23
fi
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    24
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    25
# Dans un xterm term=linux
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    26
if [[ -z ${TERM:#linux*} || -z ${TERM:#screen} ]]; then
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    27
  bindkey '^[[H'  beginning-of-line       # Home
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    28
  bindkey '^[[F'  end-of-line             # End
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    29
  bindkey '[1~'  beginning-of-line       # Home
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    30
  bindkey '[4~'  end-of-line             # End
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    31
fi
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    32
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    33
# Dans un xterm
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    34
if [[ -z ${TERM:#xterm*} ]]; then
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    35
  bindkey '^[[H'  beginning-of-line       # Home
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    36
  bindkey '^[[F'  end-of-line             # End
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    37
  bindkey '[1~'  beginning-of-line       # Home
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    38
  bindkey '[4~'  end-of-line             # End
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    39
fi
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    40
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    41
# Dans un rxvt
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    42
if [[ -z ${TERM:#rxvt*} ]]; then
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    43
  bindkey '^[[7~' beginning-of-line       # Home
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    44
  bindkey '^[[8~' end-of-line             # End
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    45
fi
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    46
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    47
# Sur un xterm, on differencie backspace et delete (?).
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    48
if [[ -z ${TERM:#xterm*} ]]
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    49
then
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    50
  bindkey '^H'  backward-delete-char    # Backspace
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    51
  bindkey '^?'  backward-delete-char    # Backspace
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    52
fi