-
Notifications
You must be signed in to change notification settings - Fork 0
/
.inputrc
52 lines (45 loc) · 1.36 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
$include /etc/inputrc
set keyseq-timeout 1200
set bell-style visible
set blink-matching-paren on
set colored-completion-prefix on
set colored-stats on
set visible-stats on
# for vi mode
set editing-mode vi
$if mode=vi
set keymap vi-command
# The following make vi mode change cursor
set show-mode-in-prompt on
set vi-ins-mode-string \1\e[6 q\2
set vi-cmd-mode-string \1\e[2 q\2
# these are for vi-command mode
"\e[A": history-search-backward # arrow up
"\e[B": history-search-forward # arrow down
j: history-search-forward
k: history-search-backward
"\ep": yank-last-arg # bind to Alt-p
Control-l: clear-screen
set keymap vi-insert
# these are for vi-insert mode
"\e[A": history-search-backward
"\e[B": history-search-forward
"\ep": yank-last-arg
Control-l: clear-screen
$endif
## `readline-vim`
$include ~/.inputrc.d/readline-vim.inputrc
## Indicate mode with cursor shape
set show-mode-in-prompt On
$if term=linux
# https://www.kernel.org/doc/Documentation/admin-guide/vga-softcursor.rst
set vi-cmd-mode-string \1\e[?8c\2
set vi-ins-mode-string \1\e[?0c\2
set emacs-mode-string \1\e[?0c\2
$else
# https://vt100.net/docs/vt510-rm/DECSCUSR
# http://invisible-island.net/xterm/ctlseqs/ctlseqs.html
set vi-cmd-mode-string \1\e[1 q\2
set vi-ins-mode-string \1\e[5 q\2
set emacs-mode-string \1\e[5 q\2
$endif