home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / editor / elvis / visual.doc < prev    next >
Text File  |  1994-01-30  |  14KB  |  397 lines

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