-
Notifications
You must be signed in to change notification settings - Fork 0
/
inputrc
109 lines (99 loc) · 3.24 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
set input-meta on
set output-meta on
set bell-style none
set show-all-if-ambiguous on
set completion-ignore-case off
set completion-map-case off
set page-completions On
set visible-stats On
set mark-symlinked-directories On
set enable-keypad on
# incremental history search, both reverse and forward with Ctrl-r/]
"\C-r": reverse-search-history
# often, Ctrl-s (default for forward search) is usually masked by tty's STOP
# moreover, things like "\e\C-r" reset the isearch keyword
# so, overriding Ctrl-] (default character-search) seems to be the best choice
"\C-]": forward-search-history
# better history search with Arrow keys: Up/Down
"\e[A": history-search-backward
"\e[B": history-search-forward
"\eOA": history-search-backward
"\eOB": history-search-forward
# character search with Meta-] and Ctrl-Meta-]
"\e]": character-search
"\e\C-]": character-search-backward
# backward/forward words by space with Meta-Shift-B/F
"\eB": "\C-b\e\C-] \C-f"
"\eF": "\e] "
"\e|": delete-horizontal-space
# Orig: easier backward/forward path components with Meta-Ctrl-B/F
# My : easier backward/forward path components with Meta-Shift-B/F
"\e\C-b": "\C-b\e\C-]/\C-f"
"\e\C-f": "\e]/"
# When you want to do ls -l|less you'd type ls -l and press
# <Ctrl-H> instead of <ENTER>.
# http://serverfault.com/a/31870/41731
"\C-h": " | less -FRSX\C-m"
# Use Ctrl+← and Ctrl+→ (or Alt/Meta, or Esc) to move between words.
"\e[1;5D": backward-word
"\e[1;3D": backward-word
"\e[5D": backward-word
"\e\e[D": backward-word
"\e[1;5C": forward-word
"\e[1;3C": forward-word
"\e[5C": forward-word
"\e\e[C": forward-word
"^[^[[C": forward-word # Meta-RightArrow
"^[^[[D": backward-word # Meta-LeftArrow
$if mode=emacs
# allow the use of the Home/End keys
"\e[1~": beginning-of-line
"\e[4~": end-of-line
# allow the use of the Delete/Insert keys
"\e[3~": delete-char
"\e[2~": quoted-insert
# mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving
"\e[1;5C": forward-word
"\e[1;5D": backward-word
"\e[5C": forward-word
"\e[5D": backward-word
"\e\e[C": forward-word
"\e\e[D": backward-word
# rxvt
$if term=rxvt
"\e[8~": end-of-line
"\eOc": forward-word
"\eOd": backward-word
$endif
# alternate mappings for "page up" and "page down" to search the history
"\e[5~": history-search-backward
"\e[6~": history-search-forward
# # for non RH/Debian xterm, can't hurt for RH/Debian xterm
# "\eOH": beginning-of-line
# "\eOF": end-of-line
#
# # for freebsd console
# "\e[H": beginning-of-line
# "\e[F": end-of-line
$endif
# http://www.ukuug.org/events/linux2003/papers/bash_tips/
$if Bash
# Do history expansion ! when space is pressed
Space: magic-space
# Insert-Option Macro (enhanced to handle multi-word commands)
"\eo": "\C-p\C-a\e] "
# a better backward/forward words by space with Meta-Shift-B/F
"\eviB": vi-bWord
"\eviW": vi-fWord
"\eviE": vi-eWord
"\eB": "\eviB"
"\eF": "\C-f\eviE\C-f"
# backward/forward shell words by Meta-Left/Right
"\e\e[D": shell-backward-word
"\e\e[C": shell-forward-word
# and a kill too
"\eH": shell-backward-kill-word
"\eD": shell-kill-word
# IGNOREEOF
"\e\C-d": "exit\C-m"
$endif