home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / elvis184.zip / doc / visual.ms < prev   
Text File  |  1993-05-13  |  12KB  |  298 lines

  1. .Go 2 "VISUAL MODE COMMANDS"
  2. .PP
  3. Most visual mode commands are one keystroke long.
  4. The following table lists the operation performed by each keystroke,
  5. and also denotes any options or arguments that it accepts.
  6. Notes at the end of the table describe the notation used in this table.
  7. .PP
  8. In addition to the keys listed here, your keyboard's "arrow" keys
  9. will be interpreted as the appropriate cursor movement commands.
  10. The same goes for <PgUp> and <PgDn>, if your keyboard has them.
  11. The <Insert> key will toggle between insert mode and replace mode.
  12. There is a colon mode command (":map", to be described later)
  13. which will allow you to define other keys, such as function keys.
  14. .PP
  15. A tip: visual command mode looks a lot like text input mode.
  16. If you forget which mode you're in, just hit the <Esc> key.
  17. If \*E beeps, then you're in visual command mode.
  18. If \*E does not beep, then you were in input mode,
  19. but by hitting <Esc> you will have switched to visual command mode.
  20. So, one way or another, after <Esc> \*E will be ready for a command.
  21. .LD
  22. .ta 0.7i 1.3i
  23. \*SCOMMAND    DESCRIPTION\*s
  24.     ^A    Search for next occurrence of word at cursor (MOVE)(EXT)
  25.     ^B    Move toward the top of the file by 1 screenful
  26.     ^C    --- (usually sends SIGINT, to interrupt a command)
  27. count    ^D    Scroll down <count> lines (default 1/2 screen)
  28. count    ^E    Scroll up <count> lines
  29.     ^F    Move toward the bottom of the file by 1 screenful
  30.     ^G    Show file status, and the current line #
  31. count    ^H    Move left, like h (MOVE)
  32.     ^I    ---
  33. count    ^J    Move down (MOVE)
  34.     ^K    ---
  35.     ^L    Redraw the screen
  36. count    ^M    Move to the front of the next line (MOVE)
  37. count    ^N    Move down (MOVE)
  38.     ^O    ---
  39. count    ^P    Move up (MOVE)
  40.     ^Q    --- (typically XON, which restarts screen updates)
  41.     ^R    Redraw the screen
  42.     ^S    --- (typically XOFF, which stops screen updates)
  43.     ^T    Return to source of previous :tag or ^] command.
  44. count    ^U    Scroll up <count> lines (default 1/2 screen)
  45.     ^V    ---
  46.     ^W    ---
  47. count    ^X    Move to a physical column number on the screen (MOVE) (EXT)
  48. count    ^Y    Scroll down <count> lines
  49.     ^Z    --- (sometimes sends SIGSUSP, to suspend execution)
  50.     ESC    ---
  51.     ^\\    --- (usually sends SIGQUIT, which is ignored)
  52.     ^]    If the cursor is on a tag name, go to that tag
  53.     ^^    Switch to the previous file, like ":e #"
  54. count    ^_    Move to a given screen-relative row (MOVE) (EXT)
  55. count    SPC    Move right,like l (MOVE)
  56.     ! \*smv\*S    Run the selected lines thru an external filter program
  57.     " \*skey\*S    Select which cut buffer to use next
  58. count    # \*s+\*S    Increment a number (EDIT) (EXT)
  59.     $    Move to the rear of the current line (MOVE)
  60. count    %    Move to matching (){}[] or to a given % of file (MOVE) (EXT)
  61. count    &    Repeat the previous ":s//" command here (EDIT)
  62.     ' \*skey\*S    Move to a marked line (MOVE)
  63. count    (    Move backward <count> sentences (MOVE)
  64. count    )    Move forward <count> sentences (MOVE)
  65.     *    Go to the next error in the errlist (EXT)
  66. count    +    Move to the front of the next line (MOVE)
  67. count    ,    Repeat the previous [fFtT] but in the other direction (MOVE)
  68. count    -    Move to the front of the preceding line (MOVE)
  69. count    .    Repeat the previous "edit" command
  70.     / \*stext\*S    Search forward for a given regular expression (MOVE)
  71.     0    If not part of count, move to 1st char of this line (MOVE)
  72.     1    Part of count
  73.     2    Part of count
  74.     3    Part of count
  75.     4    Part of count
  76.     5    Part of count
  77.     6    Part of count
  78.     7    Part of count
  79.     8    Part of count
  80.     9    Part of count
  81.     : \*stext\*S    Run single EX cmd
  82. count    ;    Repeat the previous [fFtT] cmd (MOVE)
  83.     < \*smv\*S    Shift text left (EDIT)
  84.     = \*smv\*S    Reformat
  85.     > \*smv\*S    Shift text right (EDIT)
  86.     ? \*stext\*S    Search backward for a given regular expression (MOVE)
  87.     @ \*skey\*S    Execute the contents of a cut-buffer as VI commands
  88. count    A \*sinp\*S    Append at end of the line (EDIT)
  89. count    B    Move back Word (MOVE)
  90.     C \*sinp\*S    Change text from the cursor through the end of the line (EDIT)
  91.     D    Delete text from the cursor through the end of the line (EDIT)
  92. count    E    Move end of Word (MOVE)
  93. count    F \*skey\*S    Move leftward to a given character (MOVE)
  94. count    G    Move to line #<count> (default is the bottom line) (MOVE)
  95. count    H    Move to home row (the line at the top of the screen)
  96. count    I \*sinp\*S    Insert at the front of the line (after indents) (EDIT)
  97. count    J    Join lines, to form one big line (EDIT)
  98.     K    Look up keyword (EXT)
  99. count    L    Move to last row (the line at the bottom of the screen)
  100.     M    Move to middle row
  101.     N    Repeat previous search, but in the opposite direction (MOVE)
  102. count    O \*sinp\*S    Open up a new line above the current line (EDIT)
  103.     P    Paste text before the cursor (EDIT)
  104.     Q    Quit to EX mode
  105.     R \*sinp\*S    Overtype (EDIT)
  106. count    S \*sinp\*S    Change lines, like <count>cc
  107. count    T \*skey\*S    Move leftward *almost* to a given character (MOVE)
  108.     U    Undo all recent changes to the current line
  109.     V    Start marking lines for c/d/y/</>/!/\\ (EXT)
  110. count    W    Move forward <count> Words (MOVE)
  111. count    X    Delete the character(s) to the left of the cursor (EDIT)
  112. count    Y    Yank text line(s) (copy them into a cut buffer)
  113.     Z Z    Save the file & exit
  114.     [ [    Move back 1 section (MOVE)
  115.     \\ \*smv\*S    Pop-up menu for modifying text (EXT)
  116.     ] ]    Move forward 1 section (MOVE)
  117.     ^    Move to the front of the current line (after indent) (MOVE)
  118. count    _    Move to the current line
  119.     ` \*skey\*S    Move to a marked character (MOVE)
  120. count    a \*sinp\*S    Insert text after the cursor (EDIT)
  121. count    b    Move back <count> words (MOVE)
  122.     c \*smv\*S    Change text (EDIT)
  123.     d \*smv\*S    Delete text (EDIT)
  124. count    e    Move forward to the end of the current word (MOVE)
  125. count    f \*skey\*S    Move rightward to a given character (MOVE)
  126.     g    ---
  127. count    h    Move left (MOVE)
  128. count    i \*sinp\*S    Insert text at the cursor (EDIT)
  129. count    j    Move down (MOVE)
  130. count    k    Move up (MOVE)
  131. count    l    Move right (MOVE)
  132.     m \*skey\*S    Mark a line or character
  133.     n    Repeat the previous search (MOVE)
  134. count    o \*sinp\*S    Open a new line below the current line (EDIT)
  135.     p    Paste text after the cursor (EDIT)
  136.     q    ---
  137. count    r \*skey\*S    Replace <count> chars by a given character (EDIT)
  138. count    s \*sinp\*S    Replace <count> chars with text from the user (EDIT)
  139. count    t \*skey\*S    Move rightward *almost* to a given character (MOVE)
  140.     u    Undo the previous edit command
  141.     v    Start marking characters for c/d/y/</>/!/\\ (EXT)
  142. count    w    Move forward <count> words (MOVE)
  143. count    x    Delete the character that the cursor's on (EDIT)
  144.     y \*smv\*S    Yank text (copy it into a cut buffer)
  145.     z \*skey\*S    Scroll current line to the screen's +=top -=bottom .=middle
  146. count    {    Move back <count> paragraphs (MOVE)
  147. count    |    Move to column <count> (the leftmost column is 1)
  148. count    }    Move forward <count> paragraphs (MOVE)
  149. count    ~    Switch a character between uppercase & lowercase (EDIT)
  150.     DEL    --- (usually mapped to shift-X, so it deletes one character)
  151. .DE
  152. .IP count 0.7i
  153. Many commands may be preceded by a count.  This is a sequence of digits
  154. representing a decimal number.  For most commands that use a count,
  155. the command is repeated <count> times.  The count is always optional,
  156. and usually defaults to 1.
  157. .IP key 0.7i
  158. Some commands require two keystrokes.  The first key always determines
  159. which command is to be executed.  The second key is used as a parameter
  160. to the command.
  161. .IP mv 0.7i
  162. Some commands (! < > c d y \\ =) operate on text between the cursor and some
  163. other position.
  164. There are three ways that you can specify that other position.
  165. .IP "" 0.7i
  166. The first way is to follow the command keystroke with a movement command.
  167. For example, "dw" deletes a single word.
  168. "d3w" and "3dw" both delete three words.
  169. .IP "" 0.7i
  170. The second way is to type the command keystroke twice.
  171. This causes whole lines to be acted upon.
  172. For example, ">>" indents the current line.
  173. "3>>" indents the current line and the following two lines.
  174. .IP "" 0.7i
  175. The last way is to move the cursor to one end of the text,
  176. type 'v' or 'V' to start marking,
  177. move the cursor to the other end,
  178. and then type the desired command key.
  179. .IP inp 0.7i
  180. Many commands allow the user to interactively enter text.
  181. See the discussion of "input mode" in the following section.
  182. .IP (EXT) 0.7i
  183. These commands are extensions -- the real vi doesn't have them.
  184. .IP (EDIT) 0.7i
  185. These commands affect text, and may be repeated by the "." command.
  186. .IP (MOVE) 0.7i
  187. These commands move the cursor, and may be used to specify the extent
  188. of a member of the "mv" class of commands.
  189. .NH 2
  190. Input Mode
  191. .PP
  192. You can't type text into your file directly from visual command mode.
  193. Instead, you must first give a command which will put you into input mode.
  194. The commands to do this are A/C/I/O/R/S/a/i/o/s.
  195. .PP
  196. The S/s/C/c commands temporarily place a $ at the end of the text that
  197. they are going to change.
  198. .PP
  199. In input mode, all keystrokes are inserted into the text at the
  200. cursor's position, except for the following:
  201. .ID
  202. ^A    insert a copy of the last input text
  203. ^D    delete one indent character
  204. ^H    (backspace) erase the character before the cursor
  205. ^L    redraw the screen
  206. ^M    (carriage return) insert a newline (^J, linefeed)
  207. ^O    execute next key as a visual command (limited!)
  208. ^P    insert the contents of the cut buffer
  209. ^R    redraw the screen, like ^L
  210. ^T    insert an indent character
  211. ^U    backspace to the beginning of the line
  212. ^V    insert the following keystroke, even if special
  213. ^W    backspace to the beginning of the current word
  214. ^Z^Z    write the file & exit \*E
  215. ^[    (ESCape) exit from input mode, back to command mode
  216. .DE
  217. .PP
  218. Also, on some systems, ^S may stop output, ^Q may restart output,
  219. and ^C may interrupt execution.
  220. ^@ (the NUL character) cannot be inserted.
  221. .PP
  222. The R visual command puts you in overtype mode,
  223. which is a slightly different form of input mode.
  224. In overtype mode, each time you insert a character,
  225. one of the old characters is deleted from the file.
  226. .NH 2
  227. Arrow keys in Input Mode
  228. .PP
  229. The arrow keys can be used to move the cursor in input mode.
  230. (This is an extension; the real Vi doesn't support arrow keys in input mode.)
  231. The <PgUp>, <PgDn>, <Home>, and <End> keys work in input mode, too.
  232. The <Delete> key deletes a single character in input mode.
  233. The <Insert> key toggles between input mode and replace mode.
  234. .PP
  235. The best thing about allowing arrow keys to work in input mode is that
  236. as long as you're in input mode,
  237. \*E seems to have a fairly ordinary user interface.
  238. With most other text editors, you are always in either insert mode or
  239. replace mode, and you can use the arrow keys at any time to move the cursor.
  240. Now, \*E can act like that, too.
  241. In fact, with the new "inputmode" option and the "control-Z control-Z" input
  242. command, you may never have to go into visual command mode for simple edit
  243. sessions.
  244. .NH 2
  245. Digraphs
  246. .PP
  247. \*E supports digraphs as a way to enter non-ASCII characters.
  248. A digraph is a character which is composed of two other characters.
  249. For example, an apostrophe and the letter i could be defined as a digraph
  250. which is to be stored & displayed as an accented i.
  251. .PP
  252. There is no single standard for extended ASCII character sets.
  253. \*E can be compiled to fill the digraph with values appropriate for
  254. either the IBM PC character set, or the LATIN-1 character set used by
  255. X windows, or neither.
  256. (See the discussions of -DCS_IBMPC and -DCS_LATIN1 in the CFLAGS section
  257. of this manual.)
  258. You can view or edit the digraph table via the ":digraph" colon command.
  259. .PP
  260. Digraphs will not be recognized until you've entered ":set digraph".
  261. .PP
  262. To actually use a digraph
  263. type the first character, then hit <Backspace>, and then type the
  264. second character.
  265. \*E will then substitute the non-ASCII character in their place.
  266. .NH 2
  267. Abbreviations
  268. .PP
  269. \*E can expand abbreviations for you.
  270. You define an abbreviation with the :abbr command,
  271. and then whenever you type in the abbreviated form while in input mode,
  272. \*E will immediately replace it with the long form.
  273. COBOL programmers should find this useful. :-)
  274. .PP
  275. \*E doesn't perform the substitution until you type a non-alphanumeric
  276. character to mark the end of the word.
  277. If you type a control-V before that non-alphanumeric character, then
  278. \*E will not perform the substitution.
  279. .NH 2
  280. Auto-Indent
  281. .PP
  282. With the ":set autoindent" option turned on,
  283. \*E will automatically insert leading whitespace at the beginning of each
  284. new line that you type in.
  285. The leading whitespace is copied from the preceding line.
  286. .PP
  287. To add more leading whitespace, type control-T.
  288. To remove some whitespace, type control-D.
  289. .PP
  290. If you ":set noautotab", then the whitespace generated by control-T will
  291. always consist of spaces -- never tabs.
  292. Some people seem to prefer this.
  293. .PP
  294. \*E' autoindent mode isn't 100% compatible with vi's.
  295. In \*E, 0^D and ^^D don't work,
  296. ^U can wipeout all indentation, 
  297. and sometimes \*E will use a different amount of indentation than vi would.
  298.