aboutsummaryrefslogtreecommitdiff
path: root/.config/inputrc
blob: adfeec400ee5159d82cb983f04ed7838ca4b7f57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
$include /etc/inputrc

"\f": clear-screen

set bell-style none
set meta-flag on
set input-meta on
set convert-meta off
set output-meta on
set show-all-if-ambiguous on # set show-all-if-unmodified on

# Color files by types
# Note that this may cause completion text blink in some terminals (e.g. xterm).
set colored-stats On
# Append char to indicate type
set visible-stats On
# Mark symlinked directories
set mark-symlinked-directories On
# Color the common prefix
set colored-completion-prefix On
# Color the common prefix in menu-complete
set menu-complete-display-prefix On

# set editing-mode vi
set show-mode-in-prompt on
set keyseq-timeout 0 # Reduce the delay between pressing escape and the cursor change
set vi-cmd-mode-string "\1\e[2 q\2"
set vi-ins-mode-string "\1\e[6 q\2"

$if mode=vi
  set keymap vi-command
  # these are for vi-command mode
  "\e[A": history-search-backward
  "\e[B": history-search-forward
  j: history-search-forward
  k: history-search-backward
  set keymap vi-insert
  # these are for vi-insert mode
  "\e[A": history-search-backward
  "\e[B": history-search-forward
  "jk" # escape
$endif

$if mode=emacs

  "\C-P": history-search-backward
  "\C-N": history-search-forward

  # for linux console and RH/Debian xterm
  "\e[1~": beginning-of-line
  "\e[4~": end-of-line
  "\e[5~": beginning-of-history
  "\e[6~": end-of-history
  "\e[7~": beginning-of-line
  "\e[3~": delete-char
  "\e[2~": quoted-insert
  "\e[5C": forward-word
  "\e[5D": backward-word
  "\e\e[C": forward-word
  "\e\e[D": backward-word
  "\e[1;5C": forward-word
  "\e[1;5D": backward-word

  # for rxvt
  "\e[8~": end-of-line

  # for non RH/Debian xterm, can't hurt for RH/DEbian xterm
  "\eOH": beginning-of-line
  "\eOF": end-of-line

  # for freebsd console
  "\e[H": beginning-of-line
  "\e[F": end-of-line

$endif

#set editing-mode emacs
set editing-mode vi

# # switch between vi or emacs
# set keymap emacs
# "\e[": vi-editing-mode
# set keymap vi-insert
# "\e[": emacs-editing-mode
# set keymap vi-command
# "\e[": emacs-editing-mode