-
Notifications
You must be signed in to change notification settings - Fork 0
/
.inputrc
268 lines (223 loc) · 6.5 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
# 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 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 input-meta on
set output-meta on
set convert-meta off
$if Bash
# Don't ring bell on completion
set bell-style none
# Show all instead of beeping first
set show-all-if-ambiguous on
set revert-all-at-newline off
# Filename completion/expansion
set completion-ignore-case on
set completion-map-case on
set completion-display-width -1
set completion-prefix-display-length 0
set completion-query-items 30
# Expand homedir name
set expand-tilde off
# 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 on
set colored-stats on
set colored-completion-prefix on
set skip-completed-text on
set blink-matching-paren on
# mode setting
set show-mode-in-prompt on
set vi-cmd-mode-string "\e[34;1m[N]\e[0m "
set vi-ins-mode-string "\e[38;5;40;7m I \e[0m "
set emacs-mode-string "\1\e[34m\2 e \1\e[0m\2"
set enable-bracketed-paste off
set history-preserve-point on
set horizontal-scroll-mode off
set print-completions-horizontally on
# Color the common prefix in menu-complete
set menu-complete-display-prefix on
# タブ補完を実行するとき、タブを一回押すと入力している単語が部分的に補完されます。部分補完ができない場合、タブを二回押すと全ての補完候補が表示されます。
# タブを一回押した時に二回押したときと同じ補完を実行するには、以下を設定:
set show-all-if-unmodified on
# Match all files
#set match-hidden-files on
# 'Magic Space'
# Insert a space character then performs
# a history expansion in the line
#Space: magic-space
$endif
# MSYSTEM is emacs based
#
# @see https://www.gnu.org/software/bash/manual/html_node/Readline-Init-File.html
$if mode=emacs
"\es": menu-complete
# My key maps
# Start with "C-Space"
# Redirections frequently used
"\C- rp": " | "
"\C- rl": " | less"
"\C- rL": " | less -NR"
"\C- rv": " | vim -"
"\C- rV": " | view -"
"\C- rg": " | grep "
"\C- rr": " ; ring_start "
"\C- rx": " | xargs "
"\C- rc": " | cp2clip"
"\C- ru": " | j2u "
"\C- rj": " | u2j "
"\C- rn": " > /dev/null"
"\C- rN": " > /dev/null 2>&1"
# Complete and execute
"\C- o:": ": "
"\C- os": "sudo "
"\C- om": "man "
"\C- ov": "vim "
"\C- ot": "type "
"\C- o ": " "
"\C- oS": "d" # remove sudo and execute
# Other key maps
"\C- pp": " $(pwd) "
"\C- f": "for i in $() ; do echo $i ; done\e)"
"\C-^": "~/winhome"
# Function key
"\eOP": " f-h" # F1
"\eOQ": " f-hist" # F2
"\eOR": " f-s" # F3
"\e[15~": " source ~/.bash_profile" # F5
"\e[17~": " sshinit" # F6
"\e[18~": " exec $SHELL -l" # F7
"\e[19~": " ring_stop" # F8
"\e[24~": " here" # F12
# Complete quotation marks
"\C- qs": "\'\'\C-b"
"\C- qd": "\"\"\C-b"
"\C- qp": "()\C-b"
"\C- q3": "$()\C-b"
# Surround current or previous word with quotation marks
"\C- ss": "\eb\'\ef\'"
"\C- sd": "\eb\"\ef\""
"\C- s3": "\eb$(\ef)"
"\C- s$": "\C-a$(\C-e)\C-a"
# Complete SQL
"\C- Sl": " name like '%%' \e3\C-b"
"\C- So": " order by "
"\C- Ss": " select * from "
"\C- Sj": " inner join on \eb\C-b"
# Commands with fuzzy finder
"\C- fh": " f-h"
"\C- fc": " f-cd"
"\C- fgc": " f-gc"
"\C- fvf": " f-vf"
"\C- fvg": " f-vgl"
"\C- fvl": " f-vl"
"\C- \C- u": " uuidgen | tr -d '\n' | cp2clip"
# Commands with NPM
"\C- ng": " npm run gen"
"\C- nd": " npm run dev"
"\C- ns": " npm run staging"
"\C- nb": " npm run build"
"\C- \C-ng": " npm run gen"
"\C- \C-nd": " npm run dev"
"\C- \C-ns": " npm run staging"
"\C- \C-nb": " npm run build"
# Common to Console & RXVT
"\C-?": backward-kill-line # Ctrl-BackSpace
"\e[2~": paste-from-clipboard # "Ins. Key"
"\e[5~": beginning-of-histpory # 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"
# $else
# Eh, normal Console is not really cygwin anymore, is it? Using 'else' instead. -mstormo
# $if term=cygwin # Console
# "\e[1~": beginning-of-line # Home Key
# "\e[4~": end-of-line # End Key
# "\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