path: root/readline/inputrc
blob: dd284f0b3ed99d0b7d7822483eacbf0bbc5919ba (plain) (tree)













# 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

# Jump to the matching parenthesis briefly when closing one
set blink-matching-paren on

# 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

# 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

# Killing words should stop at /
# <https://www.youtube.com/watch?v=VCiRpM_rbF0>
"\C-w": backward-kill-word

# Bash macros
$if Bash

    # Expand ! history with a spacebar press
    Space: magic-space

    # 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-H (for home) to go $HOME
    "\eh": "\C-ucd\C-j\C-y"
    # Alt-L (for ls) to run ls -Al
    "\el": "\C-uls -Al\C-j\C-y"
    # Alt-M (for muxer) to run tmux
    "\em": "\C-utmux\C-j\C-y"
    # Alt-T (for todo) to edit my to-do file with td(1df)
    "\et": "\C-atd\C-j\C-y"

    # 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


# Don't let bc complete filenames (!?)
$if bc