-
Notifications
You must be signed in to change notification settings - Fork 0
/
.inputrc
196 lines (169 loc) · 6.46 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
#
# d8b 888
# Y8P 888
# 888
# 888 88888b. 88888b. 888 888 888888 888d888 .d8888b
# 888 888 "88b 888 "88b 888 888 888 888P" d88P"
# 888 888 888 888 888 888 888 888 888 888
# d8b 888 888 888 888 d88P Y88b 888 Y88b. 888 Y88b.
# Y8P 888 888 888 88888P" "Y88888 "Y888 888 "Y8888P
# 888
# 888
# 888
#
# -------------------------------------------------------------------------
# Version: 0.1
# File: .inputrc
# Source: https://github.com/devpunks
# Author: Ahmid-Ra (github.com/snuggs)
# Maintainer: devPunks <https://github.com/devpunks>
# Description: Readline Run Commands on $SHELL prompt.
# -------------------------------------------------------------------------
#
# This file controls the behaviour of line input editing for
# programs that use the GNU Readline library. Existing
# programs include FTP, Bash, and GDB.
#
# See to avoid potential conflicts:
# - $HOME/.vimrc
# - $HOME/.tmux.conf
# - $PREFIX/etc/inputrc
# - $HOME/.termux/termux.properties
# -------------------------------------------------------------------------
# - https://ioflood.com/blog/bind-linux-command
# - https://man7.org/linux/man-pages/man3/readline.3.html
# - https://topbug.net/blog/2017/07/31/inputrc-for-humans
# - https://geeksforgeeks.org/bind-command-in-linux-with-examples
# - https://tldp.org/LDP/lfs/LFS-BOOK-6.1.1-HTML/chapter07/inputrc.html
# - https://gnu.org/software/bash/manual/html_node/Sample-Init-File.html
# - https://unix.stackexchange.com/q/529385/i-key-is-not-functional-in-bash
# - https://gnu.org/software/bash/manual/html_node/Readline-Init-File-Syntax.html
# - https://unix.stackexchange.com/q/153357/inputrc-file-not-sourcing-correctly
#
# =========================================================================
# {{{ Bindings
# =========================================================================
# emacs mode
# $if mode=emacs
# $endif
# Preserve system wide settings
$include /data/data/com.termux/files/usr/etc/inputrc
# "TAB": menu-complete
"TAB": complete # default
"\C-x\C-r": re-read-init-file
"\C-l": clear-display # of all lines or `clear-screen` (scrolls below fold)
"RETURN": '\e\n'
"\C-a": beginning-of-line # Beginning of line
"\C-e": end-of-line # End of line
# Use Alt/Meta + Delete to delete the preceding word
# "\e[3;3~": kill-word
# allow Home/End keys
"\e[1~": beginning-of-line
"\e[2~": quoted-insert
# allow Delete/Insert keys
"\e[3~": delete-char
"\e[4~": end-of-line
"\e[8~": end-of-line
# CTRL+left, CTRL+right fpr moving on the readline by character
"\e[C": forward-char
"\e[D": backward-char
# ALT+left, ALT+right fpr moving on the readline by word
'\e[5C': forward-word
'\e[5D': backward-word
'\e[1;5C': forward-word
'\e[1;5D': backward-word
# Use the text that has already been typed as the prefix for searching through
# commands (i.e. more intelligent Up/Down behavior)
"\e[A": history-search-backward
"\e[B": history-search-forward
# <CTRL>+<N> and <CTRL>+<P> search
"\C-p": history-search-backward
"\C-n": history-search-forward
# }}}
# =========================================================================
# {{{ Options
# =========================================================================
# milliseconds to wait for key sequence
set keyseq-timeout 1000
# Allow UTF-8 input and output, instead of $'\0123\0456'
set input-meta on
set output-meta on
set convert-meta off
# Use `LS_COLORS` & readline-colored-completion-prefix
set colored-completion-prefix on
set colored-stats on
# arrow keys
set enable-keypad on
# Show extra file information when completing, `ls -F` (e.g. *,/,@)
set visible-stats on
set history-size 1000
# [ audible (default)|visible|none ]
set bell-style none
set bell-style visible
set prefer-visible-bell on
# Immediately add a trailing slash when autocompleting symlinks & directories
set mark-directories on
set mark-symlinked-directories on
# }}}
# =========================================================================
# {{{ Completion
# - http://superuser.com/q/90196/case-insensitive-tab-completion-in-bash
# - https://stackoverflow.com/q/42192384/show-all-if-ambiguous-vs-show-all-if-unmodified
# =========================================================================
set blink-matching-paren 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
# Disable <Tab>-Autocompletion paging.
set page-completions off
# Skip previously matched
set skip-completed-text on
# Show control characters
set echo-control-characters on
# <Tab>-completion on (.)dot files.
set match-hidden-files on
# All <Tab>-completion ambiguous matches.
set show-all-if-ambiguous on
# All <Tab>-completion list matches.
set show-all-if-unmodified on
# Case insensitive <Tab>-complete matches.
set completion-ignore-case on
# Maximum <Tab>-completion display results.
set completion-query-items 200
# <Tab>-completion results in single column.
set completion-display-width 3
# Common prefix of completion list.
set menu-complete-display-prefix on
# Alphabetical horizontal search of completions.
set print-completions-horizontally on
# Display ellipsis for long <Tab>-completion results.
set completion-prefix-display-length 5
# }}}
# =========================================================================
# {{{ Editing Mode
# - https://linuxgazette.net/137/anonymous.html
# - https://stackoverflow.com/q/7888387
# - https://unix.stackexchange.com/q/112406
# - https://baeldung.com/linux/console-cursor-features
# - https://catonmat.net/bash-vi-editing-mode-cheat-sheet
# - https://catonmat.net/ftp/bash-vi-editing-mode-cheat-sheet.txt
# =========================================================================
# set keymap vi
set keymap emacs
set editing-mode vi
#set editing-mode emacs
# PS1 prompt prefix
set show-mode-in-prompt on
# 0 Default
# 1 Block (blinking)
# 2 Block (steady)
# 3 Underline (blinking)
# 4 Underline (steady)
# 5 Bar (blinking) (xterm)
# 6 Bar (steady) (xterm)
set emacs-mode-string (emacs) \1\e[0m\e[5 q\2
set vi-ins-mode-string ➥【vi 】\1\e]12;red\x7\e[3 q\2
set vi-cmd-mode-string ➥【vi🔏】\1\e]12;blue\x7\e[2 q\2
# }}}
# vim: foldmethod=marker