tech-misc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

libedit/makelist, editrc manpage, document default key bindings



(I cc'd two developers as they contributed some of this.)

I want to close my old PR #14578 by documenting the default keybindings. 
When I filed this PR a few years ago, I was curious on what certain keys 
did.

I have several questions:

1) What calls "makelist -m"?

2) Can the "makelist -m" be extended to show the default key combinations? 
(The info is in two different source files, maps.c and emacs.c, that could 
be parsed.)

3) sh man page says it uses editline library and the editrc manpage 
mentions built-in commands, like "bind" -- but sh says "bind: not found".
What am I missing in the docs?

4) Why does emacs.c document ^U for both em_universal_argument and 
em_kill_line?

5) Are there keys associated for copy_prev_word, toggle_overwrite, 
inc_search_next, and/or inc_search_prev?

6) The following is my patch, but I'd prefer to just put this info in the 
earlier section, but that is generated by "makelist -m" (.\" Section 
automatically generated with makelist). Most of the following is same as 
already listed. But adds the keys themselves.

Index: editrc.5
===================================================================
RCS file: /cvsroot/src/lib/libedit/editrc.5,v
retrieving revision 1.20
diff -u -r1.20 editrc.5
--- editrc.5    21 Aug 2006 12:45:30 -0000      1.20
+++ editrc.5    8 Mar 2008 22:41:19 -0000
@@ -115,7 +115,10 @@
 Options include:
 .Bl -tag -width 4n
 .It Fl e
-Bind all keys to the standard GNU Emacs-like bindings.
+Bind all keys to the standard GNU Emacs-like bindings
+documented in
+.Sx "EMACS KEY BINDINGS"
+below.
 .It Fl v
 Bind all keys to the standard
 .Xr vi 1 Ns -like
@@ -315,7 +318,7 @@
 .Dv _POSIX_VDISABLE .
 .El
 .Sh EDITOR COMMANDS
-The following editor commands are available for use in key bindings:
+The following editor commands are available for use in key bindings.
 .\" Section automatically generated with makelist
 .Bl -tag -width 4n
 .It Ic vi-paste-next
@@ -500,6 +503,73 @@
 Editline extended command.
 .El
 .\" End of section automatically generated with makelist
+.Sh EMACS KEY BINDINGS
+.\" TODO: maybe move this to above section for em- commands
+.\" TODO: add example on how to see current settings and how to define
+The following are the default Emacs-style key bindings.
+The
+.Sy ^
+(carat) character represents the Control key.
+And the
+.Sy M-
+represents the modifier key (such as Alt).
+.Bl -ohang -offset indent
+.It Sy ^@
+Set mark.
+Set the mark at cursor.
+.It Sy ^[ 
+(or <ESC>)
+Meta next.
+Add 8th bit to next character typed.
+.It Sy ^?
+Delete previous character.
+.It Sy M-^_
+Copy previous word.
+.It Sy M-c
+Capital case.
+Capitalize the characters from cursor to end of current word.
+.It Sy ^D
+Delete or list.
+Delete character under cursor or list completions if at end of line.
+.It Sy M-d
+Delete next word.
+Cut from cursor to end of current word.
+.It Sy M-f
+Next word.
+Move next to end of current word.
+.It Sy ^H
+TODO or ^?
+Delete previous character.
+Delete the character to the left of the cursor.
+.It Sy M-l
+Lower case.
+Lowercase the characters from cursor to end of current word.
+.It Sy ^T
+Gosling emacs transpose chars.
+Exchange the two characters before the cursor.
+.It Sy ^U
+Kill line.
+Cut the entire line and save in cut buffer.
+.It Sy M-u
+Upper case.
+Uppercase the characters from cursor to end of current word.
+.It Sy ^W
+Kill region.
+Cut area between mark and cursor and save in cut buffer.
+.It Sy M-w
+Copy region.
+Copy area between mark and cursor to cut buffer.
+.It Sy ^X^X
+Exchange mark. Exchange the cursor and mark.
+.It Sy ^Y
+Yank.
+Paste cut buffer at cursor position.
+.\" ^U Universal argument (argument times 4).
+.\" toggle_overwrite Switch from insert to overwrite mode or vice versa.
+.\" copy_prev_word Copy current word to cursor.
+.\" inc_search_next Emacs incremental next search.
+.\" inc_search_prev Emacs incremental reverse search.
+.El
 .Sh SEE ALSO
 .Xr editline 3 ,
 .Xr regex 3 ,

Any other defaults beyond what I documented above?


  Jeremy C. Reed


Home | Main Index | Thread Index | Old Index