Annotation of src/usr.bin/mg/mg.1, Revision 1.10
1.10 ! bjc 1: .\" $OpenBSD: mg.1,v 1.9 2001/01/29 01:58:08 niklas Exp $
1.9 niklas 2: .\"
1.2 deraadt 3: .Dd February 25, 2000
4: .Dt MG 1
5: .Os
6: .Sh NAME
7: .Nm mg
8: .Nd emacs-like text editor
9: .Sh SYNOPSIS
10: .Nm mg
1.3 aaron 11: .Op Ar
1.2 deraadt 12: .Sh DESCRIPTION
13: .Nm
1.3 aaron 14: is intended to be a small, fast, and portable editor for
15: people who can't (or don't want to) run the real emacs for one
1.2 deraadt 16: reason or another, or are not familiar with the
17: .Xr vi 1
1.6 aaron 18: editor.
19: It is compatible with emacs because there shouldn't
1.2 deraadt 20: be any reason to learn more editor types than emacs or
21: .Xr vi 1 .
22: .Pp
1.6 aaron 23: Normal editing commands are very similar to Gnu Emacs.
24: In the following examples, ^X means control-X, and M-X means Meta-X,
1.4 deraadt 25: where the Meta key may be either a special key on your keyboard
26: or the ALT key; otherwise ESC followed by the key X works as well.
27: .Pp
28: .Bl -tag -width xxxxx -compact
29: .It ^f
30: Forward character
31: .It ^b
32: Backwards character
33: .It ^n
34: Next line
35: .It ^p
36: Previous line
37: .It ^a
38: Start of line
39: .It ^e
40: End of line
41: .It ^d
42: delete current character
43: .It ^s
44: interactive search forward
45: .It ^r
46: interactive search backwards
47: .It ^o
48: Open a new line at cursor position
49: .It ^t
50: transpose characters
51: .It ^u
52: Repeat next command 4 times (can be cascaded, ie. ^u^u^f will move 16 characters forward)
53: .Pp
54: .It ^k
55: kill to end of line (placing into kill buffer)
56: .It ^y
57: yank kill buffer into current location
58: .It ^@
59: set mark
60: .It ^w
61: kill region (cuts from previously set mark to current location, into kill buffer)
62: .It M-w
63: copy region (into kill buffer)
64: .Pp
65: .It ^v
66: Next page
67: .It M-v
68: Previous page
69: .It M-<
70: start of buffer
71: .It M->
72: end of buffer
73: .Pp
74: .It ^x^c
75: Quit (you will be asked if you want to save files)
76: .El
77: .Pp
78: For more key bindings, type
79: .Dq M-x describe-bindings .
80: .Pp
81: .Nm
82: differs primarily in not having special modes for tasks other than
83: straight editing, e.g., mail and news, and in not having special modes that
1.6 aaron 84: support various programming languages.
85: It does have text justification
86: and auto-fill mode.
87: Since it is written completely in C, there is no
88: language in which you can write extensions.
89: However, you can rebind keys and change some parameters.
90: There are no limits to line length or format.
91: Command, buffer, and file name completion and listing can
1.3 aaron 92: be done using the spacebar and
93: .Ql ? ,
94: respectively.
1.2 deraadt 95: .Pp
1.10 ! bjc 96: Amongst other major differences, the
1.2 deraadt 97: .Nm
1.4 deraadt 98: configuration files are much simpler than real emacs.
1.7 aaron 99: There are two configuration files,
1.3 aaron 100: .Pa .mg ,
1.1 deraadt 101: and
1.3 aaron 102: .Pa .mg-TERM .
103: Here,
104: .Ev TERM
105: represents the name of you terminal type; e.g., if your terminal type
106: is set to
107: .Dq vt100 ,
1.2 deraadt 108: .Nm
1.1 deraadt 109: will use
1.3 aaron 110: .Pa .mg-vt100
1.6 aaron 111: as a startup file.
112: The terminal type startup file is used first.
1.1 deraadt 113: See the manual for a full list of the commands that can
1.4 deraadt 114: go in the files.
1.2 deraadt 115: .Pp
1.6 aaron 116: Here's another example sequence that you may find useful.
117: By default,
1.3 aaron 118: .Dq ()
119: and
120: .Dq []
121: are recognized as brackets, so bracket matching can be done.
122: The following defines
123: .Dq {}
124: as brackets, and turns on the mode that causes
1.1 deraadt 125: the cursor to "blink" to show you matching brackets.
1.2 deraadt 126: .Bd -literal -offset indent
127: global-set-key } blink-matching-paren-hack
128: blink-matching-paren
129: set-default-mode blink
130: .Ed
1.3 aaron 131: .Sh FILES
1.8 aaron 132: .Bl -tag -width ~/.mg-TERM -compact
1.3 aaron 133: .It Pa ~/.mg
134: normal startup file
135: .It Pa ~/.mg-TERM
136: terminal-specific startup file
137: .El
138: .Sh SEE ALSO
1.2 deraadt 139: .Xr vi 1
140: .Sh BUGS
1.3 aaron 141: When you type
142: .Ql ?
143: to list possible file names, buffer names, etc.,
1.6 aaron 144: a help buffer is created for the possibilities.
145: In Gnu Emacs,
1.1 deraadt 146: this buffer goes away the next time you type a real command.
147: In
1.3 aaron 148: .Nm mg ,
1.4 deraadt 149: you must use "M-x 1" to get rid of it.