aboutsummaryrefslogtreecommitdiff
path: root/linux/home/.config/inputrc
blob: 435f529ad13fc56275f325bdbbb34c225564779a (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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
$include /etc/inputrc

"\f": clear-screen

# Enable bracketed paste mode (allows pasting in TUI apps)
set enable-bracketed-paste on
#set enable-bracketed-paste off

set echo-control-characters off

# Bind Ctrl+V to accept pasted text
#"\C-v": "\e[200~"
#"\C-v": paste-from-clipboard

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
set bell-style none

# 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

  # Enable arrow keys (already default in readline)
  "\e[D": backward-char
  "\e[C": forward-char

  # Allow Alt+h and Alt+l for navigation
  "\eh": backward-char
  "\el": forward-char
$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

  # Enable arrow keys (already default in readline)
  "\e[D": backward-char
  "\e[C": forward-char

  # Allow Alt+h and Alt+l for navigation
  "\eh": backward-char
  "\el": forward-char
$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