-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinputrc
205 lines (171 loc) · 6.64 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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
# ~/.inputrc - See READLINE section in bash(1)
#
# To display the current readline variable names and values:
#
# $ bind -v
#
# To display the current readline function names and bindings:
#
# $ bind -p
#
# Useful URLs:
#
# http://linuxart.com/log/archives/2005/10/13/super-useful-inputrc/
#
# -----------------------------------------------------------------------------
# Readline Settings {{{
# Use a visible bell if available.
set bell-style visible
# If set to On, convert characters with the eighth bit set to an ASCII key sequence
# by stripping the eighth bit and prefixing an escape character.
set convert-meta off
# Initialize readline using key-bindings similar to vi (or emacs).
# https://news.ycombinator.com/item?id=7051091
set editing-mode vi
$if mode=vi
set keymap vi-command
"gg": beginning-of-history
"G": end-of-history
"jj": vi-movement-mode
set keymap vi-insert
#"\C-p": history-search-backward
$endif
# If set to On, tilde expansion is performed when readline attempts word completion.
set expand-tilde off
# If set to On, readline will enable eight-bit input (that is, it will not strip the
# high bit from the characters it reads), regardless of what the terminal claims it
# can support. The name 'meta-flag' is a synonym for this variable.
set input-meta on
# If set to On, readline will display characters with the eighth bit set directly
# rather than as a meta-prefixed escape sequence.
set output-meta on
# }}}
# Completion Settings {{{
# Perform filename matching and completion in a case-insensitive fashion.
set completion-ignore-case on
# Use 'menu-complete' on Tab (default is 'complete')
# http://stackoverflow.com/questions/7179642/how-can-i-make-bash-tab-completion-behave-like-vim-tab-completion
C-f: complete
Tab: menu-complete
"\e[Z": menu-complete-backward
# If set to On, readline performs file matching and completion in a case-insensitive fashion.
set completion-ignore-case on
# The length of characters of the common prefix of a list of possible completions
# that is displayed without modification. When set to a value greater than zero,
# common prefixes longer than this value are replaced with an ellipsis when
# displaying possible completions.
set completion-prefix-display-length 0
# This determines when the user is queried about viewing the number of possible
# completions generated by the 'possible-completions' command. It may be set to
# any integer value greater than or equal to zero. If the number of possible
# completions is greater than or equal to the value of this variable, the user
# is asked whether or not he wishes to view them; otherwise they are simply
# listed on the terminal
set completion-query-items 100
# If set to On, menu completion displays the common prefix of the list of
# possible completions (which may be empty) before cycling through the list.
set menu-complete-display-prefix on
# If set to On, completed directory names have a slash appended
set mark-directories on
# If set to On, completed names which are symbolic links to directories have
# a slash appended (subject to the value of 'mark-directories'
set mark-symlinked-directories on
# This variable, when set to On, causes readline to match files whose names
# begin with a '.' (hidden files) when performing filename completion.
# If set to Off, the leading '.' must be supplied by the user in the filename
# to be completed.
set match-hidden-files off
# If set to On, readline uses an internal more-like pager to display a screenful
# of possible completions at a time.
set page-completions on
# If set to On, readline will display completions with matches sorted horizontally
# in alphabetical order, rather than down the screen.
set print-completions-horizontally on
# If set to on, words which have more than one possible completion cause
# the matches to be listed immediately instead of ringing the bell.
set show-all-if-ambiguous on
# If set to On, this alters the default completion behavior when inserting a single
# match into the line. It's only active when performing completion in the middle
# of the word. If enabled, readline does not insert characters from the completion
# that match characters after point in the word being completed, so portions of the
# word following the cursor are not duplicated.
set skip-completed-text on
# If set to On, a character denoting a file's types as reported by stat(2) is
# appended to the filename when listing possible completions.
set visible-stats on
# }}}
# Commands for Moving {{{
#
# beginning-of-line (C-a)
# Move to the start of the current line.
#
# end-of-line (C-e)
# Move to the end of the line.
#
# forward-char (C-f)
# Move forward a character.
#
# backward-char (C-b)
# Move back a character.
#
# forward-word (M-f)
# Move forward to the end of the next word. Words are composed of
# alphanumeric characters (letters and digits).
#
# backward-word (M-b)
# Move back to the start of the current or previous word. Words are
# composed of alphanumeric characters (letters and digits).
#
"\e[1~": beginning-of-line
"\e[4~": end-of-line
#"\e[C": forward-char
#"\e[D": backward-char
"\e[1;5C": forward-word
"\e[1;5D": backward-word
"\e[5C": forward-word
"\e[5D": backward-word
"\e\e[C": forward-word
"\e\e[D": backward-word
# }}}
# Commands for Manipulating the History {{{
#
# beginning-of-history (M-<)
# Move to the first line in the history.
#
# end-of-history (M->)
# Move to the end of the input history, i.e., the line currently being entered.
#
# history-search-forward
# Search forward through the history for the string of characters between the
# start of the current line and the point. This is a non-incremental search.
#
# history-search-backward
# Search backward through the history for the string of characters between the
# start of the current line and the point. This is a non-incremental search.
#
"\e[5~": beginning-of-history
"\e[6~": end-of-history
"\e[A": history-search-backward
"\e[B": history-search-forward
#"\e\e[A": history-search-backward
#"\e\e[B": history-search-forward
# }}}
# Commands for Changing Text {{{
#
# delete-char (C-d)
# Delete the character at point. If point is at the beginning of
# the line, there are no characters in the line, and the last character
# typed was not bound to delete-char, then return EOF.
#
# quoted-insert (C-q, C-v)
# Add the next character typed to the line verbatim. This is how
# to insert characters like C-q, for example.
#
# tab-insert (C-v TAB)
# Insert a tab character.
#
"\e[3~": delete-char
"\e[2~": quoted-insert
# }}}
# -----------------------------------------------------------------------------
# vim: fen fdm=marker fdl=0