-
Notifications
You must be signed in to change notification settings - Fork 0
/
.inputrc
170 lines (164 loc) · 4.82 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
#=============================================================================
# FileName : .inputrc
# Author : [email protected]
# Created : 2020-08-25 15:22:56
# LastChange : 2024-09-12 23:33:03
# Usage : - "\C-x\C-r": re-read-init-file
# - `bind -f ~/.inputrc`: reload the file
#=============================================================================
# [GNU Readline Library](https://tiswww.case.edu/php/chet/readline/rluserman.html)
# [PS1](https://github.com/marslo/mylinux/blob/master/confs/home/.marslo/.env#L209)
# set the mode string and cursor to indicate the vim mode
# - cursor shape: `\1\e[<number> q\2` ( i.e.: `\1\e[4 q\2` )
# - cursor shape+color: `\1\e[<nubmer> q\e]12;<color>\a\2` ( i.e.: `\1\e[1 q\e]12;orange\a\2` )
# 0: blinking block
# 1: blinking block (default)
# 2: steady block
# 3: blinking underline
# 4: steady underline
# 5: blinking bar (xterm)
# 6: steady bar (xterm)
# string settings cursor shape
# +------------------------------++--------+
# color begin color end
# +------------+ +---+
set emacs-mode-string "\1\e[38;5;240;1m\2╰╶ ᓆ \1\e[0m\2\1\e[3 q\2"
# string settings cursor shape
# +------------------------------------------++--------+
# color begin color begin color end
# +------------+ +------+ +---+
set vi-ins-mode-string "\1\e[38;5;240;1m\2╰╶ \1\e[33;1m\2ᓏ \1\e[0m\2\1\e[3 q\2"
set vi-cmd-mode-string "\1\e[38;5;240;1m\2╰╶ \1\e[34;1m\2ᓎ \1\e[0m\2\1\e[5 q\2"
set show-mode-in-prompt on
####################
# \e : Meta #
# \C : Control #
####################
# https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Readline-Init-File-Syntax
# allow 8bit input
set meta-flag on
# don't strip characters to 7 bits when reading
set input-meta on
# keep the 8th bit for display
set output-meta on
# only allow iso-latin1 characters to be inserted
set convert-meta off
set completion-ignore-case on
set show-all-if-ambiguous on
set show-all-if-unmodified on
set mark-symlinked-directories on
set print-completions-horizontally on
# https://github.com/scop/bash-completion
# set visible-stats on
set enable-bracketed-paste off
# https://groups.google.com/g/iterm2-discuss/c/K6YazwKUvjQ/m/7eqeT-AvBgAJ
# TAB: menu-complete
# set colored-completion-prefix on
set colored-stats on
set skip-completed-text on
# ask if more than 100 candidates
# set completion-query-items 100
set keymap emacs
"\ee": vi-editing-mode
# https://www.usenix.org.uk/content/bash.html#input
set keymap vi-command
"\ee": emacs-editing-mode
# key bindings to get out of vi-editing-mode
"v" : ''
"#": insert-comment
"dw": kill-word
"dd": kill-whole-line
"db": backward-kill-word
"D":kill-line
"da\"": "lF\"df\""
"di\"": "lF\"lmtf\"d`t"
"ci\"": "di\"i"
"da'": "lF'df'"
"di'": "lF'lmtf'd`t"
"ci'": "di'i"
"da`": "lF\`df\`"
"di`": "lF\`lmtf\`d`t"
"ci`": "di`i"
"ca`": "da`i"
"da(": "lF(df)"
"di(": "lF(lmtf)d`t"
"ci(": "di(i"
"ca(": "da(i"
"da)": "lF(df)"
"di)": "lF(lmtf)d`t"
"ci)": "di(i"
"ca)": "da(i"
"da{": "lF{df}"
"di{": "lF{lmtf}d`t"
"ci{": "di{i"
"ca{": "da{i"
"da}": "lF{df}"
"di}": "lF{lmtf}d`t"
"ci}": "di}i"
"ca}": "da}i"
"da[": "lF[df]"
"di[": "lF[lmtf]d`t"
"ci[": "di[i"
"ca[": "da[i"
"da]": "lF[df]"
"di]": "lF[lmtf]d`t"
"ci]": "di]i"
"ca]": "da]i"
"da<": "lF<df>"
"di<": "lF<lmtf>d`t"
"ci<": "di<i"
"ca<": "da<i"
"da>": "lF<df>"
"di>": "lF<lmtf>d`t"
"ci>": "di>i"
"ca>": "da>i"
"da/": "lF/df/"
"di/": "lF/lmtf/d`t"
"ci/": "di/i"
"ca/": "da/i"
"da:": "lF:df:"
"di:": "lF:lmtf:d`t"
"ci:": "di:i"
"ca:": "da:i"
"\C-_": undo
"\C-a": beginning-of-line
"\C-b": backward-char
"\C-d": delete-char
"\C-h": backward-delete-char
"\C-e": end-of-line
"\C-f": forward-char
"\C-g": abort
"\C-k": kill-line
"\C-l": clear-screen
"\C-u": unix-line-discard
"\C-p": previous-history
"\C-n": next-history
"\C-w": unix-word-rubout
"\C-q": quoted-insert
"\C-x\C-r": re-read-init-file
"\e#": insert-comment
"\e.": insert-last-argument
"\e.": yank-last-arg
"\e_": yank-last-arg
set keymap vi-insert
"\ee": emacs-editing-mode
"\C-_": undo
"\C-a": beginning-of-line
"\C-b": backward-char
"\C-d": delete-char
"\C-h": backward-delete-char
"\C-e": end-of-line
"\C-f": forward-char
"\C-g": abort
"\C-k": kill-line
"\C-l": clear-screen
"\C-u": unix-line-discard
"\C-p": previous-history
"\C-n": next-history
"\C-w": unix-word-rubout
"\C-q": quoted-insert
"\C-_": undo
"\C-x\C-r": re-read-init-file
"\e#": insert-comment
"\e.": insert-last-argument
"\e_": yank-last-arg