Lines Matching full:to

4 The mg editor is a public domain editor intended to loosely resemble GNU Emacs,
15 Esc key and type <chr>. This is equivalent to M-<chr>.
17 The first thing to learn is how to move up and down a document. To move your
22 Congratulations. You have now learned how to move your cursor down. To move
26 >> Try using C-p and C-n to move up and down and then move past this line.
28 The next commands to learn are how to move your cursor left and right. To do
30 you can use C-b and C-f to do this.
34 To make it easy to remember these commands, it helps to remember by letter:
37 Now that you've learned how to move single characters at a time, next we learn
38 how to move one word at a time. To do this, you can use M-f (Meta and f) or
39 M-b (Meta and b) to move forwards and backwards, one word at a time.
49 initially shown to you when you opened this document. mg redraws your terminal
51 allows you to see the lines before and after the current cursor position. The
54 >> Now move the cursor down to this line and then type C-l (that's Control and
59 To move to the beginning or end of a line, you can use the Home and End keys,
60 or you can use C-a and C-e to move to the beginning and end.
62 >> Use C-a and C-e to move to the beginning and end of this line.
64 The next commands we will learn is how to move up and down, one page at a time.
65 To do this, you can use the Page Up (sometimes labelled PgUp) and Page Down
66 (sometimes labelled PgDn) keys. You can also use C-v and M-v to do this. C-v
69 >> Try using M-v and C-v to move up and down, one page at a time.
72 M-> (Meta-Greater than) which move you to the beginning and end of a file,
73 respectively. You may not want to try that now as you will probably lose your
75 you'll need to press the Shift key to type <.
88 C-a Move to beginning of line (can also use Home key).
89 C-e Move to end of line (can also use End key).
92 M-< Move to beginning of file.
93 M-> Move to end of file.
96 to execute these commands multiple times. The way to do this is to type C-u
99 >> Type C-u 5 C-f to move forward 5 characters.
101 In general, C-u allows you to execute any command multiple times, not just
102 cursor motion commands. The only exception to this rule are C-v and M-v.
109 If you have started typing out a command that you didn't mean to finish, you
110 can use the C-g command to cancel the command immediately.
112 >> For example, type C-u 50 and then type C-g to cancel the C-u command.
113 >> Type Esc and then C-g to cancel the Esc key.
115 In general, you can use C-g to stop any mg commands. You may type it multiple
119 In general, when in doubt, use C-g to get out of trouble.
124 To insert text anywhere, simply move your cursor to the appropriate position
125 and begin typing. To delete characters, use the backspace key. If you use
129 To delete characters to the right of the cursor, you can use C-d to delete
130 characters to the right of the current position. If you use M-d instead of
136 scroll off the screen and you will see a $ on the line to indicate that the
137 line is too long to fit on the screen at one time.
139 To delete a line at a time, you can use C-k to kill the line from the current
140 cursor position to the end of the line. You can type C-k multiple times to
144 C-u 10 e will type out eeeeeeeeee, C-u 4 M-d will delete four words to the
147 To undo any operation, you can use C-_ (that's control-underscore).
149 Now if you kill something that you didn't mean to, you can yank it back from
153 move your cursor to the new location and then use C-y to paste it there.
158 To search for text, type C-s followed by the text you wish to search for. Note
162 To continue searching the text you're looking for, type C-s to find the next
163 instance. To search in reverse, type C-r instead of C-s. If you type C-s or
166 To stop searching for text, simply use the cursor keys (or C-f, C-b etc.) or
167 C-g to stop the search operation.
169 >> Use C-s foo to search for "foo" in the text. You can use C-s again to
179 To replace text, use M-%. You will be prompted for the text to search for and
180 the text to replace it with. You will then be taken to the first instance of
193 As explained above, you can cut regions using C-k to kill multiple lines. To
194 paste the text that you just cut, simply move your cursor to the point and
195 then type C-y to restore the text. You may type C-y multiple times to restore
196 the text. Hence, to copy text, you can use C-k to kill all the lines, use C-y
197 to restore it immediately, then move to the region you want to copy it to and
198 then type C-y again to restore the last cut text block again.
200 Another way to cut or copy chunks of text is to first position your cursor at
201 the starting point of the chunk of text. Then type C-<space> to mark this as
202 the starting point to cut or copy. Then move the cursor to the end point of the
203 text chunk that you wish to manipulate. Then type C-w to cut the region, or
204 M-w to copy the region. If you wish to cancel marking a block of text, simply
205 type C-g to cancel the operation.
207 To paste the region that you've cut or copied above, simply move your cursor
208 to the desired location and then type C-y to paste it.
218 saved it, it should have a "**" to the left of those words. If this file is
219 read-only, you should see a "%%" to the left of those words.
221 To the right of the status line, you should see L followed by digits
223 Type M-x column-number-mode Enter to enable it if it is disabled (the
230 also supports a c-mode that is more suited to editing C code. There are also
232 for mg(1) to learn about the various editing modes.
237 To open a file, you can use C-x C-f. You will then be prompted for a file name.
240 you can begin editing it. Note that you do not need to type the whole file
247 NOTE: If you type C-x f instead of C-x C-f, you can use C-g to cancel the
248 Set-Fill-Column command. You can also use C-g to cancel the C-x C-f command
249 if you don't wish to open a new file.
251 To save the file once you've edited it, use C-x C-s to save the file. When
252 mg is done saving the file, you should see the words "Wrote /path/to/file"
253 in the bottom of your screen. In general, it is a good idea to save quite
257 If you decide to open a directory instead of a file, mg will transition into a
263 Pressing c will give you the opportunity to copy the file.
274 Once a file is loaded into mg, it is often referred to as a buffer.
280 at the same time, each one displaying different text. To split a screen into two
281 horizontal windows use C-x 2. To return to one window, use C-x 1 to close the
284 >> Use C-x 2 to split the screen into two windows.
286 >> Use C-x o to move from one window to the other. You can scroll up and down
289 >> Use C-x 1 to restore back to one window.
293 are currently open. Use C-x o to switch to the top window, then use the arrow
294 keys to move to the buffer you wish to switch to, and then type the Enter key to
295 select that buffer. Then use C-x 1 to switch back to only one window.
297 You may also move back to the last opened buffer by using C-x b to toggle back
300 >> Use C-x C-f to open a new file
301 >> Use C-x b to switch back and forth between that buffer and this one.
303 To kill any buffer, use C-x k. You will be prompted for the buffer to kill.
304 By default, the current buffer is selected as the one to kill. You may also
305 type another buffer name or use C-g to cancel the operation.
317 You've already seen C-x C-f and C-x C-s to open and save a file. There are
324 For instance, to replace text, you can type M-x repl TAB enter to execute
325 the replace-text command. To cancel this command, type C-g.
327 To see a list of all available mg(1) commands, consult the man page.
332 To exit mg temporarily and return to the shell, use C-z. This will take you
333 back to the command shell. To return back to mg, type fg in the shell and you
334 will be returned to your mg session.
336 To exit mg permanently, type C-x C-c. If you have any unsaved buffers, you
337 will be asked if you wish to save them or not.
342 This tutorial is meant to get new users up and running with mg. There is more
344 improvement, please don't hesitate to drop a message or (better still) submit
345 a diff to tech@openbsd.org.