-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.inputrc
288 lines (237 loc) · 12 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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
# To the extent possible under law, the author(s) have dedicated all
# copyright and related and neighboring rights to this software to the
# public domain worldwide. This software is distributed without any warranty.
# You should have received a copy of the CC0 Public Domain Dedication along
# with this software.
# If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
# ~/.inputrc: readline initialization file.
# The copy in your home directory (~/.inputrc) is yours, please
# feel free to customise it to create a shell
# environment to your liking. If you feel a change
# would be benifitial to all, please feel free to send
# a patch to the msys2 mailing list.
# The existence of this file will completely override ALL settings in any system-wide inputrc (usually /etc/inputrc)
# Unless the system-wide file is included at the start of this file, like so (uncomment to use)
# $include /etc/inputrc
# the following line is actually
# equivalent to "\C-?": delete-char
# "\e[3~": delete-char
# VT
# "\e[1~": beginning-of-line
# "\e[4~": end-of-line
# kvt
# "\e[H": beginning-of-line
# "\e[F": end-of-line
# rxvt and konsole (i.e. the KDE-app...)
# "\e[7~": beginning-of-line
# "\e[8~": end-of-line
# VT220
# "\eOH": beginning-of-line
# "\eOF": end-of-line
# Allow 8-bit input/output
# set meta-flag on
# set convert-meta off
# set input-meta on
# set output-meta on
#$if Bash
# Don't ring bell on completion
#set bell-style none
# or, don't beep at me - show me
#set bell-style visible
# Show all instead of beeping first
# If enabled, lists all matches in case multiple possible completions are possible.
#set show-all-if-ambiguous off
# Filename completion/expansion
#set completion-ignore-case on
#set show-all-if-ambiguous on
# Expand homedir name
#set expand-tilde on
# Append "/" to all dirnames
#set mark-directories on
#set mark-symlinked-directories on
# visible-stats
# Append a mark according to the file type in a listing
#set visible-stats off
#set mark-directories on
# Match all files
#set match-hidden-files on
# Do not autocomplete hidden files unless the pattern explicitly begins with a dot
#set match-hidden-files off
# 'Magic Space'
# Insert a space character then performs
# a history expansion in the line
#Space: magic-space
#$endif
# MSYSTEM is emacs based
$if mode=emacs
# Common to Console & RXVT
"\C-?": backward-kill-line # Ctrl-BackSpace
"\e[2~": paste-from-clipboard # "Ins. Key"
"\e[5~": beginning-of-history # Page up
"\e[6~": end-of-history # Page down
$if term=msys # RXVT
"\e[7~": beginning-of-line # Home Key
"\e[8~": end-of-line # End Key
"\e[11~": display-shell-version # F1
"\e[15~": re-read-init-file # F5
"\e[12~": "Function Key 2"
"\e[13~": "Function Key 3"
"\e[14~": "Function Key 4"
"\e[17~": "Function Key 6"
"\e[18~": "Function Key 7"
"\e[19~": "Function Key 8"
"\e[20~": "Function Key 9"
"\e[21~": "Function Key 10"
# Eh, normal Console is not really cygwin anymore, is it? Using 'else' instead. -mstormo
$else # $if term=cygwin # Console
"\e[1~": beginning-of-line # Home Key Should not be necessary for mintty since v0.3.7
"\e[4~": end-of-line # End Key Should not be necessary for mintty since v0.3.7
"\e[3~": delete-char # Delete Key
"\e\e[C": forward-word # Alt-Right
"\e\e[D": backward-word # Alt-Left
"\e[1;5C": forward-word # Ctrl-Right
"\e[1;5D": backward-word # Ctrl-Left
"\e[17~": "Function Key 6"
"\e[18~": "Function Key 7"
"\e[19~": "Function Key 8"
"\e[20~": "Function Key 9"
"\e[21~": "Function Key 10"
"\e[23~": "Function Key 11"
$endif
$endif
###################################################################
### ADDITIONS BELOW
###################################################################
### NOTE:
## The following symbolic character names are recognized while processing
## key bindings of the form 'keyname: function-name/macro':
## DEL, ESC, ESCAPE, LFD, NEWLINE, RET, RETURN, RUBOUT, SPACE, SPC, and TAB.
###################################
### More intelligent completion ###
###################################
## Try to be slightly more intelligent with Up/Down behavior, by attempting to use
## the text already on the line as a prefix for searching through command history.
"\e[B": history-search-forward
"\e[A": history-search-backward
## given show-all-if-ambiguous, The following line will allow you to tab through the expansion options
## (note: this will replace the default tab-complete behavior)
# TAB: menu-complete
## and the following line will allow you to do so in reverse with shift+tab
#"\e[Z": "\e-1\C-i" #alternatively, "\e[Z": menu-complete-backward
###################################
$if mode=emacs
# add ctrl+end for end of file
# + ctrl+home for beginning of file
# + ctrl+F5 for re-read-init-file
$if term=msys # RXVT
#"\C[7~": beginning-of-line # Home Key
#"\C[8~": end-of-file # End Key
#"\C[15~": re-read-init-file # Ctrl+F5
$else
### I'm honestly not really sure what term value should be used for msys2+mintty, assuming there even is a specific value that would work.
#"\C[1~": beginning-of-line # Home Key; alternatively, may be \e[H
#"\C[4~": end-of-file # End Key; alternatively, may be \e[F
#";5~": re-read-init-file # At one point, this was Ctrl+F5...somehow...verbatim input in Nano said ^[[15;5~, '^[[' being '\033[' aka '\e['
"\e[15;5~": re-read-init-file # Previously Ctrl+F5 was somehow ";5~"; I don't know exactly what changed, but now it uses a sequence that follows the same pattern as the other function keys (excluding F1-4)
# "\e[19;5~": "pressed ctrl+f8" # Works; there must be some sort of historical reason for why F5 is 15 but F8 is 19 (rather than 18)
# "\e[24;3": # trying to see if altgr+f12 can be made to behave like alt+f12, as I already seem to have it doing with non function keys. Obviously I'm having trouble, given that its incomplete and commented out.
$if Bash
"\e\d": undo # Alt+Backspace to undo specifically in the context of Bash
"\C-H": backward-kill-word # Ctrl+Backspace to delete word; even in mintty as of version 0.3.7, when backspace was changed to emit ^H
"\e[2;7~": overwrite-mode # Ctrl+Alt+Insert to toggle overwrite mode
"\e[1;3A": previous-screen-line # Alt+Up to move the cursor up a line (on screen)
"\e[1;3B": next-screen-line # Alt+Down to move the cursor down a line (on screen)
# "\C-SPC": menu-complete # Nope
# "\C-\\": menu-complete # Nope
# "\C-\\\\": menu-complete # Nope
# "\C-|": menu-complete # Nope
# "\e[Z": menu-complete-backward # Nope
# Clearly I must just be stupid for not finding any possible unused key combination that wants to ****ing work for these, while using the same non-modifier keys. I should probably give up.
"\e\\": old-menu-complete
$endif
$endif
$endif
## bell-style (Default: audible)
## If set to audible, allows readline to (attempt to) ring an audible bell
## If set to visible, allows readline to use a visible "bell" if one is available (often a quick flash in the terminal window)
## If set to none, prevents readline from ever ringing any kind of bell
# Don't ring bell on completion
set bell-style none
## blink-matching-paren (Default: off)
## If set to On, readline attempts to briefly move the cursor to an
## opening parenthesis when a closing parenthesis is inserted.
# set blink-matching-paren on
## colored-completion-prefix (Default: off)
## If set to On, when listing completions, readline displays the common prefix of the set of possible completions
## using a different color. The color definitions are taken from the value of the LS_COLORS environment variable.
set colored-completion-prefix on
## colored-stats (Default: off)
## If set to On, readline displays possible completions using different colors to indicate their file type.
## The color definitions are taken from the value of the LS_COLORS environment variable.
set colored-stats on
## completion-ignore-case (Default: off)
## Make Tab autocomplete regardless of filename case
set completion-ignore-case on
## completion-map-case (Default: off)
## If set to On, and if completion-ignore-case is set to On, treat
## underscore ('_') and hyphen ('-') as equivalent when performing completion.
#set completion-map-case on
## completion-prefix-display-length (Default: 0)
## The length in characters of the common prefix of a list of possible completions that is
## displayed without modification. If set to a value greater than zero, common prefixes
## longer than this value are replaced with an ellipsis when displaying possible completions.
## NOTE THAT SETTING THIS MAY BREAK colored-completion-prefix. Unfortunate, considering this is useful behavior far more often than I would like.
# set completion-prefix-display-length 10
## completion-query-items (Default: 100)
## If there are at least this many possible completions for a word, ask to show them all.
## A value of 0 will cause readline to always ask before showing any completions.
## A negative value will always show all completions.
set completion-query-items 100
## enable-bracketed-paste (Default: off)
## Enable/Disable bracketed paste mode
set enable-bracketed-paste off
## enable-keypad (Default: off)
## When set to On, readline will try to enable the application keypad when it is called.
## Some systems need this to enable the arrow keys.
# set enable-keypad on
## mark-directories (Default: on)
## If set to On, completed directory names will have a slash ('/') appended
set mark-directories on
## mark-modified-lines (Default: off)
## If set to On, history lines that have been modified are displayed with a preceding asterisk (*).
# set mark-modified-lines off
## mark-symlinked-directories (Default: off)
## If set to On, and if mark-directories is set to On, immediately
## add a trailing slash when autocompleting symlinks to directories.
set mark-symlinked-directories on
## match-hidden-files (Default: on)
## Match files whose names begin with '.' when performing file name
## name completion, even without the user providing the leading '.'
set match-hidden-files on
## menu-complete-display-prefix (Default: off)
## 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
## page-completions (Default: on)
## Show all autocomplete results at once
## "If set to On, readline uses an internal more-like pager to display a screenful of possible completions at a time."
#set page-completions off
## show-all-if-ambiguous (Default: off)
## If enabled, immediately lists all matches in a case where multiple completions are possible.
set show-all-if-ambiguous off
## show-all-if-unmodified (Default: off)
## If set to On, immediately list all matches for words with multiple possible completions but without any possible partial completions
## (that is, where none of the possible completions share a common prefix following the cursor position)
#set show-all-if-unmodified on
## skip-completed-text (Default: off)
# Be more intelligent when autocompleting by also looking at the text after the cursor. For example,
# when the current line is "cd ~/src/mozil", and the cursor is on the "z", pressing Tab will not
# autocomplete it to "cd ~/src/mozillail", but to "cd ~/src/mozilla".
# (This is supported by the Readline used by Bash 4.)
set skip-completed-text on
## visible-stats (Default: off)
## Show extra file information when completing, like `ls -F` does by appending a mark according to the file type
set visible-stats on
# see https://www.xfree86.org/current/ctlseqs.html for some helpful information
# also review infocmp results side-by-side with man user_caps. and stty
# "\e\C-e": shell-expand-line # expand all variables in line