$include /etc/inputrc # If the backslash binding gets screwed up, run: bind '"\134": self-insert' set expand-tilde on # This is bad because non-files get shown in flashing white-on-red text ## set colored-stats on set match-hidden-files off set revert-all-at-newline on $if version >= 7.0 set blink-matching-paren on set enable-bracketed-paste on $endif # makes escape sequences fail sensibly if they don't have a mapping "\e": skip-csi-sequence "\e,": redraw-current-line # == editing == # Replaces M-\ "\C-x\134": delete-horizontal-space # == movement == "\eB": shell-backward-word "\eF": shell-forward-word $if term=putty "\eOD": shell-backward-word "\eOC": shell-forward-word $endif # == completion == "\e%": complete-filename "\C-x\C-i": complete-into-braces ## "\ei": menu-complete "\e[Z": menu-complete-backward # shift-Tab cycles backwards "\e[18~": menu-complete # F7 cycles forwards "\e[17~": menu-complete-backward # F6 cycles backwards # == region & line == "\C-x\C-w": unix-filename-rubout "\e\C-w": kill-region "\eD": shell-kill-word # -- tcsh compatibility -- "\ew": copy-region-as-kill # == strings == # to insert Unicode characters, just insert the corresponding bytes "\e[E": "\xc2\xb7" # The 5 key with numlock off inserts ยท # Can't specify a quoted backslash so have to use octal "\e\134": " | less -S" "\e|": " | less -R" # Ctrl-\ "\034": " | view -c 'set ft=json' -" # -- jobs -- $if term=linux "\e[[A": " fg\n" # F1 goes to the current buffer "\e[25~": " %-\n" # S-F1 goes to the previous buffer "\e[[B": " jobs\n" # F2 shows the jobs list $else $if term=putty "\e[11~": " fg\n" # F1 goes to the current buffer "\e[23~": " %-\n" # S-F1 (or F11!) goes to the previous buffer "\e[12~": " jobs\n" # F2 shows the jobs list $else "\eOP": " fg\n" # F1 goes to the current buffer "\eO1;2P": " %-\n" # S-F1 goes to the previous buffer "\eOQ": " jobs\n" # F2 shows the jobs list "\e[P": " fg\n" # F1 goes to the current buffer "\e[1;2P": " %-\n" # S-F1 goes to the previous buffer "\e[Q": " jobs\n" # F2 shows the jobs list $endif $endif "\C-x1": " %1\n" "\C-x2": " %2\n" "\C-x3": " %3\n" "\C-x4": " %4\n" "\C-x5": " %5\n" "\C-x6": " %6\n" "\C-x7": " %7\n" "\C-x8": " %8\n" "\C-x9": " %9\n" "\C-x0": " %10\n" # -- dirs -- "\e[20~": "popd\n" # F9 $if term=putty "\e[33~": " dirs\n" # S-F9 $else "\e[20;2~": " dirs\n" # S-F9 "\e[20;5~": "pushd " # C-F9 "\e[20;6~": "pushd ~\n" # C-S-F9 $endif # -- other -- "\e[19~": "locate " # F8 $if term=putty # need to protect S-F1 $else "\e[23~": 'find . \( -name YYYYY -o -name ZZZZZ \) -prune -o -type f -print0 | xargs -0 ' # F11 "\e[23;5~": "find . -type f -print0 | xargs -0 -I '{}' mkdir -p '{}/YYYYY'" # C-F11 $endif "\e[24~": " sudo -v\n" # F12 ## "\e": "" # F # == history == # mappings for "page up" and "page down" to step to the beginning/end # of the history "\e[5~": beginning-of-history "\e[6~": end-of-history # -- search based on starting contents of line -- # F3 searches backwards # F4 searches forwards $if term=linux "\e[[C": history-search-backward "\e[[D": history-search-forward "\e[[[C": history-search-backward "\e[[[D": history-search-forward $else $if term=putty "\e[13~": history-search-backward "\e[14~": history-search-forward $else # (for gterm) "\eOR": history-search-backward "\eOS": history-search-forward "\e[R": history-search-backward "\e[S": history-search-forward $endif $endif # Ctrl-up/down bindings $if term=putty "\eOA": history-search-backward "\eOB": history-search-forward $else # (for gterm) "\e[5A": history-search-backward "\e[1;5A": history-search-backward "\e[5B": history-search-forward "\e[1;5B": history-search-forward $endif # M-P and M-N (same as tcsh) "\eP": history-search-backward "\eN": history-search-forward # -- non-incremental search -- $if term=linux "\e[[E": non-incremental-reverse-search-history # F5 searches backwards "\e[31~": non-incremental-forward-search-history # S-F5 searches forwards $else "\e[15~": non-incremental-reverse-search-history # F5 searches backwards "\e[15;2~": non-incremental-forward-search-history # S-F5 searches forwards "\e[15;5~": non-incremental-reverse-search-history-again # C-F5 searches backwards again "\e[15;6~": non-incremental-forward-search-history-again # C-S-F5 searches forwards again $endif # == miscellaneous tcsh compatibility == # note: both of these replace existing (crappy) bindings "\e[2~": overwrite-mode "\e/": dabbrev-expand # *** TO-DO ***