-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_inputrc
77 lines (60 loc) · 2.05 KB
/
dot_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
# The following GNU Emacs style escape sequences are available when specifying key sequences:
# \C- control prefix (Ctrl)
# \M- meta prefix (Alt)
# \e an escape character
# \\ backslash
# \" a double quotation mark
# \' a single quote or apostrophe
#
# This file controls the behaviour of line input editing for
# programs that use the GNU Readline library. Existing
# programs include FTP, Bash, and GDB.
#
# You can re-read the inputrc file with C-x C-r.
# Lines beginning with '#' are comments.
#
# First, include any system-wide bindings and variable
# assignments from /etc/Inputrc
$include /etc/inputrc
# Display a list of the matching files
set show-all-if-ambiguous on
# Perform partial (common) completion on the first Tab press, only start cycling full results on the second Tab press (from bash version 5)
set menu-complete-display-prefix on
set colored-stats on
set completion-ignore-case on
set completion-map-case on
set bell-style none
# Open file explorer
# Control-o:"cdx\C-m"
Control-o:"y\C-m"
# Open man page for the what ever typed in the terminal
"\eh":"\C-aman \C-m" # Alt-h
# Kill whole line
"\el":kill-whole-line # Alt-l
# If there are multiple matches for completion, Tab should cycle through them
TAB:menu-complete
# And Shift-Tab should cycle backwards
"\e[Z":menu-complete-backward
# Cycle through history based on characters already typed on the line
"\e[A":history-search-backward
"\e[B":history-search-forward
# Keep Ctrl-Left and Ctrl-Right working when the above are used
"\e[1;5C":forward-word
"\e[1;5D":backward-word
$if Bash
# edit the path
"\C-xp": "PATH=${PATH}\e\C-e\C-a\ef\C-f"
# prepare to type a quoted word --
# insert open and close double quotes
# and move to just after the open quote
"\C-x\"": "\"\"\C-b"
# insert a backslash (testing backslash escapes
# in sequences and macros)
"\C-x\\": "\\"
# Quote the current or previous word
"\C-xq": "\eb\"\ef\""
# Add a binding to refresh the line, which is unbound
"\C-xr": redraw-current-line
# Edit variable on current line.
"\M-\C-v": "\C-a\C-k$\C-y\M-\C-e\C-a\C-y="
$endif