-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.inputrc
53 lines (41 loc) · 1.51 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
# Useful keybindings
# Key Bindings | Description
# C-x (, C-x ) | Start/Stop macro recorder
# C-x e | Play last macro
# C-x P | Print out macro (Note you must bind the command to a key for this to work)
# M-<, M-> | Go to beginning/end of the history list
# C-r, C-s | Reverse/Forward isearch history
# M-p, M-n | Query search backward/forward through history list
# M-. | Yank (insert) last argument
# C-p, C-n, | Up, Down Previous/Next history entry
######### Bash Specific
C-M-e | Expand environment variable
M-! | Complete command
M-/ | Complete filename
M-@ | Complete hostname
M-$ | Complete variable
C-x C-e | Edit and execute command in Emacs
C-M-o | Expand using dynamic abbrev. (Unbound by default; see below)
######### Python
C-x h | Wrap prompt in !help( ... ) (for PDB)
C-x d | Wrap prompt in dir( ... )
set history-size 100000
# from https://www.masteringemacs.org/article/keyboard-shortcuts-every-command-line-hacker-should-know-about-gnu-readline
# deafult 500ms too quick
set keyseq-timeout 1200
# colored autocomplete
set colored-stats on
set colored-completion-prefix on
# print keyboard macros
"\C-xP": print-last-kbd-macro
# wrap in fzf macro
"\C-xF": "\C-e | fzf)\C-a(\C-a$\C-b\C-a"
# dynamic abbreviation
"\e\C-o": dabbrev-expand
### Python
$if Python
# Wrap prompt in !help( ... ) (for PDB)
"\C-xh": "\C-a!help(\C-e)"
# Wrap prompt in dir( ... )
"\C-xd": "\C-adir(\C-e)"
$endif