-
Notifications
You must be signed in to change notification settings - Fork 1
/
.inputrc
62 lines (52 loc) · 1.64 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
$include /etc/inputrc
# using / enter vi mode
# set editing-mode vi
set completion-ignore-case on
# reload config
"\e[15~": re-read-init-file
"\C-x\C-r": re-read-init-file
# "\C-e": edit-and-execute-command # removed because is not compatible with tmux-resurrect (save history)
"\ee": edit-and-execute-command
"\ev": edit-and-execute-command
#"\M-a": "\C-x\C-e" # \M not working?
"\C-l": clear-screen
# use ctrl-arrow to move and delete
"\e[1;5C": forward-word
"\e[1;5D": backward-word
"\e[1;6C": kill-word
"\e[1;6D": backward-kill-word
# use home/end to move and delete
"\e[1~": beginning-of-line
"\e[4~": end-of-line
"\e[1;2F": kill-line
"\e[1;2H": backward-kill-line
# Add a comment to the beginning of the line
"\C-q": insert-comment
# commands (see http://www.catonmat.net/download/bash-vi-editing-mode-cheat-sheet.pdf)
#"\eu": undo
#"\C-p": yank-nth-arg
#"\C-p": vi-yank-arg
# expand previous arguments:
"\e\C-i": shell-expand-line
# ! expand keyword
# : expand separator
# 0 first word
# $ last word
# i-j words from i to j ($ can be used)
# * all except the first (!* also works) (equivalent to !:1-$)
# s/foo/bar/ one time substitution 'foo' by 'bar'
# gs/foo/bar/ substitute 'foo' by 'bar'
# & or g& repeat last substitution
# p only print
#
# Vi mode
$if mode=vi
set keymap vi-command
# these are for vi-command mode
#Control-l: clear-screen
# paste previous command-line, except for the first command-word
"p": "i !!*"
set keymap vi-insert
# these are for vi-insert mode
#Control-l: clear-screen
$endif