-
Notifications
You must be signed in to change notification settings - Fork 1
/
.inputrc
48 lines (40 loc) · 1.69 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
# IMPORTANT NOTE
# Different terminal emulators emit different escape sequences for some keys.
# Because of that some mappings are multiplied, trying to cover all cases.
# by default system-wide settings are ignored when local ~/.inputrc exists
$include /etc/inputrc
# ensure Ctrl-left/right move cursor one word backward/forward
"\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
# make Ctrl-Backspace delete whole words, like virtually every GUI app.
# https://superuser.com/a/837764/199573
"\C-H": backward-kill-word
# make ctrl-Q quit shell to match my vim binding (and GUI apps).
"\C-Q": "\C-D"
# unlearn Ctrl-W (having it in muscle memory results in closing GUI apps)
"\C-W": nop
# make Ctrl-up/down search history for commands starting with currently
# typed prefix (unlike Ctrl-R/S, which searches entire command string).
"\e[1;5A": history-search-backward
"\e[1;5B": history-search-forward
"\e[5A": history-search-backward
"\e[5B": history-search-forward
"\e\e[A": history-search-backward
"\e\e[B": history-search-forward
# Also bind this to up and down arrow
"\e[1;A": history-search-backward
"\e[1;B": history-search-forward
"\e[A": history-search-backward
"\e[B": history-search-forward
# Show extra file information when completing, like `ls -F` does
set visible-stats on
# 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