Changeset View
Changeset View
Standalone View
Standalone View
lib/libedit/editrc.5
.\" $NetBSD: editrc.5,v 1.29 2014/12/25 13:39:41 wiz Exp $ | .\" $NetBSD: editrc.5,v 1.33 2017/06/27 01:22:58 kre Exp $ | ||||
.\" | .\" | ||||
.\" Copyright (c) 1997-2000 The NetBSD Foundation, Inc. | .\" Copyright (c) 1997-2000 The NetBSD Foundation, Inc. | ||||
.\" All rights reserved. | .\" All rights reserved. | ||||
.\" | .\" | ||||
.\" This file was contributed to The NetBSD Foundation by Luke Mewburn. | .\" This file was contributed to The NetBSD Foundation by Luke Mewburn. | ||||
.\" | .\" | ||||
.\" Redistribution and use in source and binary forms, with or without | .\" Redistribution and use in source and binary forms, with or without | ||||
.\" modification, are permitted provided that the following conditions | .\" modification, are permitted provided that the following conditions | ||||
Show All 13 Lines | |||||
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||||
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||||
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||||
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||||
.\" POSSIBILITY OF SUCH DAMAGE. | .\" POSSIBILITY OF SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd December 25, 2014 | .Dd May 22, 2016 | ||||
.Dt EDITRC 5 | .Dt EDITRC 5 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm editrc | .Nm editrc | ||||
.Nd configuration file for editline library | .Nd configuration file for editline library | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.Nm | .Nm | ||||
.Sh DESCRIPTION | .Sh DESCRIPTION | ||||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | |||||
library has some builtin commands, which affect the way | library has some builtin commands, which affect the way | ||||
that the line editing and history functions operate. | that the line editing and history functions operate. | ||||
These are based on similar named builtins present in the | These are based on similar named builtins present in the | ||||
.Xr tcsh 1 | .Xr tcsh 1 | ||||
shell. | shell. | ||||
.Pp | .Pp | ||||
The following builtin commands are available: | The following builtin commands are available: | ||||
.Bl -tag -width 4n | .Bl -tag -width 4n | ||||
.It Ic bind Oo Fl a Oc Oo Fl e Oc Oo Fl k Oc Oo Fl l Oc Oo Fl r Oc \ | .It Ic bind Oo Fl aeklrsv Oc Op Ar key Op Ar command | ||||
Oo Fl s Oc Oo Fl v Oc Oo Ar key Oo Ar command Oc Oc | Without options and arguments, list all bound keys and macros, and | ||||
Without options, list all bound keys, and the editor command to which | the editor command or input string to which each one is bound. | ||||
each is bound. | If only | ||||
If | |||||
.Ar key | .Ar key | ||||
is supplied, show the bindings for | is supplied, show the binding for that key or macro. | ||||
.Ar key . | |||||
If | If | ||||
.Ar key command | .Ar key command | ||||
is supplied, bind | is supplied, bind the editor | ||||
.Ar command | .Ar command | ||||
to | to that key or macro. | ||||
.Ar key . | .Pp | ||||
Options include: | The options are as follows: | ||||
.Bl -tag -width 4n | .Bl -tag -width 4n | ||||
.It Fl a | .It Fl a | ||||
List or change key bindings in the | List or change key bindings in the | ||||
.Xr vi 1 | .Xr vi 1 | ||||
mode alternate (command mode) key map. | mode alternate (command mode) key map. | ||||
.It Fl e | .It Fl e | ||||
Bind all keys to the standard GNU Emacs-like bindings. | Bind all keys to the standard GNU Emacs-like bindings. | ||||
.It Fl k | .It Fl k | ||||
.Ar key | .Ar key | ||||
is interpreted as a symbolic arrow key name, which may be one of | is interpreted as a symbolic arrow key name, which may be one of | ||||
.Sq up , | .Sq up , | ||||
.Sq down , | .Sq down , | ||||
.Sq left | .Sq left | ||||
or | or | ||||
.Sq right . | .Sq right . | ||||
.It Fl l | .It Fl l | ||||
List all editor commands and a short description of each. | List all editor commands and a short description of each. | ||||
.It Fl r | .It Fl r | ||||
Remove a key's binding. | Remove the binding of the key or macro | ||||
.Ar key . | |||||
.It Fl s | .It Fl s | ||||
Define a keyboard macro rather than a key binding or command macro: | |||||
.Ar command | .Ar command | ||||
is taken as a literal string and treated as terminal input when | is taken as a literal string and appended to the input queue whenever | ||||
.Ar key | .Ar key | ||||
is typed. | is typed. | ||||
Bound keys in | Bound keys and macros in | ||||
.Ar command | .Ar command | ||||
are themselves reinterpreted, and this continues for ten levels of | are themselves reinterpreted, and this continues for ten levels of | ||||
interpretation. | interpretation. | ||||
.It Fl v | .It Fl v | ||||
Bind all keys to the standard | Bind all keys to the standard | ||||
.Xr vi 1 Ns -like | .Xr vi 1 Ns -like | ||||
bindings. | bindings. | ||||
.El | .El | ||||
.Pp | .Pp | ||||
.Ar command | The | ||||
may be one of the commands documented in | .Xr editline 7 | ||||
.Sx "EDITOR COMMANDS" | manual documents all editor commands and contains more information | ||||
below, or another key. | about macros and the input queue. | ||||
.Pp | .Pp | ||||
.Ar key | .Ar key | ||||
and | and | ||||
.Ar command | .Ar command | ||||
can contain control characters of the form | can contain control characters of the form | ||||
.Sm off | .Sm off | ||||
.Sq No ^ Ar character | .Sq No ^ Ar character | ||||
.Sm on | .Sm on | ||||
▲ Show 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | |||||
.Ar val , | .Ar val , | ||||
as defined in | as defined in | ||||
.Xr termcap 5 . | .Xr termcap 5 . | ||||
No sanity checking is done. | No sanity checking is done. | ||||
.It Ic setty Oo Fl a Oc Oo Fl d Oc Oo Fl q Oc Oo Fl x Oc Oo Ar +mode Oc \ | .It Ic setty Oo Fl a Oc Oo Fl d Oc Oo Fl q Oc Oo Fl x Oc Oo Ar +mode Oc \ | ||||
Oo Ar -mode Oc Oo Ar mode Oc Oo Ar char=c Oc | Oo Ar -mode Oc Oo Ar mode Oc Oo Ar char=c Oc | ||||
Control which tty modes that | Control which tty modes that | ||||
.Nm | .Nm | ||||
will not allow the user to change. | won't allow the user to change. | ||||
.Fl d , | .Fl d , | ||||
.Fl q | .Fl q | ||||
or | or | ||||
.Fl x | .Fl x | ||||
tells | tells | ||||
.Ic setty | .Ic setty | ||||
to act on the | to act on the | ||||
.Sq edit , | .Sq edit , | ||||
Show All 33 Lines | |||||
.Ar value | .Ar value | ||||
is empty | is empty | ||||
then the character is set to | then the character is set to | ||||
.Dv _POSIX_VDISABLE . | .Dv _POSIX_VDISABLE . | ||||
.It Ic telltc | .It Ic telltc | ||||
List the values of all the terminal capabilities (see | List the values of all the terminal capabilities (see | ||||
.Xr termcap 5 ) . | .Xr termcap 5 ) . | ||||
.El | .El | ||||
.Sh EDITOR COMMANDS | .Sh ENVIRONMENT | ||||
The following editor commands are available for use in key bindings: | .Bl -tag -width "~/.editrcXXX" | ||||
.\" Section automatically generated with makelist | .It Ev EDITRC | ||||
.Bl -tag -width 4n | Names the default configuration file for the | ||||
.It Ic vi-paste-next | .Xr editline 3 | ||||
Vi paste previous deletion to the right of the cursor. | library. | ||||
.It Ic vi-paste-prev | |||||
Vi paste previous deletion to the left of the cursor. | |||||
.It Ic vi-prev-big-word | |||||
Vi move to the previous space delimited word. | |||||
.It Ic vi-prev-word | |||||
Vi move to the previous word. | |||||
.It Ic vi-next-big-word | |||||
Vi move to the next space delimited word. | |||||
.It Ic vi-next-word | |||||
Vi move to the next word. | |||||
.It Ic vi-change-case | |||||
Vi change case of character under the cursor and advance one character. | |||||
.It Ic vi-change-meta | |||||
Vi change prefix command. | |||||
.It Ic vi-insert-at-bol | |||||
Vi enter insert mode at the beginning of line. | |||||
.It Ic vi-replace-char | |||||
Vi replace character under the cursor with the next character typed. | |||||
.It Ic vi-replace-mode | |||||
Vi enter replace mode. | |||||
.It Ic vi-substitute-char | |||||
Vi replace character under the cursor and enter insert mode. | |||||
.It Ic vi-substitute-line | |||||
Vi substitute entire line. | |||||
.It Ic vi-change-to-eol | |||||
Vi change to end of line. | |||||
.It Ic vi-insert | |||||
Vi enter insert mode. | |||||
.It Ic vi-add | |||||
Vi enter insert mode after the cursor. | |||||
.It Ic vi-add-at-eol | |||||
Vi enter insert mode at end of line. | |||||
.It Ic vi-delete-meta | |||||
Vi delete prefix command. | |||||
.It Ic vi-end-big-word | |||||
Vi move to the end of the current space delimited word. | |||||
.It Ic vi-end-word | |||||
Vi move to the end of the current word. | |||||
.It Ic vi-undo | |||||
Vi undo last change. | |||||
.It Ic vi-command-mode | |||||
Vi enter command mode (use alternative key bindings). | |||||
.It Ic vi-zero | |||||
Vi move to the beginning of line. | |||||
.It Ic vi-delete-prev-char | |||||
Vi move to previous character (backspace). | |||||
.It Ic vi-list-or-eof | |||||
Vi list choices for completion or indicate end of file if empty line. | |||||
.It Ic vi-kill-line-prev | |||||
Vi cut from beginning of line to cursor. | |||||
.It Ic vi-search-prev | |||||
Vi search history previous. | |||||
.It Ic vi-search-next | |||||
Vi search history next. | |||||
.It Ic vi-repeat-search-next | |||||
Vi repeat current search in the same search direction. | |||||
.It Ic vi-repeat-search-prev | |||||
Vi repeat current search in the opposite search direction. | |||||
.It Ic vi-next-char | |||||
Vi move to the character specified next. | |||||
.It Ic vi-prev-char | |||||
Vi move to the character specified previous. | |||||
.It Ic vi-to-next-char | |||||
Vi move up to the character specified next. | |||||
.It Ic vi-to-prev-char | |||||
Vi move up to the character specified previous. | |||||
.It Ic vi-repeat-next-char | |||||
Vi repeat current character search in the same search direction. | |||||
.It Ic vi-repeat-prev-char | |||||
Vi repeat current character search in the opposite search direction. | |||||
.It Ic vi-match | |||||
Vi go to matching () {} or []. | |||||
.It Ic vi-undo-line | |||||
Vi undo all changes to line. | |||||
.It Ic vi-to-column | |||||
Vi go to specified column. | |||||
.It Ic vi-yank-end | |||||
Vi yank to end of line. | |||||
.It Ic vi-yank | |||||
Vi yank. | |||||
.It Ic vi-comment-out | |||||
Vi comment out current command. | |||||
.It Ic vi-alias | |||||
Vi include shell alias. | |||||
.It Ic vi-to-history-line | |||||
Vi go to specified history file line.. | |||||
.It Ic vi-histedit | |||||
Vi edit history line with vi. | |||||
.It Ic vi-history-word | |||||
Vi append word from previous input line. | |||||
.It Ic vi-redo | |||||
Vi redo last non-motion command. | |||||
.It Ic em-delete-or-list | |||||
Delete character under cursor or list completions if at end of line. | |||||
.It Ic em-delete-next-word | |||||
Cut from cursor to end of current word. | |||||
.It Ic em-yank | |||||
Paste cut buffer at cursor position. | |||||
.It Ic em-kill-line | |||||
Cut the entire line and save in cut buffer. | |||||
.It Ic em-kill-region | |||||
Cut area between mark and cursor and save in cut buffer. | |||||
.It Ic em-copy-region | |||||
Copy area between mark and cursor to cut buffer. | |||||
.It Ic em-gosmacs-transpose | |||||
Exchange the two characters before the cursor. | |||||
.It Ic em-next-word | |||||
Move next to end of current word. | |||||
.It Ic em-upper-case | |||||
Uppercase the characters from cursor to end of current word. | |||||
.It Ic em-capitol-case | |||||
Capitalize the characters from cursor to end of current word. | |||||
.It Ic em-lower-case | |||||
Lowercase the characters from cursor to end of current word. | |||||
.It Ic em-set-mark | |||||
Set the mark at cursor. | |||||
.It Ic em-exchange-mark | |||||
Exchange the cursor and mark. | |||||
.It Ic em-universal-argument | |||||
Universal argument (argument times 4). | |||||
.It Ic em-meta-next | |||||
Add 8th bit to next character typed. | |||||
.It Ic em-toggle-overwrite | |||||
Switch from insert to overwrite mode or vice versa. | |||||
.It Ic em-copy-prev-word | |||||
Copy current word to cursor. | |||||
.It Ic em-inc-search-next | |||||
Emacs incremental next search. | |||||
.It Ic em-inc-search-prev | |||||
Emacs incremental reverse search. | |||||
.It Ic ed-end-of-file | |||||
Indicate end of file. | |||||
.It Ic ed-insert | |||||
Add character to the line. | |||||
.It Ic ed-delete-prev-word | |||||
Delete from beginning of current word to cursor. | |||||
.It Ic ed-delete-next-char | |||||
Delete character under cursor. | |||||
.It Ic ed-kill-line | |||||
Cut to the end of line. | |||||
.It Ic ed-move-to-end | |||||
Move cursor to the end of line. | |||||
.It Ic ed-move-to-beg | |||||
Move cursor to the beginning of line. | |||||
.It Ic ed-transpose-chars | |||||
Exchange the character to the left of the cursor with the one under it. | |||||
.It Ic ed-next-char | |||||
Move to the right one character. | |||||
.It Ic ed-prev-word | |||||
Move to the beginning of the current word. | |||||
.It Ic ed-prev-char | |||||
Move to the left one character. | |||||
.It Ic ed-quoted-insert | |||||
Add the next character typed verbatim. | |||||
.It Ic ed-digit | |||||
Adds to argument or enters a digit. | |||||
.It Ic ed-argument-digit | |||||
Digit that starts argument. | |||||
.It Ic ed-unassigned | |||||
Indicates unbound character. | |||||
.It Ic ed-tty-sigint | |||||
Tty interrupt character. | |||||
.It Ic ed-tty-dsusp | |||||
Tty delayed suspend character. | |||||
.It Ic ed-tty-flush-output | |||||
Tty flush output characters. | |||||
.It Ic ed-tty-sigquit | |||||
Tty quit character. | |||||
.It Ic ed-tty-sigtstp | |||||
Tty suspend character. | |||||
.It Ic ed-tty-stop-output | |||||
Tty disallow output characters. | |||||
.It Ic ed-tty-start-output | |||||
Tty allow output characters. | |||||
.It Ic ed-newline | |||||
Execute command. | |||||
.It Ic ed-delete-prev-char | |||||
Delete the character to the left of the cursor. | |||||
.It Ic ed-clear-screen | |||||
Clear screen leaving current line at the top. | |||||
.It Ic ed-redisplay | |||||
Redisplay everything. | |||||
.It Ic ed-start-over | |||||
Erase current line and start from scratch. | |||||
.It Ic ed-sequence-lead-in | |||||
First character in a bound sequence. | |||||
.It Ic ed-prev-history | |||||
Move to the previous history line. | |||||
.It Ic ed-next-history | |||||
Move to the next history line. | |||||
.It Ic ed-search-prev-history | |||||
Search previous in history for a line matching the current. | |||||
.It Ic ed-search-next-history | |||||
Search next in history for a line matching the current. | |||||
.It Ic ed-prev-line | |||||
Move up one line. | |||||
.It Ic ed-next-line | |||||
Move down one line. | |||||
.It Ic ed-command | |||||
Editline extended command. | |||||
.El | .El | ||||
.\" End of section automatically generated with makelist | |||||
.Sh FILES | .Sh FILES | ||||
.Bl -tag -width "~/.editrcXXX" | .Bl -tag -width "~/.editrcXXX" | ||||
.It Pa ~/.editrc | .It Pa ~/.editrc | ||||
User configuration file for the | Last resort, if no other file is specified, | ||||
user configuration file for the | |||||
.Xr editline 3 | .Xr editline 3 | ||||
library. | library. | ||||
.El | .El | ||||
.Sh SEE ALSO | .Sh SEE ALSO | ||||
.Xr editline 3 , | .Xr editline 3 , | ||||
.Xr regex 3 , | .Xr regex 3 , | ||||
.Xr termcap 5 | .Xr termcap 5 , | ||||
.Xr editline 7 | |||||
.Sh AUTHORS | .Sh AUTHORS | ||||
.An -nosplit | .An -nosplit | ||||
The | The | ||||
.Nm editline | .Nm editline | ||||
library was written by | library was written by | ||||
.An Christos Zoulas , | .An Christos Zoulas , | ||||
and this manual was written by | and this manual was written by | ||||
.An Luke Mewburn , | .An Luke Mewburn , | ||||
with some sections inspired by | with some sections inspired by | ||||
.Xr tcsh 1 . | .Xr tcsh 1 . |