Annotation of src/usr.bin/mg/mg.1, Revision 1.42
1.42 ! sobrado 1: .\" $OpenBSD: mg.1,v 1.41 2008/09/15 16:13:35 kjell Exp $
1.34 kjell 2: .\" This file is in the public domain.
1.9 niklas 3: .\"
1.42 ! sobrado 4: .Dd $Mdocdate: September 15 2008 $
1.2 deraadt 5: .Dt MG 1
6: .Os
7: .Sh NAME
8: .Nm mg
9: .Nd emacs-like text editor
10: .Sh SYNOPSIS
11: .Nm mg
1.36 sobrado 12: .Op Fl n
13: .Op Fl f Ar mode
14: .Op + Ns Ar number
15: .Op Ar
1.2 deraadt 16: .Sh DESCRIPTION
17: .Nm
1.3 aaron 18: is intended to be a small, fast, and portable editor for
1.33 kjell 19: people who can't (or don't want to) run emacs for one
1.2 deraadt 20: reason or another, or are not familiar with the
21: .Xr vi 1
1.6 aaron 22: editor.
23: It is compatible with emacs because there shouldn't
1.2 deraadt 24: be any reason to learn more editor types than emacs or
25: .Xr vi 1 .
1.16 deraadt 26: .Pp
1.17 vincent 27: The options are as follows:
1.21 henning 28: .Bl -tag -width Ds
1.36 sobrado 29: .It + Ns Ar number
1.16 deraadt 30: Go to the line specified by number (do not insert
1.33 kjell 31: a space between the
32: .Sq +
33: sign and the number).
1.20 mjc 34: If a negative number is specified, the line number counts
35: backwards from the end of the file i.e. +-1 will be the last
36: line of the file, +-2 will be second last, and so on.
1.36 sobrado 37: .It Fl f Ar mode
1.17 vincent 38: Run the mode command for all buffers created from
39: arguments on the command line, including the
40: scratch buffer and all files.
1.21 henning 41: .It Fl n
42: Turn off backup file generation.
1.16 deraadt 43: .El
1.33 kjell 44: .Sh WINDOWS AND BUFFERS
45: When a file is loaded into
46: .Nm ,
47: it is stored in a
48: .Em buffer .
49: This buffer may be displayed on the screen in more than one window.
50: At present, windows may only be split horizontally, so each window is
51: delineated by a modeline at the bottom.
52: If changes are made to a buffer, it will be reflected in all open windows.
53: .Sh POINT AND MARK
54: The current cursor location in
55: .Nm
56: is called the
1.39 jmc 57: .Em point
1.37 kjell 58: (or
59: .Em dot ) .
1.33 kjell 60: It is possible to define a window-specific region of text by setting a second
61: location, called the
62: .Em mark .
63: The
64: .Em region
65: is the text between point and mark inclusive.
66: Deleting the character at the mark position leaves
67: the mark at the point of deletion.
68: .Pp
69: Note: The point and mark are window-specific in
70: .Nm ,
71: not buffer-specific, as in other emacs flavours.
72: .Sh DEFAULT KEY BINDINGS
1.6 aaron 73: Normal editing commands are very similar to Gnu Emacs.
1.37 kjell 74: In the following examples, C-x means control-X, and M-x means Meta-X,
1.4 deraadt 75: where the Meta key may be either a special key on your keyboard
76: or the ALT key; otherwise ESC followed by the key X works as well.
77: .Pp
1.37 kjell 78: .Bl -tag -width xxxxxxxxxx -compact
79: .It C-SPC
80: set-mark-command
81: .It C-a
82: beginning-of-line
83: .It C-b
84: backward-char
85: .It C-d
86: delete-char
87: .It C-e
88: end-of-line
89: .It C-f
90: forward-char
91: .It C-g
92: keyboard-quit
93: .It C-h C-h
94: help-help
95: .It C-h a
96: apropos
97: .It C-h b
98: describe-bindings
99: .It C-h c
100: describe-key-briefly
101: .It C-j
102: newline-and-indent
103: .It C-k
104: kill-line
105: .It C-l
106: recenter
107: .It RET
108: newline
109: .It C-n
110: next-line
111: .It C-o
112: open-line
113: .It C-p
114: previous-line
115: .It C-q
116: quoted-insert
117: .It C-r
118: isearch-backward
119: .It C-s
120: isearch-forward
121: .It C-t
122: transpose-chars
123: .It C-u
124: universal-argument
125: .It C-v
126: scroll-up
127: .It C-w
128: kill-region
129: .It C-x C-b
130: list-buffers
131: .It C-x C-c
132: save-buffers-kill-emacs
133: .It C-x C-f
134: find-file
135: .It C-x C-g
136: keyboard-quit
137: .It C-x C-l
138: downcase-region
139: .It C-x C-o
140: delete-blank-lines
141: .It C-x C-q
142: toggle-read-only
143: .It C-x C-r
144: find-file-read-only
145: .It C-x C-s
146: save-buffer
147: .It C-x C-u
148: upcase-region
149: .It C-x C-v
150: find-alternate-file
151: .It C-x C-w
152: write-file
153: .It C-x C-x
154: exchange-point-and-mark
155: .It C-x (
156: start-kbd-macro
157: .It C-x )
158: end-kbd-macro
159: .It C-x 0
160: delete-window
161: .It C-x 1
162: delete-other-windows
163: .It C-x 2
164: split-window-vertically
165: .It C-x 4 C-f
166: find-file-other-window
167: .It C-x 4 C-g
168: keyboard-quit
169: .It C-x 4 b
170: switch-to-buffer-other-window
171: .It C-x 4 f
172: find-file-other-window
173: .It C-x =
174: what-cursor-position
175: .It C-x ^
176: enlarge-window
177: .It C-x `
178: next-error
179: .It C-x b
180: switch-to-buffer
181: .It C-x d
182: dired
183: .It C-x e
184: call-last-kbd-macro
185: .It C-x f
186: set-fill-column
187: .It C-x g
188: goto-line
189: .It C-x i
190: insert-file
191: .It C-x k
192: kill-buffer
193: .It C-x n
194: other-window
195: .It C-x o
196: other-window
197: .It C-x p
198: previous-window
199: .It C-x s
200: save-some-buffers
201: .It C-x u
202: undo
203: .It C-y
204: yank
205: .It C-z
206: suspend-emacs
207: .It M-C-v
208: scroll-other-window
209: .It M-SPC
210: just-one-space
1.23 deraadt 211: .It M-%
1.37 kjell 212: query-replace
1.4 deraadt 213: .It M-<
1.37 kjell 214: beginning-of-buffer
1.4 deraadt 215: .It M->
1.37 kjell 216: end-of-buffer
217: .It M-\e
218: delete-horizontal-space
219: .It M-b
220: backward-word
221: .It M-c
222: capitalize-word
223: .It M-d
224: kill-word
225: .It M-f
226: forward-word
227: .It M-l
228: downcase-word
229: .It M-q
230: fill-paragraph
231: .It M-r
232: search-backward
233: .It M-s
234: search-forward
235: .It M-u
236: upcase-word
237: .It M-v
238: scroll-down
239: .It M-w
240: copy-region-as-kill
241: .It M-x
242: execute-extended-command
243: .It M-{
244: backward-paragraph
245: .It M-}
246: forward-paragraph
247: .It M-~
248: not-modified
249: .It M-DEL
250: backward-kill-word
251: .It C-_
252: undo
253: .It )
254: blink-and-insert
255: .It DEL
256: delete-backward-char
1.4 deraadt 257: .El
258: .Pp
1.37 kjell 259: For a complete description of
260: .Nm
261: commands, see
262: .Sx MG COMMANDS .
263: To see the active keybindings at any time, type
1.4 deraadt 264: .Dq M-x describe-bindings .
1.37 kjell 265: .Sh MG COMMANDS
1.33 kjell 266: Commands are invoked by
267: .Dq M-x ,
268: or by binding to a key.
269: Many commands take an optional numerical parameter,
270: .Va n .
271: This parameter is set either by
272: M-<n> (where
273: .Va n
274: is the numerical argument) before the command, or by
275: one or more invocations of the universal argument, usually bound to C-U.
276: When invoked in this manner, the value of the numeric parameter to
277: be passed is displayed in the minibuffer before the M-x.
1.39 jmc 278: One common use of the parameter is in mode toggles (e.g.\&
1.37 kjell 279: make-backup-files).
280: If no parameter is supplied, the mode is toggled to its
281: alternate state.
282: If a positive parameter is supplied, the mode is forced to on.
283: Otherwise, it is forced to off.
284: .\"
285: .Bl -tag -width xxxxx
286: .It apropos
287: Help Apropos.
288: Prompt the user for a string, open the *help* buffer,
289: and list all
290: .Nm
291: commands that contain that string.
292: .It auto-execute
293: Register an auto-execute hook; that is, specify a filename pattern
294: (conforming to the shell's filename globbing rules) and an associated
295: function to execute when a file matching the specified pattern
296: is read into a buffer.
297: .It auto-fill-mode
298: Toggle auto-fill mode (sometimes called mail-mode),
299: where text inserted past the fill column is automatically wrapped
300: to a new line.
301: .It auto-indent-mode
1.39 jmc 302: Toggle indent mode, where indentation is preserved after a newline.
1.37 kjell 303: .It backward-char
304: Move cursor backwards one character.
305: .It backward-kill-word
306: Kill text backwards by
307: .Va n
308: words.
309: .It backward-paragraph
310: Move cursor backwards
311: .Va n
312: paragraphs.
313: Paragraphs are delimited by <NL><NL> or <NL><TAB> or <NL><SPACE>.
314: .It backward-word
315: Move cursor backwards by the specified number of words.
316: .It beginning-of-buffer
317: Move cursor to the top of the buffer.
318: .It beginning-of-line
319: Move cursor to the beginning of the line.
320: .It blink-and-insert
321: Self-insert a character, then search backwards and blink its
322: matching delimeter.
323: For delimeters other than
324: parenthesis, brackets, and braces, the character itself
325: is used as its own match.
326: .It bsmap-mode
327: Toggle bsmap mode, where DEL and c-H are swapped.
1.42 ! sobrado 328: .It c-mode
! 329: Toggle a KNF-compliant mode for editing C program files.
1.37 kjell 330: .It call-last-kbd-macro
331: Invoke the keyboard macro.
332: .It capitalize-word
333: Capitalize
334: .Va n
335: words; i.e. convert the first character of the word to
336: upper case, and subsequent letters to lower case.
337: .It cd
338: Change the global working directory.
339: See also global-wd-mode.
340: .It copy-region-as-kill
341: Copy all of the characters in the region to the kill buffer,
342: clearing the mark afterwards.
343: This is a bit like a kill-region followed by a yank.
344: .It count-matches
345: Count the number of lines matching the supplied regular expression.
346: .It count-non-matches
347: Count the number of lines not matching the supplied regular expression.
348: .It define-key
1.39 jmc 349: Prompts the user for a named keymap (mode),
1.40 sobrado 350: a key, and an
351: .Nm
352: command, then creates a keybinding in the appropriate
1.37 kjell 353: map.
354: .It delete-backward-char
355: Delete backwards
356: .Va n
357: characters.
358: Like delete-char, this actually does a kill if presented
359: with an argument.
360: .It delete-blank-lines
361: Delete blank lines around dot.
362: If dot is sitting on a blank line, this command
363: deletes all the blank lines above and below the current line.
364: Otherwise, it deletes all of the blank lines after the current line.
365: .It delete-char
366: Delete
367: .Va n
368: characters forward.
369: If any argument is present, it kills rather than deletes,
370: saving the result in the kill buffer.
371: .It delete-horizontal-space
372: Delete any whitespace around the dot.
373: .It delete-leading-space
374: Delete leading whitespace on the current line.
375: .It delete-trailing-space
376: Delete trailing whitespace on the current line.
377: .It delete-matching-lines
378: Delete all lines after dot that contain a string matching
379: the supplied regular expression.
380: .It delete-non-matching-lines
381: Delete all lines after dot that contain a string matching
382: the supplied regular expression.
383: .It delete-other-windows
384: Make the current window the only window visible on the screen.
385: .It delete-window
386: Delete current window.
387: .It describe-bindings
388: List all global and local keybindings, putting the result in
389: the *help* buffer.
390: .It describe-key-briefly
391: Read a key from the keyboard, and look it up in the keymap.
392: Display the name of the function currently bound to the key.
393: .It digit-argument
394: Process a numerical argument for keyboard-invoked functions.
395: .It downcase-region
396: Set all characters in the region to lower case.
397: .It downcase-word
398: Set characters to lower case, starting at the dot, and ending
399: .Va n
400: words away.
401: .It emacs-version
1.40 sobrado 402: Return an
403: .Nm
404: version string.
1.37 kjell 405: .It end-kbd-macro
406: Stop defining a keyboard macro.
407: .It end-of-buffer
408: Move cursor to the end of the buffer.
409: .It end-of-line
1.40 sobrado 410: Move cursor to the end of the line.
1.37 kjell 411: .It enlarge-window
412: Enlarge the current window by shrinking either the window above
413: or below it.
414: .It eval-current-buffer
1.40 sobrado 415: Evaluate the current buffer as a series of
416: .Nm
417: commands.
1.37 kjell 418: Useful for testing
419: .Nm
420: startup files.
421: .It eval-expression
422: Get one line from the user, and run it.
423: Useful for testing expressions in
424: .Nm
425: startup files.
426: .It exchange-point-and-mark
427: Swap the values of "dot" and "mark" in the current window.
428: Return an error if no mark is set.
429: .It execute-extended-command
430: Invoke an extended command; i.e. M-x.
431: Call the message line routine to read in the command name and apply
432: autocompletion to it.
433: When it comes back, look the name up in the symbol table and run the
434: command if it is found, passing arguments as necessary.
435: Print an error if there is anything wrong.
436: .It fill-paragraph
437: Justify a paragraph, wrapping text at the current fill column.
438: .It find-file
439: Select a file for editing.
440: First check if you can find the file
441: in another buffer; if you can find it, just switch to the buffer.
1.39 jmc 442: If you cannot find the file, create a new buffer, read in the
1.37 kjell 443: file from disk, and switch to the new buffer.
444: .It find-file-read-only
445: Same as find-file, except the new buffer is set to read-only.
446: .It find-alternate-file
447: Replace the current file with an alternate one.
448: Semantics for finding the replacement file are the same as
1.39 jmc 449: find-file, except the current buffer is killed before the switch.
1.37 kjell 450: If the kill fails, or is aborted, revert to the original file.
451: .It find-file-other-window
452: Opens the specified file in a second buffer.
453: Splits the current window if necessary.
454: .It forward-char
455: Move cursor forwards (or backwards, if
456: .Va n
457: is negative)
458: .Va n
459: characters.
460: Returns an error if the end of buffer is reached.
461: .It forward-paragraph
462: Move forward
463: .Va n
464: paragraphs.
1.39 jmc 465: Paragraphs are delimited by <NL><NL> or <NL><TAB> or <NL><SPACE>.
1.37 kjell 466: .It forward-word
467: Move the cursor forward by the specified number of words.
468: .It global-set-key
469: Bind a key in the global (fundamental) key map.
470: .It global-unset-key
1.40 sobrado 471: Unbind a key from the global (fundamental) key map; i.e. set it to 'rescan'.
1.37 kjell 472: .It global-wd-mode
473: Toggle global working-directory mode.
474: When enabled,
475: .Nm
476: defaults to opening files (and executing commands like compile and grep)
1.39 jmc 477: relative to the global working directory.
1.37 kjell 478: When disabled, a working directory is set for each buffer.
479: .It goto-line
480: Go to a specific line.
481: If an argument is present, then
482: it is the line number, else prompt for a line number to use.
483: .It help-help
1.39 jmc 484: Prompts for one of (a)propos, (b)indings, des(c)ribe key briefly.
1.37 kjell 485: .It insert
486: Insert a string, mainly for use from macros.
487: .It insert-buffer
1.40 sobrado 488: Insert the contents of another buffer at dot.
1.37 kjell 489: .It insert-file
490: Insert a file into the current buffer at dot.
491: .It insert-with-wrap
492: Insert the bound character with word wrap.
493: Check to see if we're past the fill column, and if so,
494: justify this line.
495: .It isearch-backward
496: Use incremental searching, initially in the reverse direction.
497: isearch ignores any explicit arguments.
1.39 jmc 498: If invoked during macro definition or evaluation, the non-incremental
1.37 kjell 499: search-backward is invoked instead.
500: .It isearch-forward
501: Use incremental searching, initially in the forward direction.
502: isearch ignores any explicit arguments.
1.39 jmc 503: If invoked during macro definition or evaluation, the non-incremental
1.37 kjell 504: search-forward is invoked instead.
505: .It just-one-space
506: Delete any whitespace around dot, then insert a space.
507: .It keyboard-quit
508: Abort the current action.
509: .It kill-buffer
510: Dispose of a buffer, by name.
511: Prompt the user if the buffer
512: has been changed.
513: .It kill-line
514: Kill line.
515: If called without an argument, it kills from dot to the end
516: of the line, unless it is at the end of the line, when it kills the
517: newline.
518: If called with an argument of 0, it kills from the start of the
519: line to dot.
520: If called with a positive argument, it kills from dot
521: forward over that number of newlines.
522: If called with a negative argument
523: it kills any text before dot on the current line, then it kills back
524: abs(n) lines.
525: .It kill-paragraph
526: Delete
527: .Va n
528: paragraphs starting with the current one.
529: .It kill-region
1.39 jmc 530: Kill the currently defined region.
1.37 kjell 531: .It kill-word
532: Delete forward
533: .Va n
534: words.
535: .It line-number-mode
1.39 jmc 536: Toggle whether line and column numbers are displayed in the modeline.
1.37 kjell 537: .It list-buffers
538: Display the list of available buffers.
539: .It load
540: Prompt the user for a filename, and then execute commands
541: from that file.
542: .It local-set-key
543: Bind a key mapping in the local (topmost) mode.
544: .It local-unset-key
545: Unbind a key mapping in the local (topmost) mode.
546: .It make-backup-files
547: Toggle generation of backup files.
548: .It meta-key-mode
549: When disabled, the meta key can be used to insert extended-ascii (8-bit)
550: characters.
551: When enabled, the meta key acts as usual.
552: .It negative-argument
1.39 jmc 553: Process a negative argument for keyboard-invoked functions.
1.37 kjell 554: .It newline
555: Insert a newline into the current buffer.
556: .It newline-and-indent
557: Insert a newline, then enough tabs and spaces to duplicate the indentation
558: of the previous line.
559: Assumes tabs are every eight characters.
560: .It next-line
561: Move forward
562: .Va n
563: lines.
564: .It no-tab-mode
565: Toggle notab mode.
566: In this mode, spaces are inserted rather than tabs.
567: .It not-modified
568: Turn off the modified flag in the current buffer.
569: .It open-line
570: Open up some blank space.
571: Essentially, insert
572: .Va n
573: newlines, then back up over them.
574: .It other-window
575: The command to make the next (down the screen) window the current
576: window.
577: There are no real errors, although the command does nothing if
578: there is only 1 window on the screen.
579: .It overwrite-mode
1.39 jmc 580: Toggle overwrite mode, where typing in a buffer overwrites
1.37 kjell 581: existing characters rather than inserting them.
582: .It prefix-region
583: Inserts a prefix string before each line of a region.
584: The prefix string is settable by using 'set-prefix-string'.
585: .It previous-line
586: Move backwards
587: .Va n
588: lines.
589: .It previous-window
590: This command makes the previous (up the screen) window the
591: current window.
592: There are no errors, although the command does not do
593: a lot if there is only 1 window.
594: .It push-shell
1.40 sobrado 595: Suspend
596: .Nm
597: and switch to alternate screen, if available.
1.37 kjell 598: .It pwd
599: Display current (global) working directory in the status area.
600: .It query-replace
601: Query Replace.
602: Search and replace strings selectively, prompting after each match.
603: .It replace-string
604: Replace string globally without individual prompting.
605: .It query-replace-regexp
606: Replace strings selectively.
607: Does a search and replace operation using regular
608: expressions for both patterns.
609: .It quoted-insert
610: Insert the next character verbatim into the current buffer; i.e. ignore
611: any function bound to that key.
612: .It re-search-again
613: Perform a regular expression search again, using the same search
614: string and direction as the last search command.
615: .It re-search-backward
616: Search backwards using a regular expression.
617: Get a search string from the user, and search, starting at dot
618: and proceeding toward the front of the buffer.
1.39 jmc 619: If found, dot is left
1.37 kjell 620: pointing at the first character of the pattern [the last character that
621: was matched].
622: .It re-search-forward
623: Search forward using a regular expression.
624: Get a search string from the user and search for it starting at dot.
625: If found, move dot to just after the matched characters.
626: display does all
627: the hard stuff.
628: If not found, it just prints a message.
629: .It recenter
630: Reposition dot in the current window.
1.39 jmc 631: By default, the dot is centered.
1.37 kjell 632: If given a positive argument (n), the display is repositioned to line
633: n.
634: If
635: .Va n
1.40 sobrado 636: is negative, it is that line from the bottom.
1.37 kjell 637: .It redraw-display
638: Refresh the display.
639: Recomputes all window sizes in case something has changed.
640: .It save-buffer
641: Save the contents of the current buffer if it has been changed,
642: optionally creating a backup copy.
643: .It save-buffers-kill-emacs
1.40 sobrado 644: Offer to save modified buffers and quit
645: .Nm .
1.37 kjell 646: .It save-some-buffers
647: Look through the list of buffers, offering to save any buffer that
648: has been changed.
649: Buffers that are not associated with files (such
650: as *scratch*, *grep*, *compile*) are ignored.
651: .It scroll-down
652: Scroll backwards
653: .Va n
654: pages.
655: A two-line overlap between pages is
656: assumed.
657: If given a repeat argument, scrolls back lines, not pages.
658: .It scroll-one-line-down
659: Scroll the display down
660: .Va n
661: lines without changing the cursor position.
662: .It scroll-one-line-up
663: Scroll the display
664: .Va n
1.40 sobrado 665: lines up without moving the cursor position.
1.37 kjell 666: .It scroll-other-window
667: Scroll the next window in the window list window forward
668: .Va n
669: pages.
670: .It scroll-up
671: Scroll forward one page.
672: A two-line overlap between pages is
673: assumed.
674: If given a repeat argument, scrolls back lines, not pages.
675: .It search-again
676: Search again, using the same search string and direction as the last
677: search command.
678: .It search-backward
679: Reverse search.
680: Get a search string from the user, and search, starting
681: at dot and proceeding toward the front of the buffer.
682: If found, dot is
683: left pointing at the first character of the pattern (the last character
684: that was matched).
685: .It search-forward
686: Search forward.
687: Get a search string from the user, and search for it
688: starting at dot.
689: If found, dot gets moved to just after the matched
690: characters, if not found, print a message.
691: .It self-insert-command
692: Insert a character.
693: .It set-case-fold-search
694: Set case-fold searching, causing case nopt to matter
695: in regular expression searches.
696: This is the default.
697: .It set-default-mode
698: Append the supplied mode to the list of default modes
699: used by subsequent buffer creation.
700: Built in modes include: fill, indent, overwrite, and notab.
701: .It set-fill-column
702: Prompt the user for a fill column.
703: Used by auto-fill-mode.
704: .It set-mark-command
1.40 sobrado 705: Sets the mark in the current window to the current dot location.
1.37 kjell 706: .It set-prefix-string
707: Sets the prefix string to be used by the 'prefix-region' command.
708: .It shrink-window
709: Shrink current window by one line.
710: The window immediately below is expanded to pick up the slack.
711: If only one window is present, this command has no effect.
712: .It space-to-tabstop
713: Insert enough spaces to reach the next tab-stop position.
714: By default, tab-stops occur every 8 characters.
715: .It split-window-vertically
716: Split the current window.
717: A window smaller than 3 lines cannot be split.
718: .It start-kbd-macro
719: Start defining a keyboard macro.
720: Macro definition is ended by invoking end-kbd-macro.
721: .It suspend-emacs
1.40 sobrado 722: Suspend
723: .Nm
724: and switch back to alternate screen, if in use.
1.37 kjell 725: .It switch-to-buffer
726: Prompt and switch to a new buffer in the current window.
727: .It switch-to-buffer-other-window
728: Switch to buffer in another window.
729: .It toggle-read-only
730: Toggle the read-only flag on the current buffer.
731: .It transpose-chars
732: Transpose the two characters on either side of dot.
1.39 jmc 733: If dot is at the end of the line, transpose the two characters before it.
1.37 kjell 734: Return with an error if dot is at the beginning of line;
1.39 jmc 735: it seems to be a bit pointless to
1.37 kjell 736: make this work.
737: .It undo
738: Undo the most recent action.
739: If invoked again without an intervening command,
740: move the undo pointer to the previous action and undo it.
1.41 kjell 741: .It undo-boundary
742: Add an undo boundary.
743: This is not usually done interactively.
744: .It undo-boundary-toggle
745: Toggle whether undo boundaries are generated.
746: Undo boundaries are often disabled before operations that should
747: be considered atomically undoable.
748: .It undo-enable
749: Toggle whether undo information is kept.
1.37 kjell 750: .It undo-list
751: Show the undo records for the current buffer in a new buffer.
752: .It universal-argument
753: Repeat the next command 4 times.
754: Usually bound to C-u.
1.39 jmc 755: This command may be stacked; e.g.\&
1.37 kjell 756: C-u C-u C-f moves the cursor forward 16 characters.
757: .It upcase-region
758: Upper case region.
759: Change all of the lower case characters in the region to
1.40 sobrado 760: upper case.
1.37 kjell 761: .It upcase-word
762: Move the cursor forward by the specified number of words.
763: As you move, convert any characters to upper case.
764: .It what-cursor-position
765: Display a bunch of useful information about the current location of
766: dot.
767: The character under the cursor (in octal), the current line, row,
768: and column, and approximate position of the cursor in the file (as a
769: percentage) is displayed.
770: The column position assumes an infinite
771: position display; it does not truncate just because the screen does.
772: .It write-file
773: Ask for a file name and write the contents of the current buffer to
774: that file.
775: Update the remembered file name and clear the buffer
776: changed flag.
777: .It yank
778: Yank text from kill-buffer.
1.40 sobrado 779: Unlike emacs, the
780: .Nm
781: kill buffer consists only
1.37 kjell 782: of the most recent kill.
783: It is not a ring.
784: .El
1.33 kjell 785: .Sh CONFIGURATION FILES
1.7 aaron 786: There are two configuration files,
1.3 aaron 787: .Pa .mg ,
1.1 deraadt 788: and
1.3 aaron 789: .Pa .mg-TERM .
790: Here,
791: .Ev TERM
1.15 pvalchev 792: represents the name of your terminal type; e.g., if your terminal type
1.3 aaron 793: is set to
794: .Dq vt100 ,
1.2 deraadt 795: .Nm
1.1 deraadt 796: will use
1.3 aaron 797: .Pa .mg-vt100
1.6 aaron 798: as a startup file.
799: The terminal type startup file is used first.
1.33 kjell 800: .Pp
1.28 jmc 801: The startup file format is a list of commands, one per line, as used for
1.33 kjell 802: interactive evaluation.
803: Strings that are normally entered by the user at any subsequent prompts
804: may be specified after the command name; e.g.:
1.28 jmc 805: .Bd -literal -offset indent
1.37 kjell 806: global-set-key ")" self-insert-command
1.38 kjell 807: global-set-key "\\^x\\^f" find-file
808: global-set-key "\\e[Z" backward-char
1.37 kjell 809: set-default-mode fill
1.28 jmc 810: set-fill-column 72
1.37 kjell 811: auto-execute *.c c-mode
1.28 jmc 812: .Ed
1.3 aaron 813: .Sh FILES
1.8 aaron 814: .Bl -tag -width ~/.mg-TERM -compact
1.3 aaron 815: .It Pa ~/.mg
816: normal startup file
817: .It Pa ~/.mg-TERM
818: terminal-specific startup file
819: .El
820: .Sh SEE ALSO
1.2 deraadt 821: .Xr vi 1
1.29 reyk 822: .Sh CAVEATS
1.37 kjell 823: Since it is written completely in C, there is currently no
1.33 kjell 824: language in which you can write extensions;
1.38 kjell 825: however, you can rebind keys and change certain parameters
826: in startup files.
1.33 kjell 827: .Pp
828: In order to use 8-bit characters (such as German umlauts), the Meta key
829: needs to be disabled via the
830: .Dq meta-key-mode
831: command.