xref: /openbsd-src/gnu/lib/libreadline/examples/Inputrc (revision 15b117eae8ea0caffec2fbd5cbd366a5ccee20ab)
11acd27e7Smillert# My ~/.inputrc file is in -*- text -*- for easy editing with Emacs.
21acd27e7Smillert#
31acd27e7Smillert# Notice the various bindings which are conditionalized depending
41acd27e7Smillert# on which program is running, or what terminal is active.
51acd27e7Smillert#
61acd27e7Smillert
7*15b117eaSkettenis# Copyright (C) 1989-2002 Free Software Foundation, Inc.
8*15b117eaSkettenis#
9*15b117eaSkettenis# This program is free software; you can redistribute it and/or modify
10*15b117eaSkettenis# it under the terms of the GNU General Public License as published by
11*15b117eaSkettenis# the Free Software Foundation; either version 2, or (at your option)
12*15b117eaSkettenis# any later version.
13*15b117eaSkettenis#
14*15b117eaSkettenis# This program is distributed in the hope that it will be useful,
15*15b117eaSkettenis# but WITHOUT ANY WARRANTY; without even the implied warranty of
16*15b117eaSkettenis# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17*15b117eaSkettenis# GNU General Public License for more details.
18*15b117eaSkettenis#
19*15b117eaSkettenis# You should have received a copy of the GNU General Public License
20*15b117eaSkettenis# along with this program; if not, write to the Free Software
21*15b117eaSkettenis# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
22*15b117eaSkettenis
231acd27e7Smillert# In all programs, all terminals, make sure this is bound.
241acd27e7Smillert"\C-x\C-r": re-read-init-file
251acd27e7Smillert
261acd27e7Smillert# Hp terminals (and some others) have ugly default behaviour for C-h.
271acd27e7Smillert"\C-h": backward-delete-char
281acd27e7Smillert"\e\C-h": backward-kill-word
291acd27e7Smillert"\C-xd": dump-functions
301acd27e7Smillert
311acd27e7Smillert# In xterm windows, make the arrow keys do the right thing.
321acd27e7Smillert$if TERM=xterm
331acd27e7Smillert"\e[A": previous-history
341acd27e7Smillert"\e[B": next-history
351acd27e7Smillert"\e[C": forward-char
361acd27e7Smillert"\e[D": backward-char
371acd27e7Smillert
381acd27e7Smillert# alternate arrow key prefix
391acd27e7Smillert"\eOA": previous-history
401acd27e7Smillert"\eOB": next-history
411acd27e7Smillert"\eOC": forward-char
421acd27e7Smillert"\eOD": backward-char
431acd27e7Smillert
441acd27e7Smillert# Under Xterm in Bash, we bind local Function keys to do something useful.
451acd27e7Smillert$if Bash
461acd27e7Smillert"\e[11~": "Function Key 1"
471acd27e7Smillert"\e[12~": "Function Key 2"
481acd27e7Smillert"\e[13~": "Function Key 3"
491acd27e7Smillert"\e[14~": "Function Key 4"
501acd27e7Smillert"\e[15~": "Function Key 5"
511acd27e7Smillert
521acd27e7Smillert# I know the following escape sequence numbers are 1 greater than
531acd27e7Smillert# the function key.  Don't ask me why, I didn't design the xterm terminal.
541acd27e7Smillert"\e[17~": "Function Key 6"
551acd27e7Smillert"\e[18~": "Function Key 7"
561acd27e7Smillert"\e[19~": "Function Key 8"
571acd27e7Smillert"\e[20~": "Function Key 9"
581acd27e7Smillert"\e[21~": "Function Key 10"
591acd27e7Smillert$endif
601acd27e7Smillert$endif
611acd27e7Smillert
621acd27e7Smillert# For Bash, all terminals, add some Bash specific hacks.
631acd27e7Smillert$if Bash
641acd27e7Smillert"\C-xv": show-bash-version
651acd27e7Smillert"\C-x\C-e": shell-expand-line
661acd27e7Smillert
671acd27e7Smillert# Here is one for editing my path.
681acd27e7Smillert"\C-xp": "$PATH\C-x\C-e\C-e\"\C-aPATH=\":\C-b"
691acd27e7Smillert
701acd27e7Smillert# Make C-x r read my mail in emacs.
711acd27e7Smillert# "\C-xr": "emacs -f rmail\C-j"
721acd27e7Smillert$endif
731acd27e7Smillert
741acd27e7Smillert# For FTP, different hacks:
751acd27e7Smillert$if Ftp
761acd27e7Smillert"\C-xg": "get \M-?"
771acd27e7Smillert"\C-xt": "put \M-?"
781acd27e7Smillert"\M-.": yank-last-arg
791acd27e7Smillert$endif
801acd27e7Smillert
811acd27e7Smillert" ": self-insert
82