zshrc.d/10-default-bindings.zrc
author Mikael Berthe <mikael@lilotux.net>
Sun, 02 May 2021 13:15:29 +0200
changeset 51 d6bcd9c33307
parent 50 87b60a3c90ae
permissions -rw-r--r--
Fix previous fix! It's an O, not a 0... "^[OH" & "^[OF"
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
45
c8b92fa96f48 Update key bindings
Mikael Berthe <mikael@lilotux.net>
parents: 30
diff changeset
     7
bindkey '^[[2~' overwrite-mode                    # Ins
c8b92fa96f48 Update key bindings
Mikael Berthe <mikael@lilotux.net>
parents: 30
diff changeset
     8
bindkey '^[[3~' delete-char                       # Suppr
c8b92fa96f48 Update key bindings
Mikael Berthe <mikael@lilotux.net>
parents: 30
diff changeset
     9
bindkey '^[[5~' history-beginning-search-backward # PgUp
c8b92fa96f48 Update key bindings
Mikael Berthe <mikael@lilotux.net>
parents: 30
diff changeset
    10
bindkey '^[[6~' history-beginning-search-forward  # PgDn
13
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    11
bindkey '^[^I'  reverse-menu-complete             # ESC-Tab
30
e26330cd408f Use copy-prev-shell-word instead of copy-prev-word
Mikael Berthe <mikael@lilotux.net>
parents: 13
diff changeset
    12
bindkey '^Xc'   copy-prev-shell-word
13
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
45
c8b92fa96f48 Update key bindings
Mikael Berthe <mikael@lilotux.net>
parents: 30
diff changeset
    16
bindkey -s '' '^[/'
c8b92fa96f48 Update key bindings
Mikael Berthe <mikael@lilotux.net>
parents: 30
diff changeset
    17
bindkey -s '' '^[,'
13
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    18
47
f25fda256b1d Improve vi mode
Mikael Berthe <mikael.berthe@cnamts.fr>
parents: 45
diff changeset
    19
if [[ $TERM == "console" || $TERM == "vt100" || $TERM == linux* ||
48
604330c024f4 Fix key bindings with screen TERM
Mikael Berthe <mikael@lilotux.net>
parents: 47
diff changeset
    20
      $TERM == xterm* || $TERM == screen* || $TERM == tmux* ]]
47
f25fda256b1d Improve vi mode
Mikael Berthe <mikael.berthe@cnamts.fr>
parents: 45
diff changeset
    21
then
13
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    22
  bindkey '^[[1~' beginning-of-line       # Home
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    23
  bindkey '^[[4~' end-of-line             # End
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    24
fi
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    25
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    26
# Dans un xterm term=linux
48
604330c024f4 Fix key bindings with screen TERM
Mikael Berthe <mikael@lilotux.net>
parents: 47
diff changeset
    27
if [[ $TERM == linux* ]]; then
13
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    28
  bindkey '^[[H'  beginning-of-line       # Home
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    29
  bindkey '^[[F'  end-of-line             # End
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    30
fi
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    31
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    32
# Dans un xterm
50
87b60a3c90ae One more xterm fix
Mikael Berthe <mikael@lilotux.net>
parents: 48
diff changeset
    33
if [[ $TERM == xterm* ]]; then
13
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    34
  bindkey '^[[H'  beginning-of-line       # Home
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    35
  bindkey '^[[F'  end-of-line             # End
45
c8b92fa96f48 Update key bindings
Mikael Berthe <mikael@lilotux.net>
parents: 30
diff changeset
    36
51
d6bcd9c33307 Fix previous fix!
Mikael Berthe <mikael@lilotux.net>
parents: 50
diff changeset
    37
  bindkey '^[OH'  beginning-of-line       # Home
d6bcd9c33307 Fix previous fix!
Mikael Berthe <mikael@lilotux.net>
parents: 50
diff changeset
    38
  bindkey '^[OF'  end-of-line             # End
50
87b60a3c90ae One more xterm fix
Mikael Berthe <mikael@lilotux.net>
parents: 48
diff changeset
    39
45
c8b92fa96f48 Update key bindings
Mikael Berthe <mikael@lilotux.net>
parents: 30
diff changeset
    40
  # Sur un xterm, on differencie backspace et delete (?).
c8b92fa96f48 Update key bindings
Mikael Berthe <mikael@lilotux.net>
parents: 30
diff changeset
    41
  bindkey '^H'  backward-delete-char    # Backspace
c8b92fa96f48 Update key bindings
Mikael Berthe <mikael@lilotux.net>
parents: 30
diff changeset
    42
  bindkey '^?'  backward-delete-char    # Backspace
13
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    43
fi
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    44
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    45
# Dans un rxvt
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    46
if [[ -z ${TERM:#rxvt*} ]]; then
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    47
  bindkey '^[[7~' beginning-of-line       # Home
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    48
  bindkey '^[[8~' end-of-line             # End
e1da4a7a9e92 More modularization
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    49
fi