-
Notifications
You must be signed in to change notification settings - Fork 0
/
.inputrc
157 lines (113 loc) · 4.95 KB
/
.inputrc
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
## /etc/inputrc - global inputrc for libreadline
## See readline(3readline) and `info rluserman' for more information.
## See https://www.gnu.org/software/bash/manual/html_node/Bindable-Readline-Commands.html
## choose the input mode
set editing-mode emacs
# set editing-mode vi
## do `bind -V` to see current setup
################################################################################
## Be 8 bit clean.
## don't strip characters to 7 bits
set input-meta on
## display characters with the eighth bit set directly
## rather than as meta-prefixed characters
set output-meta on
## need 8bit chars
set convert-meta off
## do not bell on tab-completion (can be visible or audible)
set bell-style none
## bind control characters treated specially by kernel's terminal driver
set bind-tty-special-chars on
## blink parentheses
set blink-matching-paren on
## more colors
set colored-completion-prefix on
set colored-stats on
## comment indication
set comment-begin #
## nicer pasting
set enable-bracketed-paste on
## for umlauts
set enable-meta-key on
## expand the tilde
set expand-tilde on
## attempts to place the cursor position at the same location
set history-preserve-point on
## break command ?
set horizontal-scroll-mode off
########### completion
## we like completion
set disable-completion off
## how many columns of completions?
set completion-display-width -1
## complete case insensitive
set completion-ignore-case on
## complete insensitive of - and _
set completion-map-case on
## shorten completion
set completion-prefix-display-length 10
## if there are more than 150 possible completions for
## a word, ask the user if he wants to see all of them
set completion-query-items 150
## if completed to a directory, append a /
set mark-directories on
## if completed to a symlink, append a /
set mark-symlinked-directories on
## completion disregards leading .
set match-hidden-files on
## menu completion displays common prefix as first option
set menu-complete-display-prefix on
## more-like pager for possible completions
set page-completions on
## don't destroy history
set revert-all-at-newline on
## don't want to indicate the mode we are in
set show-mode-in-prompt off
## don't repeat completed words following the cursor
set skip-completed-text on
## we don't need more info about completed files
set visible-stats off
####################################### Set bindings for emacs mode.
## see https://www.gnu.org/software/bash/manual/html_node/Bindable-Readline-Commands.html#Bindable-Readline-Commands
## run `bind -p` for current setup
$if mode=emacs
## C-b Move back one character.
## C-f Move forward one character.
## DEL or Backspace Delete the character to the left of the cursor.
## C-d Delete the character underneath the cursor.
## C-_ or C-x C-u Undo the last editing command. You can undo all the way back to an empty line.
## C-a Move to the start of the line.
## C-e Move to the end of the line.
## M-f Move forward a word, where a word is composed of letters and digits.
## M-b Move backward a word.
##
## C-l Clear the screen, reprinting the current line at the top.
## C-k Kill the text from the current cursor position to the end of the line.
## M-d Kill from the cursor to the end of the current word, or, if between words, to the end of the next word. Word boundaries are the same as those used by M-f.
## M-DEL Kill from the cursor the start of the current word, or, if between words, to the start of the previous word. Word boundaries are the same as those used by M-b.
## C-w Kill from the cursor to the previous whitespace. This is different than M-DEL because the word boundaries differ.
## C-y Yank the most recently killed text back into the buffer at the cursor.
## M-y Rotate the kill-ring, and yank the new top. You can only do this if the prior command is C-y or M-y.
##
## C-r Incremental search
############ run `sed -n l` to find out what the code is.
#"\e[5~": ## PageUp
#"\e[6~": ## PageDown
#"\e[5;5~": ## Ctrl-PageDown
#"\e[6;5~": ## Ctrl-PageUp
#"\e[A": ## ArrLeft
#"\e[B": ## ArrRight
#"\e[C": ## ArrRight
#"\e[D": ## ArrLeft
"\e[1;5D": backward-word ## Ctrl-ArrLeft
"\e[1;5C": forward-word ## Ctrl-ArrRight
"\e[1;5B": history-search-forward ## Ctrl-ArrDown
"\e[1;5A": history-search-backward ## Ctrl-ArrUp
"\e[Z": menu-complete ## Shift-Tab
TAB: complete ## Tab
$endif
######################## Set bindings for vi mode.
## run `bind -p` for current setup
## see https://www.gnu.org/software/bash/manual/html_node/Readline-vi-Mode.html#Readline-vi-Mode
$if mode=vi
$endif