-
Notifications
You must be signed in to change notification settings - Fork 0
/
inputrc
89 lines (81 loc) · 2.86 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
$include /etc/inputrc
# User must be part of the `wheel` group for above line to be effective
# Lines beginning with `$' indicate conditional constructs.
# Customize Readline’s key bindings and make them whatever you like.
# Readline reads INPUTRC=~/.inputrc file on startup, given env-var
# INPUTRC is properly set in ~/.bash_profile, or in ~/.profile .
# Examples of ~/.inputrc are at:
# https://www.softpanorama.org/Scripting/Shellorama/Bash_as_command_interpreter/inputrc.shtml
# Common key sequences are:
# \C-<key> Control key prefix
# \M-<key> Meta (Escape) key prefix
# \e<key> The escape character
set show-all-if-unmodified on
set editing-mode vi
#set echo-control-characters off
## Mode config
set show-mode-in-prompt on
# vi insert mode has a blinking underscore as cursor
# default: prompt is prefixed with '(ins)'
set vi-ins-mode-string "+"\1\e[3 q\2
# vi normal/cmd mode has a blinking I beam as cursor
# default: prompt is prefixed with '(cmd)'
set vi-cmd-mode-string ":"\1\e[5 q\2
# CSI cursor style options '\e[<Ps>' for term w/ DECSCURSR support
# Supported by 'tmux' if 'set TERM=xterm-256color' in shell environment
# Source: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Functions-using-CSI-_-ordered-by-the-final-character_s_
# Ps = 0 -> blinking block.
# Ps = 1 -> blinking block (default).
# Ps = 2 -> steady block.
# Ps = 3 -> blinking underline.
# Ps = 4 -> steady underline.
# Ps = 5 -> blinking bar (xterm).
# Ps = 6 -> steady bar (xterm).
# Surround options with \1...\2 to comply with readline syntax requirements
# Color can be added too: e.g. 'set vi-cmd-mode-string "\1\e[1;31m\2:\1\e[0m\2"'
## Macro for key binding:
# Ctrl+S: insert $(...)
# Move to line begin with Ctrl+A ,put `$(` there.
# Move to end of line with Ctrl+E then put `)` there.
"\C-s": "\C-a$(\C-e)"
# Alt+S: prefix cmd line with `sudo` and place cursor at end of line.
"\es": "\C-asudo \C-e"
# Section below obtained from terminal
# $ bind -p | grep -v -e "(not bound)" -e "self-insert$" >> ~/.inputrc
"\C-j": accept-line
"\C-m": accept-line
"\eOD": backward-char
"\e[D": backward-char
"\C-h": backward-delete-char
"\C-?": backward-delete-char
"\e[1;3D": backward-word
"\e[1;5D": backward-word
"\eOH": beginning-of-line
"\e[1~": beginning-of-line
"\e[H": beginning-of-line
"\e[200~": bracketed-paste-begin
"\C-i": complete
"\e[3~": delete-char
"\eOF": end-of-line
"\e[4~": end-of-line
"\e[F": end-of-line
"\eOC": forward-char
"\e[C": forward-char
"\e[1;3C": forward-word
"\e[1;5C": forward-word
"\e[3;5~": kill-word
"\C-n": menu-complete
"\C-p": menu-complete-backward
"\eOB": next-history
"\e[B": next-history
"\e[2~": overwrite-mode
"\eOA": previous-history
"\e[A": previous-history
"\C-v": quoted-insert
"\C-r": reverse-search-history
"\C-t": transpose-chars
"\C-u": unix-line-discard
"\C-d": vi-eof-maybe
"\e": vi-movement-mode
"\C-w": vi-unix-word-rubout
"\C-y": yank