home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume41 / vim / part22 < prev    next >
Text File  |  1993-12-21  |  49KB  |  1,166 lines

  1. Newsgroups: comp.sources.misc
  2. From: mool@oce.nl (Bram Moolenaar)
  3. Subject: v41i072:  vim - Vi IMitation editor, v2.0, Part22/25
  4. Message-ID: <1993Dec21.172842.2226@sparky.sterling.com>
  5. X-Md4-Signature: a82ff193c3127998b91612d1334970a0
  6. Keywords: utility, editor, vi, vim
  7. Sender: kent@sparky.sterling.com (Kent Landfield)
  8. Organization: Sterling Software
  9. Date: Tue, 21 Dec 1993 17:28:42 GMT
  10. Approved: kent@sparky.sterling.com
  11.  
  12. Submitted-by: mool@oce.nl (Bram Moolenaar)
  13. Posting-number: Volume 41, Issue 72
  14. Archive-name: vim/part22
  15. Environment: UNIX, AMIGA, MS-DOS
  16. Supersedes: vim: Volume 37, Issue 1-24
  17.  
  18. #! /bin/sh
  19. # This is a shell archive.  Remove anything before this line, then unpack
  20. # it by saving it into a file and typing "sh file".  To overwrite existing
  21. # files, type "sh file -c".  You can also feed this as standard input via
  22. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  23. # will see the following message at the end:
  24. #        "End of archive 22 (of 25)."
  25. # Contents:  vim/doc/reference.do2
  26. # Wrapped by mool@oce-rd2 on Wed Dec 15 09:50:08 1993
  27. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  28. if test -f 'vim/doc/reference.do2' -a "${1}" != "-c" ; then 
  29.   echo shar: Will not clobber existing file \"'vim/doc/reference.do2'\"
  30. else
  31. echo shar: Extracting \"'vim/doc/reference.do2'\" \(45369 characters\)
  32. sed "s/^X//" >'vim/doc/reference.do2' <<'END_OF_FILE'
  33. X       available. Vim tries to detect the type of filesystem when it is 
  34. X       creating the .vim file. If an MSDOS-like filesystem is suspected, 
  35. X       a flag is set that has the same effect as setting the 'shortname' 
  36. X       option. This flag will be reset as soon as you start editing a 
  37. X       new file. The flag will be used when making the filename for the 
  38. X       ".vim" and ".bak" files for the current file. But when you are 
  39. X       editing a file in a normal filesystem and write to an MSDOS-like 
  40. X       filesystem the flag will not have been set. In that case the 
  41. X       creation of the ".bak" file may fail and you will get an error 
  42. X       message. Use the 'shortname' option in this case.
  43. X
  44. XVim remembers whether you have changed the buffer. You are protected from
  45. Xlosing the changes you made. If you try to quit without writing, or want to
  46. Xstart editing another file, this will be refused. In order to overrule this
  47. Xprotection add a <!> to the command. The changes will then be lost. For
  48. Xexample: ":q" will not work if the buffer was changed, but ":q!" will. To see
  49. Xwhether the buffer was changed use the "CTRL-G" command. The message includes
  50. Xthe string "[Modified]" if the buffer has been changed.
  51. X
  52. X
  53. X5.2 Editing a file
  54. X
  55. X:e[dit] [+pat]        Edit the current file, unless changes have been made.
  56. X
  57. X:e[dit]! [+pat]        Edit the current file always. Discard any changes to
  58. X            the buffer.
  59. X
  60. X:e[dit] [+pat] {file}    Edit {file}, unless changes have been made.
  61. X
  62. X:e[dit]! [+pat] {file}    Edit {file} always. Discard any changes to the
  63. X            buffer.
  64. X
  65. X:e[dit] #[count]        Edit the [count]th alternate filename (as shown by
  66. X                        :files). Omitting [count] is equivalent to CTRL-^.
  67. X
  68. X:ex [+pat] [file]    Same as :edit. {Vi: go from visual to Ex mode}
  69. X
  70. X:vi[sual] [+pat] [file]    Same as :edit. {Vi: go from Ex to Visual mode}
  71. X
  72. X[count]CTRL-^        Edit [count]th alternate file (equivalent to ":e
  73. X            #[count]"). Without count this gets you to the
  74. X            previously edited file. This is a quick way to
  75. X            toggle between two (or more) files. If the
  76. X            'autowrite' option is set and the buffer was
  77. X            changed, write it.
  78. X
  79. X:cd            On non-Unix systems: Print the current directory
  80. X            name. On Unix systems: Change the current directory
  81. X            to the home directory.
  82. X
  83. X:cd {path}        Change the current directory to {path}. Does not
  84. X            change the meaning of an already entered file name,
  85. X            because its full path name is remembered.
  86. X
  87. X:chd[ir] [path]        Same as :cd.
  88. X
  89. X:pwd            Print the current directory name. {Vi: no pwd}
  90. X
  91. XThese commands are used to start editing a single file. This means that the
  92. Xfile is read into the buffer and the current filename is set. You may use the
  93. X":cd" command to get to another directory, so you will not have to type that 
  94. Xdirectory name in front of the filenames. One warning: After using ":cd" the
  95. Xfull path name will be used for reading and writing files. On some networked
  96. Xfile systems this may cause problems. The result of using the full path name
  97. Xis that the file names currently in use will remain refering to the same
  98. Xfile. Example: If you have a file a:test and a directory a:vim the commands
  99. X":e test" ":cd vim" ":w" will overwrite the file a:test and not write
  100. Xa:vim/test. But if you do ":w test" the file a:vim/test will be written,
  101. Xbecause you gave a new file name and did not refer to a file name before the
  102. X":cd".
  103. X
  104. XYou can use the ":e!" command if you messed up the buffer and want to start 
  105. Xall over again. The ":e" command is only useful if you have changed the 
  106. Xcurrent filename.
  107. X
  108. XThe [+pat] can be used to position the cursor in the newly opened file:
  109. X    +        Start at the last line.
  110. X    +{num}        Start at line {num}.
  111. X    +/{pat}        Start at first line containing {pat}. {pat} must not
  112. X            contain any spaces.
  113. X    +{command}    Execute {command} after opening the new file.
  114. X            {command} is an Ex command. It must not contain 
  115. X            spaces.
  116. X
  117. XWhen reading a file when the 'textmode' option is off (default for
  118. Xnon-MSDOS) the <LF> character is interpreted as end-of-line. If 'textmode'
  119. Xis on (default for MSDOS), <CR><LF> is also interpreted as end-of-line.
  120. X
  121. XWhen writeing a file when the 'textmode' option is off a <LF> character is
  122. Xused to separate lines. When the 'textmode' option is on <CR><LF> is used.
  123. X
  124. XYou can read a file with 'textmode' set and write it with 'textmode' reset.
  125. XThis will replace all <CR><LF> pairs by <LF>. If you read a file with
  126. X'textmode' reset and write with 'textmode' set, all <LF> characters will be
  127. Xreplaced by <CR><LF>.
  128. X
  129. XIf you start editing a new file and the 'textauto' option is set, Vim will
  130. Xtry to detect whether the lines in the file are separated by a single <LF>
  131. X(as used on Unix and Amiga) or by a <CR><LF> pair (MSDOS). It reads up to
  132. Xthe first <LF> and checks if there is a <CR> in front of it. If there is the
  133. X'textmode' option is set, otherwise it is reset. If the 'textmode' option is
  134. Xset on non-MSDOS systems the message "[textmode]" is shown to remind you
  135. Xthat something unusual is happening. On MSDOS systems you get the message
  136. X"[notextmode]" if the 'textmode' option is not set.
  137. X
  138. XBefore editing binary, executable or Vim script files you should set the
  139. X'textmode' and 'textauto' options off. With 'textmode' on you risc that
  140. Xsingle <LF> characters are unexpectedly replaced with <CR><LF>. A simple way
  141. Xto do this is by starting Vim with the "-b" option.
  142. X
  143. X
  144. X5.3 The file list
  145. X
  146. XIf you give more than one filename when starting Vim, this list is remembered
  147. Xas the file list. You can use this list with the following commands:
  148. X
  149. X:ar[gs]            Print the file list, with the current file in "[]".
  150. X
  151. X:[count]n[ext]        Edit [count] next file, unless changes have been 
  152. X            made and the 'autowrite' option is off {Vi: no 
  153. X            count}.
  154. X
  155. X:[count]n[ext]!        Edit [count] next file, discard any changes to the 
  156. X            buffer {Vi: no count}.
  157. X
  158. X:n[ext] [+pat] {filelist}
  159. X            Define {filelist} as the new list of files and edit
  160. X            the first one, unless changes have been made and the
  161. X            'autowrite' option is off.
  162. X
  163. X:n[ext]! [+pat] {filelist}
  164. X            Define {filelist} as the new list of files and edit
  165. X            the first one. Discard any changes to the buffer.
  166. X
  167. X:[count]N[ext]        Edit [count] previous file in file list, unless 
  168. X            changes have been made and the 'autowrite' option is 
  169. X            off {Vi: no count}.
  170. X
  171. X:[count]N[ext]!        Edit [count] previous file in file list. Discard any 
  172. X            changes to the buffer {Vi: no count}.
  173. X
  174. X:[count]pre[vious]    Same as :Next {Vi: only in some versions}
  175. X
  176. X:rew[ind]        Start editing the first file in the file list, unless
  177. X            changes have been made and the 'autowrite' option is
  178. X            off.
  179. X
  180. X:rew[ind]!        Start editing the first file in the file list.
  181. X            Discard any changes to the buffer.
  182. X
  183. X:[count]wn[ext]        Write current file and start editing the [count] 
  184. X            next file. {not in Vi}
  185. X
  186. X:[count]wn[ext] {file}    Write current file to {file} and start editing the 
  187. X            [count] next file, unless {file} already exists and 
  188. X            the 'writeany' option is off. 
  189. X            {not in Vi}
  190. X
  191. X:[count]wn[ext]! {file}    Write current file to {file} and start editing the 
  192. X            [count] next file. {not in Vi}
  193. X
  194. XThe [count] in the commands above defaults to one.
  195. X
  196. XThe wildcards in the file list are expanded and the filenames are sorted.
  197. XThus you can use the command "vim *.c" to edit all the C files. From within 
  198. XVim the command ":n *.c" does the same.
  199. X
  200. XYou are protected from leaving Vim if you are not editing the last file in 
  201. Xthe file list. This prevents you from forgetting that you were editing one 
  202. Xout of several files. You can exit anyway, and save any changes, with the 
  203. X":wq!" command. To lose any changes use the ":q!" command.
  204. X
  205. X
  206. X5.4 Writing and quitting
  207. X
  208. X:[range]w[rite][!]    Write the specified lines to the current file.
  209. X
  210. X:[range]w[rite]    {file}    Write the specified lines to {file}, unless it
  211. X            already exists and the 'writeany' option is off.
  212. X
  213. X:[range]w[rite]! {file}    Write the specified lines to {file}. Overwrite an
  214. X            existing file.
  215. X
  216. X:[range]w[rite][!] >>    Append the specified lines to the current file.
  217. X
  218. X:[range]w[rite][!] >> {file}
  219. X            Append the specified lines to {file}. <!> forces the
  220. X            write even if file does not exist.
  221. X
  222. X:[range]w[rite] !{cmd}    Execute {cmd} with [range] lines as standard input
  223. X            (note the space in front of the <!>).
  224. X
  225. XThe default [range] for the ":w" command is the whole buffer (1,$).
  226. X
  227. X
  228. X:q[uit]         Quit, unless changes have been made or not editing 
  229. X            the last file in the file list.
  230. X
  231. X:q[uit]!        Quit always, without writing.
  232. X
  233. X:cq            Quit always, without writing, and return an error 
  234. X            code. Used for Manx's QuickFix mode (see 5.5).
  235. X
  236. X:wq            Write the current file. Exit if not editing the
  237. X            last file in the file list.
  238. X
  239. X:wq!            Write the current file and exit.
  240. X
  241. X:wq {file}        Write to {file}. Exit if not editing the last
  242. X            file in the file list.
  243. X
  244. X:wq! {file}        Write to {file} and exit.
  245. X
  246. X:x[it][!] [file]    Like ":wq", but write only when changes have been
  247. X            made.
  248. X
  249. XZZ            Write current file, if modified, and exit (same as
  250. X            ":x").
  251. X
  252. XIf you write to an existing file (but do not append) while the 'backup' or 
  253. X'writebackup' option is on, a backup of the original file is made. On Unix 
  254. Xsystems the file is copied, on other systems the file is renamed. After the 
  255. Xfile has been successfully written and when the 'writebackup' option is on 
  256. Xand the 'backup' option is off, the backup file is deleted.
  257. X
  258. X'backup'    'writebackup'        action
  259. X   off             off        no backup made
  260. X   off             on            backup made, deleted afterwards
  261. X   on             off        backup made, not deleted
  262. X   on             on            backup made, not deleted (default)
  263. X
  264. XOn Unix systems:
  265. XWhen you write to an existing file, that file is truncated and then filled 
  266. Xwith the new text. This means that protection bits, owner and symbolic links 
  267. Xare unmodified. The backup file however, is a new file, owned by the user 
  268. Xwho edited the file. If it is not possible to create the backup file in the 
  269. Xsame directory as the original file, the directory given with the 
  270. X'backupdir' option is used (default: home directory).
  271. X
  272. XIf the creation of a backup file fails, the write is not done. If you want 
  273. Xto write anyway add a <!> to the command.
  274. X
  275. XIf the 'textmode' option is set <CR><LF> is used for end-of-line. This is
  276. Xdefault for MSDOS. On other systems the message "[textmode]" is shown to
  277. Xremind you that an usual end-of-line marker was used. If the 'textmode' is
  278. Xnot set LF is used for end-of-line. On MSDOS the message "[notextmode]" is
  279. Xshown. See also the 'textmode' and 'textauto' options.
  280. X
  281. X
  282. X5.5 Using the QuickFix mode
  283. X
  284. XVim has a special mode to speedup the edit-compile-edit cycle. This is
  285. Xinspired by the quickfix option of the Manx's Aztec C compiler on the Amiga.
  286. XThe idea is to save the error messages from the compiler in a file and use
  287. XVim to jump to the errors one by one. You can then examine each problem and
  288. Xfix it, without having to remember all the error messages.
  289. X
  290. XIf you are using Manx's Aztec C compiler on the Amiga you should do the
  291. Xfollowing:
  292. X- Set the CCEDIT environment variable with the command
  293. X    mset "CCEDIT=vim -e"
  294. X- Compile with the -qf option. If the compiler finds any errors, Vim is 
  295. X  started and the cursor is positioned on the first error. The error message
  296. X  will be displayed on the last line. You can go to other errors with the
  297. X  commands mentioned below. You can fix the errors and write the file(s).
  298. X- If you exit Vim normally the compiler will re-compile the same file. If you
  299. X  exit with the :cq command, the compiler will terminate. Do this if you
  300. X  cannot fix the error, or if another file needs to be compiled first.
  301. X
  302. XIf you are using another compiler you should save the error messages in a
  303. Xfile and start Vim with "vim -e filename". An easy way to do this is with
  304. Xthe ":make" command (see below). The 'errorformat' option should be set to
  305. Xmatch the error messages from your compiler (see below).
  306. X
  307. XThe following commands can be used if you are in QuickFix mode:
  308. X
  309. X:cc [nr]        Display error [nr]. If [nr] is omitted, the same
  310. X            error is displayed again. {not in Vi}
  311. X
  312. X:cn            Display the next error in the list that includes a
  313. X            file name. If there are no file names at all, go the
  314. X            the next error. {not in Vi}
  315. X
  316. X:cp            Display the previous error in the list that includes
  317. X            a file name. If there are no file names at all, go
  318. X            the the previous error. {not in Vi}
  319. X
  320. X:cq            Quit Vim with an error code, so that the compiler
  321. X            will not compile the same file again. {not in Vi}
  322. X
  323. X:cf [errorfile]        Read the error file and jump to the first error.
  324. X            This is done automatically when Vim is started with
  325. X            the -e option. You can use this command when you
  326. X            keep Vim running while compiling. If you give the
  327. X            name of the errorfile, the 'errorfile' option will
  328. X            be set to [errorfile] {not in Vi}
  329. X
  330. X:cl            List all errors. {not in Vi}
  331. X
  332. X:make [arguments]    1. If the 'autowrite' option is set and the buffer
  333. X               was changed, write it.
  334. X            2. Any existing 'errorfile' is deleted.
  335. X            3. The program given with the 'makeprg' option is
  336. X               started (default "make") with the optional
  337. X               [arguments] and the output is saved in
  338. X               'errorfile' (for Unix it is also echoed on the
  339. X               screen).
  340. X            4. The 'errorfile' is then read and the first error
  341. X               is jumped to.
  342. X            5. The 'errorfile' is deleted.
  343. X            {not in Vi}
  344. X
  345. XThe name of the file can be set with the 'errorfile' option. The default is 
  346. X"AztecC.Err" for the Amiga and "errors" for other systems. The format of the
  347. Xfile from the Aztec compiler is:
  348. X
  349. X    filename>linenumber:columnnumber:errortype:errornumber:errormessage
  350. X
  351. X    filename    name of the file in which the error was detected
  352. X    linenumber    line number where the error was detected
  353. X    columnnumber    column number where the error was detected
  354. X    errortype    type of the error, normally a single <E> or <W>
  355. X    errornumber    number of the error (for lookup in the manual)
  356. X    errormessage    description of the error
  357. X
  358. XAnother compiler is likely to use a different format. You should set the
  359. X'errorformat' option to a scanf-like string that describes the format. First
  360. Xyou need to know how scanf works. Look in the documentation of your C
  361. Xcompiler. Vim will understand eight conversion characters. Others are invalid.
  362. X    %f        file name (finds a string)
  363. X    %l        line number (finds a number)
  364. X    %c        column number (finds a number)
  365. X    %t        error type (finds a single character)
  366. X    %n        error number (finds a number)
  367. X    %m        error message (finds a string)
  368. X    %*<conv>    any scanf non-assignable conversion
  369. X    %%        the single <%> character
  370. X
  371. XExamples:
  372. X"%f>%l:%c:%t:%n:%m"            for the AztecC.Err file
  373. X"%f:%l:\ %t%*[^0123456789]%n:\ %m"    for Aztec C error messages
  374. X"%f\ %l\ %t%*[^0123456789]%n:\ %m"    for SAS C
  375. X"\"%f\",%*[^0123456789]%l:\ %m"        default for generic C compilers
  376. X
  377. XNote the backslash in front of a space and double quote. It is required for
  378. Xthe :set command.
  379. X
  380. XThe "%f" and "%m" conversions have to detect the end of the string. They
  381. Xshould be followed by a character that cannot be in the string. Everything
  382. Xup to that character is included in the string. Be careful: "%f%l" will
  383. Xinclude everything up to the first <%> in the file name. If the "%f" or "%m"
  384. Xis at the end, everything up to the end of the line is included.
  385. X
  386. XIf a line is detected that does not completely match the 'errorformat', the
  387. Xwhole line is put in the error message and the entry is marked "not valid"
  388. XThese lines are skipped with the ":cn" and ":cp" commands (unless there is
  389. Xno valid line at all). You can use ":cl" to display all the error messages.
  390. X
  391. XIf the error format does not contain a file name Vim cannot switch to the
  392. Xcorrect file. You will have to do this by hand.
  393. X
  394. XIf you have a compiler that produces error messages that do not fit in the
  395. Xformat string, you could write a program that translates the error messages
  396. Xinto this format. You can use this program with the ":make" command by
  397. Xchanging the 'makeprg' option. For example:
  398. X    ":set mp=make\ \\\|&\ error_filter".
  399. XThe backslashes before the pipe character are required to avoid it to be
  400. Xrecognized as a command separator. The backslash before each space is
  401. Xrequired for the set command.
  402. X
  403. XThe ":make" command executes the command given with the 'makeprg' option.
  404. XThis is done by passing the command to the shell given with the 'shell'
  405. Xoption. This works almost like typing
  406. X
  407. X    ":!{makeprg} >{errorfile} [arguments]".
  408. X
  409. X{makeprg} is the string given with the 'makeprg' option. Any command can be
  410. Xused, not just "make". Characters <%> and <#> are expanded as usual on a
  411. Xcommand line. You can use "#<" to insert the current filename without
  412. Xextension, for example ":set makeprg=make\ #<.o".
  413. X
  414. X{errorfile} is the 'errorfile' option.
  415. X
  416. X[arguments] is anything that is typed after ":make".
  417. X
  418. XThere are some restrictions to the Quickfix mode on the Amiga. The
  419. Xcompiler only writes the first 25 errors to the errorfile (Manx's
  420. Xdocumentation does not say how to get more). If you want to find the others,
  421. Xyou will have to fix a few errors and exit the editor. After recompiling,
  422. Xup to 25 remaining errors will be found.
  423. X
  424. XOn the Amiga, if Vim was started from the compiler, the :sh and :! commands
  425. Xwill not work, because Vim is then running in the same process as the
  426. Xcompiler and these two commands may guru the machine then.
  427. X
  428. XIf you insert or delete lines, mostly the correct error location is still 
  429. Xfound because hidden marks are used (Manx's Z editor does not do this). 
  430. XSometimes, when the mark has been deleted for some reason, the message "line 
  431. Xchanged" is shown to warn you that the error location may not be correct. If 
  432. Xyou edit another file the marks are lost and the error locations may not be 
  433. Xcorrect anymore.
  434. X
  435. X
  436. X5.6 Editing binary files
  437. X
  438. XAlthough Vim was made to edit text files, it is possible to edit binary
  439. Xfiles. The "-b" command line option (b for binary) sets some options for
  440. Xediting binary files ('binary' on, 'textwidth' to 0, 'textmode' and
  441. X'textauto' off, 'modelines' to 0, 'expandtab' off). Setting the 'binary'
  442. Xoption has the same effect. Don't forget to do this before reading the file.
  443. X
  444. XThere are a few things to remember when editing binary files:
  445. X- When editing executable files the number of characters must not change.
  446. X  Use only the "R" or "r" command to change text. Do not delete characters
  447. X  with "x" or by backspacing.
  448. X- Set the 'textwidth' option to 0. Otherwise lines will unexpectedly be
  449. X  split in two.
  450. X- When there are not many end-of-line characters, the lines will become very
  451. X  long. If you want to edit a line that does not fit on the screen reset the
  452. X  'wrap' option. Horizontal scrolling is used then. If a line becomes too
  453. X  long (more than about 32767 characters on the Amiga, much more on 32-bit
  454. X  systems) you cannot edit that line. It is also possible that you get an
  455. X  "out of memory" error when reading the file.
  456. X- Make sure the 'textmode' and 'textauto' options are off before loading the
  457. X  file. In 'textmode' both <CR><LF> and <LF> are considered to end a line
  458. X  and when the file is written the <LF> will be replaced by <CR><LF>. The
  459. X  'modelines' option should also be off, because there may be a string like
  460. X  ":vi:" in the file that would give unpredictable results.
  461. X- <NUL> characters are shown on the screen as ^@. You can enter them with
  462. X  "CTRL-V CTRL-@" or "CTRL-V 000" {vi cannot handle <NUL> characters in the
  463. X  file}
  464. X- To insert a <LF> character in the file split up a line. When writing the
  465. X  buffer to a file a <LF> will be written for the end of line.
  466. X- Vim normally appends an end-of-line character at the end of the file if
  467. X  there is none. Setting the 'binary' option prevents this. If you want to
  468. X  add the final end-of-line, append an empty line at the end.
  469. X
  470. X
  471. X    6. Cursor motions
  472. X
  473. XThese commands move the cursor position. If the new position is off of the
  474. Xscreen, the screen is scrolled to show the cursor (see also 'scrolljump' 
  475. Xoption).
  476. X
  477. XThe motion commands can be used after other commands, called operators, to
  478. Xhave the command operate on the text that was moved over. That is the text
  479. Xbetween the cursor position before and after the motion. If the motion
  480. Xincludes a count and the operator also had a count, the two counts are
  481. Xmultiplied. For example: "2d3w" deletes six words.
  482. X    The operator either affects whole lines, or the characters between 
  483. Xthe start and end position. Generally, motions that move between lines
  484. Xaffect lines (are linewise), and motions that move within a line affect
  485. Xcharacters. However, there are some exceptions.
  486. X    A character motion is either inclusive or exclusive. When inclusive,
  487. Xthe start and end position of the motion are included in the operation.
  488. XWhen exclusive, the last character towards the end of the buffer is not
  489. Xincluded. Linewise motions always include the start and end position.
  490. X    Which motions are linewise, inclusive or exclusive is mentioned 
  491. Xbelow. There are however, two general exceptions:
  492. X1. If the motion is exclusive and the end of the motion is in column 1, the 
  493. X   end of the motion is moved to the end of the previous line and the motion 
  494. X   becomes inclusive. Example: "}" ends at the first line after a paragraph, 
  495. X   but "V}" will not include that line.
  496. X2. If the motion is exclusive, the end of the motion is in column 1 and the 
  497. X   start of the motion was at or before the first non-blank in the line, the 
  498. X   motion becomes linewise. Example: If a paragraph begins with some blanks 
  499. X   and you do "d}" while standing on the first non-blank, all the lines of 
  500. X   the paragraph are deleted, including the blanks. If you do a put now, the 
  501. X   deleted lines will be inserted below the cursor position.
  502. X
  503. XInstead of first giving the operator and then a motion you can use Visual
  504. Xmode: mark the start of the text with <v>, move the cursor to the end of the
  505. Xtext that is to be affected and then hit the operator. The text between the
  506. Xstart and the cursor position is highlighted, so you can see what text will
  507. Xbe operated upon. This allows much more freedom, but requires more key
  508. Xstrokes and has limited redo functionality. See the chapter on Visual mode.
  509. X
  510. XIf you want to know where you are in the file use the "CTRL-G" command. If 
  511. Xyou set the 'ruler' option, the cursor position is continuously shown in the 
  512. Xstatus line (which slows down Vim a little).
  513. X
  514. XNOTE: Experienced users prefer the hjkl keys because they are always right
  515. Xunder their fingers. Beginners often prefer the arrow keys, because they
  516. Xdo not know what the hjkl keys do. The mnemonic value of hjkl is clear from
  517. Xlooking at the keyboard. Think of j as an arrow pointing downwards.
  518. X
  519. X6.1 Left-right motions
  520. X
  521. Xh        or
  522. X<C_LEFT>    or
  523. XCTRL-H        or
  524. X<BS>            [count] characters to the left (exclusive).
  525. X
  526. Xl        or
  527. X<C_RIGHT>    or
  528. X<SPACE>            [count] characters to the right (exclusive).
  529. X
  530. X0            To the first character of the line (exclusive).
  531. X
  532. X^            To the first non-blank character of the line
  533. X            (exclusive).
  534. X
  535. X$            To the end of line [count] from the cursor
  536. X            (inclusive).
  537. X
  538. X|            To column [count] (inclusive).
  539. X
  540. Xf<char>            To [count]'th occurrence of <char> to the right. The
  541. X            cursor is placed on <char> (inclusive).
  542. X
  543. XF<char>            To the [count]'th occurrence of <char> to the left.
  544. X            The cursor is placed on <char> (inclusive).
  545. X
  546. Xt<char>            Till before [count]'th occurrence of <char> to the
  547. X            right. The cursor is placed on the character left of 
  548. X            <char> (inclusive).
  549. X
  550. XT<char>            Till after [count]'th occurrence of <char> to the
  551. X            left. The cursor is placed on the character right of
  552. X            <char> (inclusive).
  553. X
  554. X;            Repeat latest f, t, F or T [count] times.
  555. X
  556. X,            Repeat latest f, t, F or T in opposite direction
  557. X            [count] times.
  558. X
  559. XThese commands move the cursor to the specified column in the current line.
  560. XThey stop at the first column and at the end of the line, except "$", which 
  561. Xmay move to one of the next lines.
  562. X
  563. X
  564. X6.2 Up-down motions
  565. X
  566. Xk        or
  567. X<C_UP>        or
  568. XCTRL-P            [count] lines upward (linewise).
  569. X
  570. Xj        or
  571. X<C_DOWN>    or
  572. XCTRL-J        or
  573. X<LF>        or
  574. XCTRL-N            [count] lines downward (linewise).
  575. X
  576. X-  <minus>        [count] lines upward, on the first non-blank
  577. X            character (linewise).
  578. X
  579. X+        or
  580. XCTRL-M        or
  581. X<CR>            [count] lines downward, on the first non-blank
  582. X            character (linewise).
  583. X
  584. X_  <underscore>        [count] - 1 lines downward, on the first non-blank
  585. X            character (linewise).
  586. X
  587. XG            Goto line [count], default last line, on the first
  588. X            non-blank character (linewise).
  589. X
  590. X:[range]        Set the cursor on the (last) specified line number
  591. X            (cannot be used with an operator).
  592. X
  593. X{count}%        Go to {count} percentage in the file, column 1 
  594. X            (linewise). To compute the new line number this 
  595. X            formula is used: {count} * number-of-lines / 100.
  596. X            {not in Vi}
  597. X
  598. XThese commands move to the specified line. They stop when reaching the first 
  599. Xor the last line. The first two commands put the cursor in the same column 
  600. X(if possible) as it was after the last command that changed the column, 
  601. Xexcept after the "$" command, then the cursor will be put on the last 
  602. Xcharacter of the line.
  603. X
  604. X
  605. X6.3 Word motions
  606. X
  607. X<SC_RIGHT>    or
  608. Xw            [count] words forward (exclusive).
  609. X
  610. XW            [count] WORDS forward (exclusive).
  611. X
  612. Xe            Forward to the end of word [count] (inclusive).
  613. X
  614. XE            Forward to the end of WORD [count] (inclusive).
  615. X
  616. X<SC_LEFT>    or
  617. Xb            [count] words backward (exclusive).
  618. X
  619. XB            [count] WORDS backward (exclusive).
  620. X
  621. XThese commands move over words or WORDS. A word consists of a sequence of 
  622. Xletters, digits and underscores, or a sequence of other non-blank 
  623. Xcharacters, separated with white space (spaces, tabs, end of line). A WORD
  624. Xconsists of a sequence of non-blank characters, separated with white space.
  625. XAn empty line is also considered to be a word and a WORD.
  626. X
  627. XSpecial case: "cw" and "cW" are treated like "ce" and "cE" if the cursor is 
  628. Xon a non-blank. This is because "cw" is interpreted as change-word, and a 
  629. Xword does not include the following white space. {Vi: "cw" when on a blank 
  630. Xfollowed by other blanks changes only the first blank; this is probably a 
  631. Xbug, because "dw" deletes all the blanks}
  632. X
  633. XAnother special case: When using the "w" motion in combination with an 
  634. Xoperator and the last word moved over is at the end of a line, the end of 
  635. Xthat word becomes the end of the operated text, not the first word in the 
  636. Xnext line.
  637. X
  638. XThe original vi implementation of "e" is buggy. For example, the "e" command 
  639. Xwill stop on the first character of a line if the previous line was empty. 
  640. XBut when you use "2e" this does not happen. In Vim "ee" and "2e" are the 
  641. Xsame, which is more logical. However, this causes a small incompatibility 
  642. Xbetween vi and Vim.
  643. X
  644. X
  645. X6.4 Text object motions
  646. X
  647. X(            [count] sentences backward (exclusive).
  648. X
  649. X)            [count] sentences forward (exclusive).
  650. X
  651. X{            [count] paragraphs backward (exclusive).
  652. X
  653. X}            [count] paragraphs forward (exclusive).
  654. X
  655. X]]            [count] sections forward or to the next <{> in the
  656. X            first column. When used after an operator, then the
  657. X            <}> in the first column. (linewise).
  658. X
  659. X][            [count] sections forward or to the next <}> in the
  660. X            first column (linewise).
  661. X
  662. X[[            [count] sections backward or to the previous <{> in
  663. X            the first column (linewise).
  664. X
  665. X[]            [count] sections backward or to the previous <}> in
  666. X            the first column (linewise).
  667. X
  668. XThese commands move over three kinds of text objects.
  669. X
  670. XA sentence is defined as ending at a <.>, <!> or <?> followed by either the 
  671. Xend of a line, or by a space. {Vi: two spaces} Any number of closing <)>, 
  672. X<]>, <"> and <'> characters my appear after the <.>, <!> or <?> before the 
  673. Xspaces or end of line. A paragraph and section boundary is also a sentence 
  674. Xboundary.
  675. X
  676. XA paragraph begins after each empty line, and also at each of a set of 
  677. Xparagraph macros, specified by the pairs of characters in the 'paragraphs' 
  678. Xoption. The default is "IPLPPPQPP LIpplpipbp", which corresponds to the 
  679. Xmacros ".IP", ".LP", etc. (these are nroff macros, the dot must be in the 
  680. Xfirst column). A section boundary is also a paragraph boundary. Note that
  681. Xthis does not include a <{> or <}> in the first column.
  682. X
  683. XA section begins after a form-feed in the first column and at each of a set
  684. Xof section macros, specified by the pairs of characters in the 'sections'
  685. Xoption. The default is "SHNHH HUnhsh".
  686. X
  687. XThe "]" and "[" commands stop at the <{> or <}" in the first column. This is
  688. Xuseful to find the start or end of a function in a C program. Note that the
  689. Xfirst character of the command determines the search direction and the
  690. Xsecond character the type of brace found.
  691. X
  692. X
  693. X6.5 Pattern searches
  694. X
  695. X/{pattern}[/]        Search forward for the [count]'th occurrence of
  696. X            {pattern} (exclusive).
  697. X
  698. X/{pattern}/{offset}    Search forward for the [count]'th occurrence of
  699. X            {pattern} and go {offset} lines up or down (see 
  700. X            below). (linewise).
  701. X
  702. X/            Search forward for the [count]'th latest used
  703. X            pattern with latest used {offset}.
  704. X
  705. X//{offset}        Search forward for the [count]'th latest used
  706. X            pattern with new {offset}. If {offset} is empty no
  707. X            offset is used.
  708. X
  709. X*            Search forward for the [count]'th occurrence of the
  710. X            ident after or under the cursor (exclusive). {not in 
  711. X            Vi}
  712. X
  713. X#            Search backward for the [count]'th occurrence of the
  714. X            ident after or under the cursor (exclusive). {not in 
  715. X            Vi}
  716. X
  717. X?{pattern}[?]        Search backward for the [count]'th previous
  718. X            occurrence of {pattern} (exclusive).
  719. X
  720. X?{pattern}?{offset}    Search backward for the [count]'th previous
  721. X            occurrence of {pattern} and go {offset} lines up or
  722. X            down (see below) (linewise).
  723. X
  724. X?            Search backward for the [count]'th latest used
  725. X            pattern with latest used {offset}.
  726. X
  727. X??{offset}        Search backward for the [count]'th latest used
  728. X            pattern with new {offset}. If {offset} is empty no
  729. X            offset is used.
  730. X
  731. Xn            Repeat the latest "/" or "?" [count] times. {Vi: no
  732. X            count}
  733. X
  734. XN            Repeat the latest "/" or "?" [count] times in
  735. X            opposite direction. {Vi: no count}
  736. X
  737. XCTRL-C            Interrupt current (search) command.
  738. X
  739. XThese commands search for the specified pattern. With "/" and "?" an 
  740. Xadditional offset may be given. There are two types of offsets: line offsets 
  741. Xand character offsets. {the character offsets are not in Vi}
  742. X
  743. XThe offset gives the cursor positition relative to the found match:
  744. X    +[num]    [num] lines downwards, in column 1
  745. X    -[num]    [num] lines upwards, in column 1
  746. X    e[+num]    [num] characters to the right of the end of the match
  747. X    e[-num]    [num] characters to the left of the end of the match
  748. X    s[+num]    [num] characters to the right of the start of the match
  749. X    s[-num]    [num] characters to the left of the start of the match
  750. X    n        not an offset: search without setting the current position
  751. X            of the cursor (used internally for the :tags command)
  752. X
  753. XIf a <-> or <+> is given but [num] is omitted, a count of one will be used.
  754. X
  755. XExamples:
  756. X
  757. Xpattern            cursor position
  758. X/test/+1        one line below "test", in column 1
  759. X/test/e            on the last t of "test"
  760. X/test/s+2        on the <s> of "test"
  761. X
  762. XIf one of these commands is used after an operator, the characters between 
  763. Xthe cursor position before and after the search is affected. However, if a 
  764. Xline offset is given, the whole lines between the two cursor positions are 
  765. Xaffected.
  766. X
  767. XThe last used <pattern> and <offset> are remembered. They can be used to
  768. Xrepeat the search, possibly in another direction or with another count. Note
  769. Xthat only one <pattern> is remembered for all searches, including :s
  770. X(substitute). Each time an empty <pattern> is given, the previously used
  771. X<pattern> is used.
  772. X
  773. XIf the 'wrapscan' option is set (which is the default), searches wrap around 
  774. Xthe end of the buffer. If 'wrapscan' is not set, the backward search stops 
  775. Xat the beginning and the forward search stops at the end of the buffer. If 
  776. Xthe pattern was not found the error message "pattern not found" is given, 
  777. Xand the cursor will not be moved.
  778. X
  779. XPatterns may contain special characters, depending on the setting of the
  780. X'magic' option. The "*" and "#" commands search for the identifier currently
  781. Xunder the cursor. If there is no indentifier under the cursor, the first one 
  782. Xto the right is used. This identifier may only contain letters, digits and 
  783. Xunderscores. Note that if you type with ten fingers, the characters are easy 
  784. Xto remember: the "#" is under your left hand middle finger (search to the
  785. Xleft and up) and the "*" is under your right hand middle finger (search to
  786. Xthe right and down).
  787. X
  788. XThe definition of a pattern:
  789. X
  790. X1.  A pattern is one or more branches, separated by '\|'. It matches anything
  791. X    that matches one of the branches. Example: "foo\|bar" matches "foo" and
  792. X    "bar.
  793. X
  794. X2.  A branch is one or more pieces, concatenated. It matches a match for the
  795. X    first, followed by a match for the second, etc. Example: "foo[0-9]bar",
  796. X    first match "foo", then a digit and then "bar".
  797. X
  798. X3.  A piece is an atom, possibly followed by:
  799. X      'magic'    'nomagic'
  800. X      option    option
  801. X    *      \*        matches 0 or more of the preceding atom
  802. X    \+      \+        matches 1 or more of the preceding atom {not
  803. X                in Vi}
  804. X    \?      \?        matches 0 or 1 of the preceding atom {not in
  805. X                Vi}
  806. X    Examples:
  807. X       .*      .\*        match anything, also empty string
  808. X       .\+      .\+        match any non-empty string
  809. X       foo\?      foo\?        match "fo" and "foo"
  810. X
  811. X
  812. X4.  An atom can be:
  813. X    - One of these five:
  814. X      magic    nomagic
  815. X    .      \.        matches any single character
  816. X    \<      \<        matches the beginning of a word
  817. X    \>      \>        matches the end of a word
  818. X    ^      ^        at beginning of pattern, matches start of
  819. X                line
  820. X    $      $        at end of pattern, matches end of line
  821. X    - A pattern enclosed by escaped parentheses (e.g. "\(^a\)").
  822. X    - A single character, with no special meaning, matches itself
  823. X    - A backslash followed by a single character, with no special meaning,
  824. X      matches the single character.
  825. X    - A range. This is a sequence of characters enclosed in '[]' with the 
  826. X      'magic' option, or enclosed in '\[]' with the 'nomagic' option. It 
  827. X      normally matches any single character from the sequence. If the 
  828. X      sequence begins with <^>, it matches any single character NOT in the 
  829. X      sequence. If two characters in the sequence are separated by <->, this 
  830. X      is shorthand for the full list of ASCII characters between them (e.g. 
  831. X      '[0-9]' matches any decimal digit). To include a literal <]> in the 
  832. X      sequence, make it the first character (following a possible <^>). To 
  833. X      include a literal '\-', make it the first or last character.
  834. X
  835. XIf the 'ignorecase' option is set, the case of letters is ignored.
  836. X
  837. XIt is impossible to have a pattern that contains a line break.
  838. X
  839. XExamples:
  840. X^beep(            Probably the start of the C function "beep".
  841. X
  842. X[a-zA-Z]$        Any alphabetic character at the end of a line.
  843. X
  844. X\(^\|[^a-zA-Z0-9_]\)[a-zA-Z_]\+[a-zA-Z0-9_]*
  845. X            A C identifier (will stop in front of it).
  846. X
  847. X[.!?][])"']*\($\|[ ]\)    A search pattern that finds the end of a sentence,
  848. X            with almost the same definition as the <)> command.
  849. X
  850. XTechnical detail:
  851. X<NUL> characters in the file are stored as <LF> in memory. In the display
  852. Xthey are shown as "^@". The translation is done when reading and writing
  853. Xfiles. To match a <NUL> with a search pattern you can just enter CTRL-@ or
  854. X"CTRL-V 000". This is probably just what you expect. Internally the
  855. Xcharacter is replaced by a <LF> in the search pattern. What is unusual is
  856. Xthat typing CTRL_V CTRL_J also inserts a <LF>, thus also searches for a
  857. X<NUL> in the file. {vi cannot handle <NUL> characters in the file at all}
  858. X
  859. X
  860. X6.6 Various motions
  861. X
  862. Xm<a-zA-Z>        Set mark <a-zA-Z> at cursor position (does not move 
  863. X            the cursor, this is not a motion command).
  864. X
  865. X:[range]mar[k] <a-zA-Z>    Set mark <a-zA-Z> at last line number in [range], 
  866. X            column 0. Default is cursor line.
  867. X
  868. X:[range]k<a-zA-Z>    Same as :mark, but the space before the mark name can
  869. X            be omitted.
  870. X
  871. X'<a-z>            To the first non-blank character on the line with
  872. X            mark <a-z> (linewise).
  873. X
  874. X'<A-Z>            To the first non-blank character on the line with
  875. X            mark <A-Z> in the correct file (linewise when in 
  876. X            same file, not a motion command when in other file). 
  877. X            {not in Vi}
  878. X
  879. X`<a-z>            To the mark <a-z> (exclusive).
  880. X
  881. X`<A-Z>            To the mark <A-Z> in the correct file (exclusive 
  882. X            when in same file, not a motion command when in 
  883. X            other file). {not in Vi}
  884. X
  885. X:marks            List the current marks (not a motion command). {not 
  886. X            in Vi}
  887. X
  888. XA mark is not visible in any way. It is just a position in the file that is
  889. Xremembered. Do not confuse marks with named registers, they are totally 
  890. Xunrelated.
  891. X
  892. XLowercase marks are only remembered as long as you stay in the current
  893. Xfile. If you start editing another file, change a character in a line or 
  894. Xdelete a line that contains a mark, that mark is erased. Lowercase marks can 
  895. Xbe used in combination with operators. For example: "d't" deletes the lines 
  896. Xfrom the cursor position to mark <t>. Hint: Use mark <t> for Top, <b> for 
  897. XBottom, etc..
  898. X
  899. XUppercase marks include the file name. {Vi: no uppercase marks} You can use 
  900. Xthem to jump from file to file. You can only use an uppercase mark with 
  901. Xan operator if the mark is in the current file. As long as you stay in the 
  902. Xcurrent file the line number of the mark remains correct, even if you 
  903. Xinsert/delete lines. After changing files the line number may be wrong 
  904. X(keeping them correct would take too much time). To avoid this use a 
  905. X":marks" command before abandoning a file, this will update the line numbers 
  906. Xin the current file.
  907. X
  908. X
  909. X'[            To the first non-blank character on the first line 
  910. X            of the previously operated text or start of the last 
  911. X            putted text. {not in Vi}
  912. X
  913. X`[            To the first character of the previously operated 
  914. X            text or start of the last putted text. {not in Vi}
  915. X
  916. X']            To the first non-blank character on the last line of 
  917. X            the previously operated text or end of the last 
  918. X            putted text. {not in Vi}
  919. X
  920. X`]            To the last character of the previously operated 
  921. X            text or end of the last putted text. {not in Vi}
  922. X
  923. XAfter executing an operator the Cursor is put at the beginning of the text 
  924. Xthat was operated upon. After a put command ("p" or "P") the cursor is 
  925. Xsometimes placed at the first inserted line and somtimes on the last 
  926. Xinserted character. The four commands above put the cursor at either
  927. Xend. Example: After yanking 10 lines you want to go to the last one of them: 
  928. X"10Y']". After inserting several lines with the "p" command you want to jump 
  929. Xto the lowest inserted line: "p']".
  930. X
  931. XNote: After deleting text, the start and end positions are the same, except 
  932. Xwhen using blockwise Visual mode. These commands do not work when no
  933. Xoperator or put command has been used yet in the current file. The position
  934. Xmay be incorrect after inserting text and ".p.
  935. X
  936. X
  937. X''            To the first non-blank character of the line where
  938. X            the cursor was before the latest jump (linewise).
  939. X
  940. X``            To the position before latest jump (exclusive).
  941. X
  942. XA "jump" is one of the following commands: "'", "`", "G", "/", "?", "n", 
  943. X"N", "%", "(", ")", "[[", "]]", "{", "}", ":s", ":tag", "L", "M", "H" and
  944. Xthe commands that start editing a new file. If you make the cursor "jump"
  945. Xwith one of these commands, the position of the cursor before the jump is
  946. Xremembered. You can return to that position with the "''" and "``" command,
  947. Xunless the line containing that position was changed or deleted.
  948. X
  949. XCTRL-O            Go to [count] Older cursor position in jump list
  950. X            (not a motion command). {not in Vi}
  951. X
  952. XCTRL-I            Go to [count] newer cursor position in jump list
  953. X            (not a motion command). {not in Vi}
  954. X
  955. X:jumps            Print the jump list (not a motion command). {not in 
  956. X            Vi} 
  957. X
  958. XJumps are remembered in a jump list. With the CTRL-O and CTRL-I command you 
  959. Xcan go to cursor positions before older jumps, and back again. Thus you can 
  960. Xmove up and down the list.
  961. X
  962. XFor example, after three jump commands you have this jump list:
  963. X
  964. X jump line  file
  965. X   1     1  -current-
  966. X   2    70  -current-
  967. X   3  1154  -current-
  968. X>
  969. X
  970. XYou are currently in line 1167. If you then use the CTRL-O command, the 
  971. Xcursor is put in line 1154. This results in:
  972. X
  973. X jump line  file
  974. X   1     1  -current-
  975. X   2    70  -current-
  976. X>  3  1154  -current-
  977. X   4  1167  -current-
  978. X
  979. XThe pointer will be set at the last used jump position. The next CTRL-O 
  980. Xcommand will use the entry above it, the next CTRL-I command will use the 
  981. Xentry below it. If the pointer is below the last entry, this indicates that 
  982. Xyou did not use a CTRL-I or CTRL-O before. In this case the CTRL-O command 
  983. Xwill cause the cursor position to be added to the jump list, so you can get 
  984. Xback to the postition before the CTRL-O. In this case this is line 1167.
  985. X
  986. XWith more CTRL-O commands you will go to lines 70 and 1. If you use CTRL-I 
  987. Xyou can go back to 1154 and 1167 again.
  988. X
  989. XIf you use a jump command, the current line number is inserted at the end of 
  990. Xthe jump list. If you used CTRL-O or CTRL-I just before that, the same line 
  991. Xmay be in the list twice. This may be a bit strange. Just try it and look at 
  992. Xthe jump list with the :jumps command. Note that this behaviour is different 
  993. Xfrom the tag stack.
  994. X
  995. XAfter the CTRL-O command that got you into line 1154 you could give another 
  996. Xjump command (e.g. "G"). The jump list would then become:
  997. X
  998. X jump line  file
  999. X   1     1  -current-
  1000. X   2    70  -current-
  1001. X   3  1154  -current-
  1002. X   4  1167  -current-
  1003. X   5  1154  -current-
  1004. X>
  1005. X
  1006. XAs long as you stay in the same file, the line numbers will be adjusted for 
  1007. Xdeleted and inserted lines. If you go to another file the line numbers may 
  1008. Xbe wrong (keeping them correct would take too much time). If you want to 
  1009. Xavoid this use a :jumps command before changing files. This will update the 
  1010. Xline numbers in the current file.
  1011. X
  1012. X%            Find the next parenthesis or (curly/square) bracket
  1013. X            on this line and go to its match (inclusive). Parens
  1014. X            and braces preceded with a backslash are ignored.
  1015. X            Parens and braces inside quotes are ignored, unless
  1016. X            the number of parens/braces in a line is uneven and
  1017. X            this line and the previous one does not end in a
  1018. X            backslash. No count is allowed ({count}% jumps to a
  1019. X            line {count} percentage down the file).
  1020. X
  1021. XH            To line [count] from top (Home) of screen (default:
  1022. X            first line on the screen) on the first non-blank 
  1023. X            character (linewise).
  1024. X
  1025. XM            To Middle line of screen, on the first non-blank
  1026. X            character (linewise).
  1027. X
  1028. XL            To line [count] from bottom of screen (default: Last
  1029. X            line on the screen) on the first non-blank character 
  1030. X            (linewise).
  1031. X
  1032. X
  1033. X    7. Scrolling
  1034. X
  1035. XMove edit window downwards (this means that more lines downwards in the text
  1036. Xbuffer are seen):
  1037. X
  1038. XCTRL-E            Window [count] lines downwards in the buffer
  1039. X
  1040. XCTRL-D            Window Downwards in the buffer. The number of lines
  1041. X            comes from the 'scroll' option (default: half a
  1042. X            screen). If [count] given, first set 'scroll' option
  1043. X            to [count].
  1044. X
  1045. X<SC_DOWN>    or
  1046. XCTRL-F            Window [count] pages Forwards (downwards) in the
  1047. X            buffer.
  1048. X
  1049. XMove edit window upwards (this means that more lines upwards in the text
  1050. Xbuffer are seen): 
  1051. X
  1052. XCTRL-Y            Window [count] lines upwards in the buffer.
  1053. X
  1054. XCTRL-U            Window Upwards in the buffer. The number of lines
  1055. X            comes from the 'scroll' option (default: half a
  1056. X            screen). If [count] given, first set 'scroll' option
  1057. X            to [count].
  1058. X
  1059. X<SC_UP>        or
  1060. XCTRL-B            Window [count] pages Backwards (upwards) in the
  1061. X            buffer.
  1062. X
  1063. XWindow repositioning:
  1064. X
  1065. Xz<CR>            Redraw, line [count] at top of window (default
  1066. X            cursor line).
  1067. X
  1068. Xz{height}<CR>        Redraw, make window {height} lines tall. This is
  1069. X            useful to make the number of lines small when screen
  1070. X            updating is very slow. Cannot make the height more
  1071. X            than the physical screen height.
  1072. X
  1073. Xz.            Redraw, line [count] at center of window (default 
  1074. X            cursor line).
  1075. X
  1076. Xz-            Redraw, line [count] at bottom of window (default 
  1077. X            cursor line).
  1078. X
  1079. XThese commands move the contents of the window. If the cursor position is 
  1080. Xmoved off of the window, the cursor is moved onto the window. A page is the 
  1081. Xnumber of lines in the window minus two. The mnemonics for these commands 
  1082. Xmay be a bit confusing. Remember that the commands refer to moving the 
  1083. Xwindow upwards or downwards in the buffer. But when the window moves upwards 
  1084. Xin the buffer, the text in the window moves downwards on your screen.
  1085. X
  1086. X
  1087. X    8. Tags
  1088. X
  1089. X:ta[g][!] {ident}    Jump to the definition of {ident}, using the
  1090. X            information in the tags file. Put {ident} in the tag
  1091. X            stack. See below for [!].
  1092. X
  1093. XCTRL-]            ":ta" to the identifier under or after cursor. Put 
  1094. X            the identifier in the tag stack. {Vi: identifier 
  1095. X            after the cursor}
  1096. X
  1097. XCTRL-T            Jump to [count] older entry in the tag stack
  1098. X            (default 1). {not in Vi}
  1099. X
  1100. X:[count]po[p][!]    Jump to [count] older entry in tag stack (default 1).
  1101. X            See below for [!]. {not in Vi}
  1102. X
  1103. X:[count]ta[g][!]    Jump to [count] newer entry in tag stack (default 1).
  1104. X            See below for [!]. {not in Vi}
  1105. X
  1106. X:tags            Show the contents of the tag stack. The active
  1107. X            entry is marked with a <>>. {not in Vi}
  1108. X
  1109. XA tag is an identifier that appears in the "tags" file. It is a sort of label
  1110. Xthat can be jumped to. For example: In C programs each function name can be 
  1111. Xused as a tag.
  1112. X
  1113. XWith the ":tag" command the cursor will be positioned on the tag. With the
  1114. XCTRL-] command, the identifier on which the cursor is standing is used as the
  1115. Xtag. If the cursor is not on an identifier, the first identifier rightwards 
  1116. Xof the cursor is used.
  1117. X
  1118. XIf the tag is in the current file this will always work. Otherwise the
  1119. Xperformed actions depend on whether the current file was changed, whether a !
  1120. Xis added to the command and on the 'autowrite' option:
  1121. X
  1122. X  tag in       file        autowrite
  1123. Xcurrent file  changed   !   option      action
  1124. X-----------------------------------------------------------------------------
  1125. X    yes         x    x     x      goto tag
  1126. X    no         no    x     x      read other file, goto tag
  1127. X    no        yes    yes    x   abondon current file, read other file, goto
  1128. X                      tag
  1129. X    no        yes    no    on  write current file, read other file, goto
  1130. X                      tag
  1131. X    no        yes    no   off  fail
  1132. X-----------------------------------------------------------------------------
  1133. END_OF_FILE
  1134. if test 45369 -ne `wc -c <'vim/doc/reference.do2'`; then
  1135.     echo shar: \"'vim/doc/reference.do2'\" unpacked with wrong size!
  1136. fi
  1137. chmod +x 'vim/doc/reference.do2'
  1138. # end of 'vim/doc/reference.do2'
  1139. fi
  1140. echo shar: End of archive 22 \(of 25\).
  1141. cp /dev/null ark22isdone
  1142. MISSING=""
  1143. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 ; do
  1144.     if test ! -f ark${I}isdone ; then
  1145.     MISSING="${MISSING} ${I}"
  1146.     fi
  1147. done
  1148. if test "${MISSING}" = "" ; then
  1149.     echo You have unpacked all 25 archives.
  1150.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1151. else
  1152.     echo You still need to unpack the following archives:
  1153.     echo "        " ${MISSING}
  1154. fi
  1155. ##  End of shell archive.
  1156. exit 0
  1157.  
  1158. ===============================================================================
  1159. Bram Moolenaar                             | DISCLAIMER:  This  note  does  not
  1160. Oce Nederland B.V., Research & Development | necessarily represent the position
  1161. p.o. box 101, 5900 MA  Venlo               | of  Oce-Nederland  B.V.  Therefore
  1162. The Netherlands        phone +31 77 594077 | no liability or responsibility for
  1163. UUCP: mool@oce.nl        fax +31 77 595473 | whatever will be accepted.
  1164.  
  1165. exit 0 # Just in case...
  1166.