aboutsummaryrefslogtreecommitdiff
path: root/readline/inputrc
blob: f9007c2401cd0385cac74184435a7e2a810fd357 (plain) (blame)
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
# Don't mess with the eighth bit of characters
set input-meta on
set output-meta on

# Never ring any sort of bell during line reading
set bell-style none

# Let readline do stuff like word killing, not stty(1)
set bind-tty-special-chars off

# Ignore case when matching and completing paths
set completion-ignore-case on

# Treat underscores and hyphens the same way for completion purposes
set completion-map-case on

# Show me up to 5,000 completion items, don't be shy
set completion-query-items 5000

# Don't display control characters like ^C if I input them
set echo-control-characters off

# Expand tilde to full path on completion
set expand-tilde on

# Keep the cursor column when iterating through history
set history-preserve-point on

# Add a trailing slash for directories and symlinked directories
set mark-directories on
set mark-symlinked-directories on

# Don't match dotfiles unless there's a dot
set match-hidden-files off

# Don't paginate possible completions
set page-completions off

# Goes nicely with ls(1) -x/--format=across
set print-completions-horizontally on

# Don't actually modify my history
set revert-all-at-newline on

# Show multiple completions on first tab press
set show-all-if-ambiguous on

# Don't re-complete already completed text in the middle of a word
set skip-completed-text on

# Bash macros
$if Bash

    # Expand ! history with a spacebar press
    # Note that this makes your shell unusable if your Bash doesn't have
    # magic-space.  It's had this feature since 2.02, which is below the minimum
    # 2.05a supported by these dotfiles.
    Space: magic-space

    # Tab does traditional blocking completion
    Tab: complete
    # Alt+A cycles through completion options
    "\ea": menu-complete

    # Special completion keys for git(1)
    ## Branches
    "\C-xb": complete
    ## Tags
    "\C-xt": complete

    # Ctrl-Alt-L to clear screen; more ksh-like
    "\e\C-l": clear-screen

    # Alt-E (for exec) to prepend "exec " to a command and return to the end of
    # the line
    "\ee": "\C-aexec \C-e"
    # Alt-P (for procedure) to wrap current command in () { ... ; } and go to
    # the start of the line
    "\ep": "\C-a() { \C-e ; }\C-a"
    # Alt-S (for set) to wrap current command in (set -x ; ...)
    "\es": "\C-a(set -x ; \C-e)\C-b"

    # Alt-M (for muxer) to run tm(1df)
    "\em": "\C-utm\C-j\C-y"

    # Alt-' for escaped single-quote: 'don'\''t fear the reaper'
    "\e'": "'\\''"

    # Ctrl-Alt-B to move backward a shell-quoted word
    "\e\C-b": shell-backward-word
    # Ctrl-Alt-F to move forward a shell-quoted word
    "\e\C-f": shell-forward-word
    # Ctrl-Alt-W to delete a previous shell-quoted word
    "\e\C-w": shell-backward-kill-word

$endif

# bc macros
$if bc

    # Don't let bc complete filenames (!?)
    Tab:

$endif