1 .\" $OpenBSD: editrc.5,v 1.26 2013/01/10 14:21:47 jmc Exp $
2 .\" $NetBSD: editrc.5,v 1.24 2009/04/11 22:17:52 wiz Exp $
4 .\" Copyright (c) 1997-2000 The NetBSD Foundation, Inc.
5 .\" All rights reserved.
7 .\" This file was contributed to The NetBSD Foundation by Luke Mewburn.
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
18 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 .\" POSSIBILITY OF SUCH DAMAGE.
30 .Dd $Mdocdate: January 10 2013 $
35 .Nd configuration file for editline library
41 file defines various settings to be used by the
45 The format of each line is:
47 .Dl [prog:]command [arg ...]
58 is the program name string that a program defines when it calls
65 will be executed for any program which matches
72 regular expression, in which case
74 will be executed for any program that matches the regular expression.
80 is executed for all programs.
84 library has some builtin commands, which affect the way
85 that the line editing and history functions operate.
86 These are based on similar named builtins present in the tcsh shell.
88 The following builtin commands are available:
90 .It Ic bind Fl aeklrsv Xo
91 .Op Ar key Op Ar command
93 Without options, list all bound keys, and the editor command to which
97 is supplied, show the bindings for
108 List or change key bindings in the
110 mode alternate (command mode) key map.
112 Bind all keys to the standard GNU Emacs-like bindings.
115 is interpreted as a symbolic arrow key name, which may be one of
122 List all editor commands and a short description of each.
124 Remove a key's binding.
127 is taken as a literal string and treated as terminal input when
132 are themselves reinterpreted, and this continues for ten levels of
135 Bind all keys to the standard
141 may be one of the commands documented in
142 .Sx "EDITOR COMMANDS"
143 below, or another key.
148 can contain control characters of the form
150 .Sq No ^ Ar character
156 and the following backslashed escape sequences:
158 .Bl -tag -compact -offset indent -width 4n
178 The ASCII character corresponding to the octal number
183 nullifies the special meaning of the following character,
184 if it has any, notably
188 .It Ic echotc Oo Fl sv Oc Ar arg Ar ...
189 Exercise terminal capabilities given in
201 the value of that capability is printed, with
205 indicating that the terminal does or does not have that capability.
208 returns an empty string for non-existent capabilities, rather than
211 causes messages to be verbose.
212 .It Ic edit Op Li on | Li off
213 Enable or disable the
215 functionality in a program.
216 .It Ic history Ar list | Ar size Dv n | Ar unique Dv n
219 command lists all entries in the history.
222 command sets the history size to
227 command controls if history should keep duplicate entries.
230 is non zero, only keep unique history entries.
233 is zero, then keep all entries (the default).
234 .It Ic settc Ar cap Ar val
235 Set the terminal capability
241 No sanity checking is done.
249 Control which tty modes that
251 won't allow the user to change.
263 set of tty modes respectively; defaulting to
266 Without other arguments,
268 lists the modes in the chosen set which are fixed on
277 lists all tty modes in the chosen set regardless of the setting.
285 on or off or removes control of
290 can also be used to set tty characters to particular values using
295 then the character is set to
296 .Dv _POSIX_VDISABLE .
298 List the values of all the terminal capabilities (see
302 The following editor commands are available for use in key bindings:
303 .\" Section automatically generated with makelist
306 Vi paste previous deletion to the right of the cursor.
308 Vi paste previous deletion to the left of the cursor.
309 .It Ic vi-prev-big-word
310 Vi move to the previous space delimited word.
312 Vi move to the previous word.
313 .It Ic vi-next-big-word
314 Vi move to the next space delimited word.
316 Vi move to the next word.
317 .It Ic vi-change-case
318 Vi change case of character under the cursor and advance one character.
319 .It Ic vi-change-meta
320 Vi change prefix command.
321 .It Ic vi-insert-at-bol
322 Vi enter insert mode at the beginning of line.
323 .It Ic vi-replace-char
324 Vi replace character under the cursor with the next character typed.
325 .It Ic vi-replace-mode
326 Vi enter replace mode.
327 .It Ic vi-substitute-char
328 Vi replace character under the cursor and enter insert mode.
329 .It Ic vi-substitute-line
330 Vi substitute entire line.
331 .It Ic vi-change-to-eol
332 Vi change to end of line.
334 Vi enter insert mode.
336 Vi enter insert mode after the cursor.
338 Vi enter insert mode at end of line.
339 .It Ic vi-delete-meta
340 Vi delete prefix command.
341 .It Ic vi-end-big-word
342 Vi move to the end of the current space delimited word.
344 Vi move to the end of the current word.
347 .It Ic vi-command-mode
348 Vi enter command mode (use alternative key bindings).
350 Vi move to the beginning of line.
351 .It Ic vi-delete-prev-char
352 Vi move to previous character (backspace).
353 .It Ic vi-list-or-eof
354 Vi list choices for completion or indicate end of file if empty line.
355 .It Ic vi-kill-line-prev
356 Vi cut from beginning of line to cursor.
357 .It Ic vi-search-prev
358 Vi search history previous.
359 .It Ic vi-search-next
360 Vi search history next.
361 .It Ic vi-repeat-search-next
362 Vi repeat current search in the same search direction.
363 .It Ic vi-repeat-search-prev
364 Vi repeat current search in the opposite search direction.
366 Vi move to the character specified next.
368 Vi move to the character specified previous.
369 .It Ic vi-to-next-char
370 Vi move up to the character specified next.
371 .It Ic vi-to-prev-char
372 Vi move up to the character specified previous.
373 .It Ic vi-repeat-next-char
374 Vi repeat current character search in the same search direction.
375 .It Ic vi-repeat-prev-char
376 Vi repeat current character search in the opposite search direction.
378 Vi go to matching () {} or [].
380 Vi undo all changes to line.
382 Vi go to specified column.
384 Vi yank to end of line.
387 .It Ic vi-comment-out
388 Vi comment out current command.
390 Vi include shell alias.
391 .It Ic vi-to-history-line
392 Vi go to specified history file line..
394 Vi edit history line with vi.
395 .It Ic vi-history-word
396 Vi append word from previous input line.
398 Vi redo last non-motion command.
399 .It Ic em-delete-or-list
400 Delete character under cursor or list completions if at end of line.
401 .It Ic em-delete-next-word
402 Cut from cursor to end of current word.
404 Paste cut buffer at cursor position.
406 Cut the entire line and save in cut buffer.
407 .It Ic em-kill-region
408 Cut area between mark and cursor and save in cut buffer.
409 .It Ic em-copy-region
410 Copy area between mark and cursor to cut buffer.
411 .It Ic em-gosmacs-transpose
412 Exchange the two characters before the cursor.
414 Move next to end of current word.
416 Uppercase the characters from cursor to end of current word.
417 .It Ic em-capitol-case
418 Capitalize the characters from cursor to end of current word.
420 Lowercase the characters from cursor to end of current word.
422 Set the mark at cursor.
423 .It Ic em-exchange-mark
424 Exchange the cursor and mark.
425 .It Ic em-universal-argument
426 Universal argument (argument times 4).
428 Add 8th bit to next character typed.
429 .It Ic em-toggle-overwrite
430 Switch from insert to overwrite mode or vice versa.
431 .It Ic em-copy-prev-word
432 Copy current word to cursor.
433 .It Ic em-inc-search-next
434 Emacs incremental next search.
435 .It Ic em-inc-search-prev
436 Emacs incremental reverse search.
437 .It Ic ed-end-of-file
438 Indicate end of file.
440 Add character to the line.
441 .It Ic ed-delete-prev-word
442 Delete from beginning of current word to cursor.
443 .It Ic ed-delete-next-char
444 Delete character under cursor.
446 Cut to the end of line.
447 .It Ic ed-move-to-end
448 Move cursor to the end of line.
449 .It Ic ed-move-to-beg
450 Move cursor to the beginning of line.
451 .It Ic ed-transpose-chars
452 Exchange the character to the left of the cursor with the one under it.
454 Move to the right one character.
456 Move to the beginning of the current word.
458 Move to the left one character.
459 .It Ic ed-quoted-insert
460 Add the next character typed verbatim.
462 Adds to argument or enters a digit.
463 .It Ic ed-argument-digit
464 Digit that starts argument.
466 Indicates unbound character.
468 Tty interrupt character.
470 Tty delayed suspend character.
471 .It Ic ed-tty-flush-output
472 Tty flush output characters.
473 .It Ic ed-tty-sigquit
475 .It Ic ed-tty-sigtstp
476 Tty suspend character.
477 .It Ic ed-tty-stop-output
478 Tty disallow output characters.
479 .It Ic ed-tty-start-output
480 Tty allow output characters.
483 .It Ic ed-delete-prev-char
484 Delete the character to the left of the cursor.
485 .It Ic ed-clear-screen
486 Clear screen leaving current line at the top.
488 Redisplay everything.
490 Erase current line and start from scratch.
491 .It Ic ed-sequence-lead-in
492 First character in a bound sequence.
493 .It Ic ed-prev-history
494 Move to the previous history line.
495 .It Ic ed-next-history
496 Move to the next history line.
497 .It Ic ed-search-prev-history
498 Search previous in history for a line matching the current.
499 .It Ic ed-search-next-history
500 Search next in history for a line matching the current.
506 Editline extended command.
508 .\" End of section automatically generated with makelist
510 .Bl -tag -width "~/.editrcXXX"
512 User configuration file for the
523 library was written by Christos Zoulas,
524 and this manual was written by Luke Mewburn,
525 with some sections inspired by tcsh.