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