summaryrefslogtreecommitdiff
path: root/usr.bin/mg/mg.1
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2000-02-29 19:49:49 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2000-02-29 19:49:49 +0000
commit94864505910d901b9d980394df2a966671389d80 (patch)
tree15fe4858c2b1081481e99ab05a010f3106becf15 /usr.bin/mg/mg.1
parent6cda7c6496d84b2bd19ee3c2c99e825dc3188a58 (diff)
some binding information
Diffstat (limited to 'usr.bin/mg/mg.1')
-rw-r--r--usr.bin/mg/mg.1103
1 files changed, 66 insertions, 37 deletions
diff --git a/usr.bin/mg/mg.1 b/usr.bin/mg/mg.1
index 42812e3917c..636db19aacf 100644
--- a/usr.bin/mg/mg.1
+++ b/usr.bin/mg/mg.1
@@ -17,11 +17,69 @@ editor. It is compatible with emacs because there shouldn't
be any reason to learn more editor types than emacs or
.Xr vi 1 .
.Pp
-Normal editing commands should be identical to Gnu Emacs. It differs
-primarily in not having special modes for tasks other than straight
-editing, e.g., mail and news, and in not having special modes that
+Normal editing commands are very similar to Gnu Emacs. In the
+following examples, ^X means control-X, and M-X means Meta-X,
+where the Meta key may be either a special key on your keyboard
+or the ALT key; otherwise ESC followed by the key X works as well.
+.Pp
+.Bl -tag -width xxxxx -compact
+.It ^f
+Forward character
+.It ^b
+Backwards character
+.It ^n
+Next line
+.It ^p
+Previous line
+.It ^a
+Start of line
+.It ^e
+End of line
+.It ^d
+delete current character
+.It ^s
+interactive search forward
+.It ^r
+interactive search backwards
+.It ^o
+Open a new line at cursor position
+.It ^t
+transpose characters
+.It ^u
+Repeat next command 4 times (can be cascaded, ie. ^u^u^f will move 16 characters forward)
+.Pp
+.It ^k
+kill to end of line (placing into kill buffer)
+.It ^y
+yank kill buffer into current location
+.It ^@
+set mark
+.It ^w
+kill region (cuts from previously set mark to current location, into kill buffer)
+.It M-w
+copy region (into kill buffer)
+.Pp
+.It ^v
+Next page
+.It M-v
+Previous page
+.It M-<
+start of buffer
+.It M->
+end of buffer
+.Pp
+.It ^x^c
+Quit (you will be asked if you want to save files)
+.El
+.Pp
+For more key bindings, type
+.Dq M-x describe-bindings .
+.Pp
+.Nm
+differs primarily in not having special modes for tasks other than
+straight editing, e.g., mail and news, and in not having special modes that
support various programming languages. It does have text justification
-and auto-fill mode. It is written directly in C, so there is no
+and auto-fill mode. Since it is written completely in C, there is no
language in which you can write extensions. However, you can rebind
keys and change some parameters. There are no limits to line length
or format. Command, buffer, and file name completion and listing can
@@ -29,13 +87,9 @@ be done using the spacebar and
.Ql ? ,
respectively.
.Pp
-The one major difference is in configuration files. Gnu Emacs uses
-a configuration file
-.Pa .emacs ,
-which is written in Lisp.
+Amonst other major differences, the
.Nm
-uses its own configuration files, which contain extend mode Emacs
-commands (i.e., commands that you could type after doing m-x).
+configuration files are much simpler than real emacs.
There are two configuration files,
.Pa .mg ,
and
@@ -56,32 +110,7 @@ dot) in
.Pa /usr/local/lib/mg .
.Pp
See the manual for a full list of the commands that can
-go in the files. The most commonly
-used ones are probably key binding. The following example is
-part of a configuration file used to set make
-.Nm
-respond to the keypad on a Microport SV/AT system. The normal
-keys send a sequence of the form <ESC> [ <letter>. I also
-want to use keys prefixed by <ESC> as having different meaning.
-In order to deal with multi-character sequences, the initial
-subsequences must be defined as prefixes. To allow for this,
-three prefixes are left undefined in the initial setup. They
-are called "extra prefix 1", etc.
-.Bd -literal -offset indent
-;allow normal pad
-global-set-key ^[[ "extra prefix 1"
-;allow prefixed pad
-global-set-key ^[^[ "extra prefix 2"
-global-set-key ^[^[[ "extra prefix 3"
-;keypad
-global-set-key ^[[A previous-line
-global-set-key ^[[H scroll-down
-...etc
-
-;escaped keypad
-global-set-key ^[^[[A exchange-point-and-mark
-global-set-key ^[^[[H beginning-of-buffer
-.Ed
+go in the files.
.Pp
Here's another example sequence that you may find useful. By default,
.Dq ()
@@ -116,4 +145,4 @@ a help buffer is created for the possibilities. In Gnu Emacs,
this buffer goes away the next time you type a real command.
In
.Nm mg ,
-you must use "m-x 1" to get rid of it.
+you must use "M-x 1" to get rid of it.