* reordered a little bit
[mascara-docs.git] / i86 / elks / elkscmd / elvis / doc / visual.doc
blobee1c28bc678720c38d1c920277ab507ccf1ea302
2      Elvis 1.4              VISUAL MODE COMMANDS                Page 2-1
5 E2.  VISUAL MODE COMMANDSF
7         Most visual mode commands are one keystroke long.  The following 
8      table  lists  the  operation  performed by each keystroke, and also
9      denotes any options or arguments that it accepts.  Notes at the end 
10      of the table describe the notation used in this table.  
12         In addition to the keys listed  here,  your  keyboard's  "arrow"
13      keys  will  be  interpretted  as  the  appropriate  cursor movement
14      commands.  The same goes for <PgUp> and <PgDn>,  if  your  keyboard
15      has them.    There  is a colon mode command (to be described later)
16      which will allow you to define other keys, such as function keys.  
18         A tip: visual command mode looks a lot like text input mode.  If 
19      you forget which mode you're in, just hit the <Esc> key.  If  elvis
20      beeps, then you're in visual command mode.  If elvis does not beep, 
21      then  you  were  in  input mode, but by hitting <Esc> you will have
22      switched to visual command mode.  So, one  way  or  another,  after
23      <Esc> elvis will be ready for a command.  
25 -1command         description                                             type-0
26         ^A      ---
27         ^B      Move toward the top of the file by 1 screenful
28         ^C      ---
29 count   ^D      scroll down <count> lines (default 1/2 screen)
30 count   ^E      scroll up <count> lines
31         ^F      move toward the bottom of the file by 1 screenful
32         ^G      show file status, and the current line #
33 count   ^H      move left, like h                                       MOVE
34         ^I      ---
35 count   ^J      move down                                               MOVE
36         ^K      ---
37         ^L      redraw the screen
38 count   ^M      move to the front of the next line                      MOVE
39 count   ^N      move down                                               MOVE
40         ^O      ---
41 count   ^P      move up                                                 MOVE
42         ^Q      ---
43         ^R      redraw the screen
44         ^S      ---
45         ^T      ---
46 count   ^U      scroll up <count> lines (default 1/2 screen)
47         ^V      ---
48         ^W      ---
49         ^X      ---
50 count   ^Y      scroll down <count> lines
51         ^Z      ---
52         ESC     ---
53         ^\      ---
54         ^]      if the cursor is on a tag name, go to that tag
55         ^^      switch to the previous file, like ":e #"
56         ^_      ---
57 count   SPC     move right,like l                                       MOVE
58          ! mv   run the selected lines thru an external filter program
59          " key  select which cut buffer to use next
60 count    # +    increment a number                                      EDIT
61          $      move to the rear of the current line                    MOVE
62          %      move to the matching (){}[] character                   MOVE
68      Elvis 1.4              VISUAL MODE COMMANDS                Page 2-2
71 count    &      repeat the previous ":s//" command here                 EDIT
72          ' key  move to a marked line                                   MOVE
73 count    (      move backward <count> sentences                         MOVE
74 count    )      move forward <count> sentences                          MOVE
75          *      go to the next error in the errlist
76 count    +      move to the front of the next line                      MOVE
77 count    ,      repeat the previous [fFtT] but in the other direction   MOVE
78 count    -      move to the front of the preceding line                 MOVE
79 count    .      repeat the previous "edit" command
80          / text search forward for a given regular expression           MOVE
81          0      if not part of count, move to 1st char of this line     MOVE
82          1      part of count
83          2      part of count
84          3      part of count
85          4      part of count
86          5      part of count
87          6      part of count
88          7      part of count
89          8      part of count
90          9      part of count
91          : text run single EX cmd
92 count    ;      repeat the previous [fFtT] cmd                          MOVE
93          < mv   shift text left                                         EDIT
94          =      ---
95          > mv   shift text right                                        EDIT
96          ? text search backward for a given regular expression          MOVE
97          @ key  execute the contents of a cut-buffer as VI commands
98 count    A inp  append at end of the line                               EDIT
99 count    B      move back Word                                          MOVE
100          C inp  change text from the cursor through the end of the line EDIT
101          D      delete text from the cursor through the end of the line EDIT
102 count    E      move end of Word                                        MOVE
103 count    F key  move leftward to a given character                      MOVE
104 count    G      move to line #<count> (default is the bottom line)      MOVE
105 count    H      move to home row (the line at the top of the screen)
106 count    I inp  insert at the front of the line (after indents)         EDIT
107 count    J      join lines, to form one big line                        EDIT
108          K      look up keyword
109 count    L      move to last row (the line at the bottom of the screen)
110          M      move to middle row
111          N      repeat previous search, but in the opposite direction   MOVE
112 count    O inp  open up a new line above the current line               EDIT
113          P      paste text before the cursor
114          Q      quit to EX mode
115          R inp  overtype                                                EDIT
116 count    S inp  change lines, like <count>cc
117 count    T key  move leftward *almost* to a given character             MOVE
118          U      Undo all recent changes to the current line
119          V      ---
120 count    W      move forward <count> Words                              MOVE
121 count    X      delete the character(s) to the left of the cursor       EDIT
122 count    Y      yank text line(s) (copy them into a cut buffer)
123          Z Z    save the file & exit
124          [ [    move back 1 section                                     MOVE
125          \      ---
126          ] ]    move forward 1 section                                  MOVE
127          ^      move to the front of the current line (after indent)    MOVE
128          _      ---
134      Elvis 1.4              VISUAL MODE COMMANDS                Page 2-3
137          ` key  move to a marked character                              MOVE
138 count    a inp  insert text after the cursor                            EDIT
139 count    b      move back <count> words                                 MOVE
140          c mv   change text                                             EDIT
141          d mv   delete text                                             EDIT
142 count    e      move forward to the end of the current word             MOVE
143 count    f key  move rightward to a given character                     MOVE
144          g      ---
145 count    h      move left                                               MOVE
146 count    i inp  insert text at the cursor                               EDIT
147 count    j      move down                                               MOVE
148 count    k      move up                                                 MOVE
149 count    l      move right                                              MOVE
150          m key  mark a line or character
151          n      repeat the previous search                              MOVE
152 count    o inp  open a new line below the current line                  EDIT
153          p      paste text after the cursor
154          q      ---
155 count    r key  replace <count> chars by a given character              EDIT
156 count    s inp  replace <count> chars with text from the user           EDIT
157 count    t key  move rightward *almost* to a given character            MOVE
158          u      undo the previous edit command
159          v      ---
160 count    w      move forward <count> words                              MOVE
161 count    x      delete the character that the cursor's on               EDIT
162          y mv   yank text (copy it into a cut buffer)
163          z key  scroll current line to the screen's +=top -=bottom .=middle
164 count    {      move back <count> paragraphs                            MOVE
165 count    |      move to column <count> (the leftmost column is 1)
166 count    }      move forward <count> paragraphs                         MOVE
167 count    ~      switch a character between uppercase & lowercase        EDIT
168         DEL     ---
169 --------------------------------------------------------------------------------
171 count   Many commands may be preceded by a count.  This is a sequence of digits
172         representing a decimal number.  For most commands that use a count,
173         the command is repeated <count> times.  The count is always optional,
174         and usually defaults to 1.
176 key     Some commands require two keystrokes.  The first key always determines
177         which command is to be executed.  The second key is used as a parameter
178         to the command.
180 mv      Six commands (! < > c d y) operate on text between the cursor and some
181         other position.  To specify that other position, you are expected to
182         follow the command keystroke with a movement command.  Also, you may
183         have the command operate on the whole line that the cursor is on by
184         typing the command key a second time.
186 inp     Many commands allow the user to interactively enter text.
188 EDIT    These commands affect text, and may be repeated by the "." command.
190 MOVE    These commands move the cursor, and may be used to specify the extent
191         of a member of the "mv" class of commands.
200      Elvis 1.4              VISUAL MODE COMMANDS                Page 2-4
203    E2.1  Input ModeF
205         You  can't type text into your file directly from visual command
206      mode.  Instead, you must first give a command which  will  put  you
207      into input mode.  The commands to do this are A/C/I/O/R/S/a/i/o/s.  
209         The  S/s/C/c  commands  temporarily  place a $ at the end of the
210      text that they are going to change.  
212         In input mode, all keystrokes are inserted into the text at  the
213      cursor's position, except for the following: 
215                 ^A      insert a copy of the last input text
216                 ^D      delete one indent character
217                 ^H      (backspace) erase the character before the cursor
218                 ^L      redraw the screen
219                 ^M      (carriage return) insert a newline (^J, linefeed)
220                 ^P      insert the contents of the cut buffer
221                 ^R      redraw the screen, like ^L
222                 ^T      insert an indent character
223                 ^U      backspace to the beginning of the line
224                 ^V      insert the following keystroke, even if special
225                 ^W      backspace to the beginning of the current word
226                 ^Z^Z    write the file & exit elvis
227                 ^[      (ESCape) exit from input mode, back to command mode
229         Also,  on  some  systems,  ^S  may  stop  output, ^Q may restart
230      output, and ^C may interupt execution.    ^@  (the  NUL  character)
231      cannot be inserted.  
233         The  R  visual  command  puts  you  in overtype mode, which is a
234      slightly different form of input mode.  In overtype mode, each time 
235      you insert a character, one of the old characters is  deleted  from
236      the file.  
239    E2.2  Arrow keys in Input ModeF
241         The  arrow  keys  can  be used to move the cursor in input mode.
242      (This is an extension; the real Vi doesn't support  arrow  keys  in
243      input  mode.)  The  <PgUp>,  <PgDn>, <Home>, and <End> keys work in
244      input mode, too.  The <Delete> key deletes a  single  character  in
245      input mode.  
247         The  best  thing about allowing arrow keys to work in input mode
248      is that as long as you're in input mode,  Elvis  seems  to  have  a
249      fairly ordinary  user interface.  With most other text editors, you
250      are always in either insert mode or replace mode, and you  can  use
251      the arrow  keys at any time to move the cursor.  Now, Elvis can act
252      like that, too.  In fact, with the new "inputmode" option  and  the
253      "control-Z  control-Z" input command, you may never have to go into
254      visual command mode for simple edit sessions.  
266      Elvis 1.4              VISUAL MODE COMMANDS                Page 2-5
269    E2.3  DigraphsF
271         Elvis supports digraphs as a way to enter non-ASCII  characters.
272      A   digraph   is  a  character  which  is  composed  of  two  other
273      characters.  For example, an apostrophe and the letter i  could  be
274      defined  as  a  digraph  which  is  to  be stored & displayed as an
275      accented i.  
277         There is no single standard for extended ASCII  character  sets.
278      Elvis  can  be compiled to fill the digraph with values appropriate
279      for either the IBM PC character set, or the LATIN-1  character  set
280      used by  X windows, or neither.  (See the discussions of -DCS_IBMPC
281      and -DCS_LATIN1 in the CFLAGS section of this manual.) You can view 
282      or edit the digraph table via the ":digraph" colon command.  
284         Digraphs wil  not  be  recognized  until  you've  entered  ":set
285      digraph".  
287         To  actually  use  a  digraph type the first character, then hit
288      <Backspace>, and then type the second character.  Elvis  will  then
289      substitute the non-ASCII character in their place.  
292    E2.4  AbbreviationsF
294         Elvis can   expand   abbreviations  for  you.    You  define  an
295      abbreviation with the :abbr command, and then whenever you type  in
296      the  abbreviated  form  while in input mode, elvis will immediately
297      the long form.  COBOL programmers should find this useful.  :-) 
299         Elvis  doesn't  perform  the  substitution  until  you  type   a
300      non-alphanumeric character  to  mark  the  end of the word.  If you
301      type a control-V before that non-alphanumeric character, then Elvis 
302      will not perform the substitution.  
305    E2.5  Auto-IndentF
307         With  the  ":set  autoindent"  option  turned  on,  Elvis   will
308      automatically  insert  leading  whitespace at the beginning of each
309      new line that you type in.  The leading whitespace is  copied  from
310      the preceding line.  
312         To add  more leading whitespace, type control-T.  To remove some
313      whitespace, type control-D.  
315         Elvis' autoindent mode isn't 100%  compatible  with  vi's.    In
316      Elvis, 0^D and ^^D don't work, ^U can wipeout all indentation,  and 
317      sometimes  Elvis will use a different amount of indentation than vi
318      would.