-
Notifications
You must be signed in to change notification settings - Fork 0
/
inputrc
90 lines (71 loc) · 4.62 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
#-----------------------------------------------------------------------------------------------------------------------
#
# Readline Runcom/Run Commands (RC) File
#
# Author: Brandon Perez <[email protected]>
# Creation date: Monday, July 04, 2016 at 10:56:49 PM PDT
#
# Description:
# This file is executed whenever the Readline library is started up, and sets the settings and keyboard shortcuts for
# the user's input that is interpreted by the Readline library. This file sets up the global settings for Readline for
# all programs; specific options for programs will be setup by their configuration files. These settings are mostly
# relevant when using a shell program such as Bash, as it control keybindings and various behavior.
#
#-----------------------------------------------------------------------------------------------------------------------
#-----------------------------------------------------------------------------------------------------------------------
# Files to Include (Default Values)
#-----------------------------------------------------------------------------------------------------------------------
# Include the system-wide defaults for the Readline library and setup any default key bindings.
$include "/etc/inputrc"
#-----------------------------------------------------------------------------------------------------------------------
# Readline Settings
#-----------------------------------------------------------------------------------------------------------------------
# Indicate to the Readline library that it should never ring the terminal's bell. This means that no sounds will be made
# when there are multiple matches for a completion.
set bell-style none
# By default, Readline binds the control characters treated specially by the kernel's terminal driver to their Readline
# equivalents. This allows for user-specified bindings to override these, such as Ctrl-W.
set bind-tty-special-chars off
# When closing an open parenthesis, highlight the matching parenthesis briefly.
set blink-matching-paren on
# When listing completions, highlight the common prefix that the completions have in common in a different color.
set colored-completion-prefix on
# Colorize files listed through completion based on their type, similar to how the Ls command does.
set colored-stats on
# Ignore the case of words when matching a completion.
set completion-ignore-case on
# When matching a case-insensitive completion, also treat underscores and hyphens in words as equivalent.
set completion-map-case on
# When completing a symbolic link that points to a directory, add the trailing slash so completion can continue after
# the symbolically linked directory.
set mark-symlinked-directories on
# Similar to the previous option, if a word has no partial completions but multiple possible completion, all the
# possible completions are listed immediately instead of ringing the bell.
set show-all-if-unmodified on
# When completing in the middle of a word, skip text that is already listed, so only new values are filled in.
set skip-completed-text on
#-----------------------------------------------------------------------------------------------------------------------
# Keyboard Shortcuts and Bindings
#-----------------------------------------------------------------------------------------------------------------------
# Setup Ctrl-Left and Ctrl-Right to move backward and forward a word. A word consist of only letters and digits, so
# words are delimited by any non-alphanumeric characters. All three escape sequences are required to handle Ctrl.
"\e[1;5D": backward-word
"\e[5D": backward-word
"\e\e[D": backward-word
"\e[1;5C": forward-word
"\e[5C": forward-word
"\e\e[C": forward-word
# Move forward and backward a shell word with Shift-Left and Shift-Right. Shell words are delimited by non-quoted shell
# metacharacters, so they can contain non-alphanumeric characters.
"\e[1;2D": shell-backward-word
"\e[1;2C": shell-forward-word
# Kill (delete) and yank the previous word with Ctrl-W and the previous space-delimited word with Alt-W.
"\C-w": backward-kill-word
"\ew": unix-word-rubout
# Scroll through the completion options one by one with the Ctrl-f and Ctrl-b key combinations.
"\C-f": menu-complete
"\C-b": menu-complete-backward
# When scrolling through history with the up and down arrow keys, search for the current command that is typed, rather
# than linearly scrolling through history. Thus, ssh <up arrow> will scroll through all SSH commands.
"\e[A": history-search-backward
"\e[B": history-search-forward