home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / mac / vim55rt.sit / runtime / doc / vim.1 < prev    next >
Encoding:
Text File  |  1999-09-25  |  10.9 KB  |  416 lines  |  [TEXT/ALFA]

  1. .TH VIM 1 "1998 December 28"
  2. .SH NAME
  3. vim \- Vi IMproved, a programmers text editor
  4. .SH SYNOPSIS
  5. .br
  6. .B vim
  7. [options] [file ..]
  8. .br
  9. .B vim
  10. [options] -
  11. .br
  12. .B vim
  13. [options] \-t tag
  14. .br
  15. .B vim
  16. [options] \-q [errorfile]
  17. .PP
  18. .br
  19. .B ex
  20. .br
  21. .B view
  22. .br
  23. .B gvim
  24. .B gview
  25. .br
  26. .B rvim
  27. .B rview
  28. .B rgvim
  29. .B rgview
  30. .SH DESCRIPTION
  31. .B Vim
  32. is a text editor that is upwards compatible to Vi.
  33. It can be used to edit any ASCII text.
  34. It is especially useful for editing
  35. programs.
  36. .PP
  37. There are a lot of enhancements above Vi: multi level undo,
  38. multi windows and buffers, syntax highlighting, command line
  39. editing, filename completion, on-line help, visual selection, etc..
  40. See ":help vi_diff.txt" for a summary of the differences between
  41. .B Vim
  42. and Vi.
  43. .PP
  44. While running
  45. .B Vim
  46. a lot of help can be obtained from the on-line help system, with the ":help"
  47. command.
  48. See the ON-LINE HELP section below.
  49. .PP
  50. Most often
  51. .B Vim
  52. is started to edit a single file with the command
  53. .PP
  54.     vim file
  55. .PP
  56. More generally
  57. .B Vim
  58. is started with:
  59. .PP
  60.     vim [options] [filelist]
  61. .PP
  62. If the filelist is missing, the editor will start with an empty buffer.
  63. Otherwise exactly one out of the following four may be used to choose one or
  64. more files to be edited.
  65. .TP 12
  66. file ..
  67. A list of filenames.
  68. The first one will be the current file and read into the buffer.
  69. The cursor will be positioned on the first line of the buffer.
  70. You can get to the other files with the ":next" command.
  71. To edit a file that starts with a dash, precede the filelist with "--".
  72. .TP
  73. -
  74. The file to edit is read from stdin.  Commands are read from stderr, which
  75. should be a tty.
  76. .TP
  77. -t {tag}
  78. The file to edit and the initial cursor position depends on a "tag", a sort
  79. of goto label.
  80. {tag} is looked up in the tags file, the associated file becomes the current
  81. file and the associated command is executed.
  82. Mostly this is used for C programs, in which case {tag} could be a function
  83. name.
  84. The effect is that the file containing that function becomes the current file
  85. and the cursor is positioned on the start of the function.
  86. See ":help tag-commands".
  87. .TP
  88. -q [errorfile]
  89. Start in quickFix mode.
  90. The file [errorfile] is read and the first error is displayed.
  91. If [errorfile] is omitted, the filename is obtained from the 'errorfile'
  92. option (defaults to "AztecC.Err" for the Amiga, "errors.vim" on other
  93. systems).
  94. Further errors can be jumped to with the ":cn" command.
  95. See ":help quickfix".
  96. .PP
  97. .B Vim
  98. behaves differently, depending on the name of the command (the executable may
  99. still be the same file).
  100. .TP 10
  101. vim
  102. The "normal" way, everything is default.
  103. .TP
  104. ex
  105. Start in Ex mode.
  106. Go to Normal mode with the ":vi" command.
  107. Can also be done with the "-e" argument.
  108. .TP
  109. view
  110. Start in read-only mode.  You will be protected from writing the files.  Can
  111. also be done with the "-R" argument.
  112. .TP
  113. gvim gview
  114. The GUI version.
  115. Starts a new window.
  116. Can also be done with the "-g" argument.
  117. .TP
  118. rvim rview rgvim rgview
  119. Like the above, but with restrictions.  It will not be possible to start shell
  120. commands, or suspend
  121. .B Vim.
  122. Can also be done with the "-Z" argument.
  123. .SH OPTIONS
  124. The options may be given in any order, before or after filenames.
  125. Options without an argument can be combined after a single dash.
  126. .TP 12
  127. +[num]
  128. For the first file the cursor will be positioned on line "num".
  129. If "num" is missing, the cursor will be positioned on the last line.
  130. .TP
  131. +/{pat}
  132. For the first file the cursor will be positioned on the
  133. first occurrence of {pat}.
  134. See ":help search-pattern" for the available search patterns.
  135. .TP
  136. +{command}
  137. .TP
  138. -c {command}
  139. {command} will be executed after the
  140. first file has been read.
  141. {command} is interpreted as an Ex command.
  142. If the {command} contains spaces it must be enclosed in double quotes (this
  143. depends on the shell that is used).
  144. Example: Vim "+set si" main.c
  145. .br
  146. Note: You can use up to 10 "+" or "-c" commands.
  147. .TP
  148. -b
  149. Binary mode.
  150. A few options will be set that makes it possible to edit a binary or
  151. executable file.
  152. .TP
  153. -C
  154. Compatible.  Set the 'compatible' option.
  155. This will make
  156. .B Vim
  157. behave mostly like Vi, even though a .vimrc file exists.
  158. .TP
  159. -d {device}
  160. Open {device} for use as a terminal.
  161. Only on the Amiga.
  162. Example:
  163. "\-d con:20/30/600/150".
  164. .TP
  165. -e
  166. Start
  167. .B Vim
  168. in Ex mode, just like the executable was called "ex".
  169. .TP
  170. -f
  171. Foreground.  For the GUI version,
  172. .B Vim
  173. will not fork and detach from the shell it was started in.
  174. On the Amiga,
  175. .B Vim
  176. is not restarted to open a new window.
  177. This option should be used when
  178. .B Vim
  179. is executed by a program that will wait for the edit
  180. session to finish (e.g. mail).
  181. On the Amiga the ":sh" and ":!" commands will not work.
  182. .TP
  183. -F
  184. If
  185. .B Vim
  186. has been compiled with FKMAP support for editing right-to-left
  187. oriented files and Farsi keyboard mapping, this option starts
  188. .B Vim
  189. in Farsi mode, i.e. 'fkmap' and 'rightleft' are set.
  190. Otherwise an error message is given and
  191. .B Vim
  192. aborts.
  193. .TP
  194. -g
  195. If
  196. .B Vim
  197. has been compiled with GUI support, this option enables the GUI.
  198. If no GUI support was compiled in, an error message is given and
  199. .B Vim
  200. aborts.
  201. .TP
  202. -h
  203. Give a bit of help about the command line arguments and options.
  204. After this
  205. .B Vim
  206. exits.
  207. .TP
  208. -H
  209. If
  210. .B Vim
  211. has been compiled with RIGHTLEFT support for editing right-to-left
  212. oriented files and Hebrew keyboard mapping, this option starts
  213. .B Vim
  214. in Hebrew mode, i.e. 'hkmap' and 'rightleft' are set.
  215. Otherwise an error message is given and
  216. .B Vim
  217. aborts.
  218. .TP
  219. -i {viminfo}
  220. When using the viminfo file is enabled, this option sets the filename to use,
  221. instead of the default "~/.viminfo".
  222. This can also be used to skip the use of the .viminfo file, by giving the name
  223. "NONE".
  224. .TP
  225. -L
  226. Same as -r.
  227. .TP
  228. -l
  229. Lisp mode.
  230. Sets the 'lisp' and 'showmatch' options on.
  231. .TP
  232. -m
  233. Modifying files is disabled.
  234. Resets the 'write' option, so that writing files is not possible.
  235. .TP
  236. -N
  237. No-compatible mode.  Reset the 'compatible' option.
  238. This will make
  239. .B Vim
  240. behave a bit better, but less Vi compatible, even though a .vimrc file does
  241. not exist.
  242. .TP
  243. -n
  244. No swap file will be used.
  245. Recovery after a crash will be impossible.
  246. Handy if you want to edit a file on a very slow medium (e.g. floppy).
  247. Can also be done with ":set uc=0".
  248. Can be undone with ":set uc=200".
  249. .TP
  250. -o[N]
  251. Open N windows.
  252. When N is omitted, open one window for each file.
  253. .TP
  254. -R
  255. Read-only mode.
  256. The 'readonly' option will be set.
  257. You can still edit the buffer, but will be prevented from accidently
  258. overwriting a file.
  259. If you do want to overwrite a file, add an exclamation mark to the Ex command,
  260. as in ":w!".
  261. The -R option also implies the -n option (see below).
  262. The 'readonly' option can be reset with ":set noro".
  263. See ":help 'readonly'".
  264. .TP
  265. -r
  266. List swap files, with information about using them for recovery.
  267. .TP
  268. -r {file}
  269. Recovery mode.
  270. The swap file is used to recover a crashed editing session.
  271. The swap file is a file with the same filename as the text file with ".swp"
  272. appended.
  273. See ":help recovery".
  274. .TP
  275. -s
  276. Silent mode.  Only when started as "Ex" or when the "-e" option was given
  277. before the "-s" option.
  278. .TP
  279. -s {scriptin}
  280. The script file {scriptin} is read.
  281. The characters in the file are interpreted as if you had typed them.
  282. The same can be done with the command ":source! {scriptin}".
  283. If the end of the file is reached before the editor exits, further characters
  284. are read from the keyboard.
  285. .TP
  286. -T {terminal}
  287. Tells
  288. .B Vim
  289. the name of the terminal you are using.
  290. Only required when the automatic way doesn't work.
  291. Should be a terminal known
  292. to
  293. .B Vim
  294. (builtin) or defined in the termcap or terminfo file.
  295. .TP
  296. -u {vimrc}
  297. Use the commands in the file {vimrc} for initializations.
  298. All the other initializations are skipped.
  299. Use this to edit a special kind of files.
  300. It can also be used to skip all initializations by giving the name "NONE".
  301. See ":help initialization" within vim for more details.
  302. .TP
  303. -U {gvimrc}
  304. Use the commands in the file {gvimrc} for GUI initializations.
  305. All the other GUI initializations are skipped.
  306. It can also be used to skip all GUI initializations by giving the name "NONE".
  307. See ":help gui-init" within vim for more details.
  308. .TP
  309. -V
  310. Verbose.  Give messages about which files are sourced and for reading and
  311. writing a viminfo file.
  312. .TP
  313. -v
  314. Start
  315. .B Vim
  316. in Vi mode, just like the executable was called "vi".  This only has effect
  317. when the executable is called "ex".
  318. .TP
  319. -w {scriptout}
  320. All the characters that you type are recorded in the file
  321. {scriptout}, until you exit
  322. .B Vim.
  323. This is useful if you want to create a script file to be used with "vim -s" or
  324. ":source!".
  325. If the {scriptout} file exists, characters are appended.
  326. .TP
  327. -W {scriptout}
  328. Like -w, but an existing file is overwritten.
  329. .TP
  330. -x
  331. Use encryption when writing files.   Will prompt for a crypt key.
  332. .TP
  333. -Z
  334. Restricted mode.  Works like the executable starts with "r".
  335. .TP
  336. --
  337. Denotes the end of the options.
  338. Arguments after this will be handled as a file name.
  339. This can be used to edit a filename that starts with a '-'.
  340. .SH ON-LINE HELP
  341. Type ":help" in
  342. .B Vim
  343. to get started.
  344. Type ":help subject" to get help on a specific subject.
  345. For example: ":help ZZ" to get help for the "ZZ" command.
  346. Use <Tab> and CTRL-D to complete subjects (":help cmdline-completion").
  347. Tags are present to jump from one place to another (sort of hypertext links,
  348. see ":help").
  349. All documentation files can be viewed in this way, for example
  350. ":help syntax.txt".
  351. .SH FILES
  352. .TP 15
  353. /usr/local/lib/vim/doc/*.txt
  354. The
  355. .B Vim
  356. documentation files.
  357. Use ":help doc-file-list" to get the complete list.
  358. .TP
  359. /usr/local/lib/vim/doc/tags
  360. The tags file used for finding information in the documentation files.
  361. .TP
  362. /usr/local/lib/vim/syntax/syntax.vim
  363. System wide syntax initializations.
  364. .TP
  365. /usr/local/lib/vim/syntax/*.vim
  366. Syntax files for various languages.
  367. .TP
  368. /usr/local/lib/vim/vimrc
  369. System wide
  370. .B Vim
  371. initializations.
  372. .TP
  373. /usr/local/lib/vim/gvimrc
  374. System wide gvim initializations.
  375. .TP
  376. /usr/local/lib/vim/optwin.vim
  377. Script used for the ":options" command, a nice way to view and set options.
  378. .TP
  379. /usr/local/lib/vim/menu.vim
  380. System wide menu initializations for gvim.
  381. .TP
  382. /usr/local/lib/vim/bugreport.vim
  383. Script to generate a bug report.  See ":help bugs".
  384. .TP
  385. /usr/local/lib/vim/filetype.vim
  386. Script to detect the type of a file by its name.  See ":help 'filetype'".
  387. .TP
  388. /usr/local/lib/vim/scripts.vim
  389. Script to detect the type of a file by its contents.  See ":help 'filetype'".
  390. .PP
  391. For recent info read the VIM home page:
  392. .br
  393. <URL:http://www.vim.org/>
  394. .SH SEE ALSO
  395. vimtutor(1)
  396. .SH AUTHOR
  397. Most of
  398. .B Vim
  399. was made by Bram Moolenaar, with a lot of help from others.
  400. See ":help credits".
  401. .br
  402. .B Vim
  403. is based on Stevie, worked on by: Tim Thompson,
  404. Tony Andrews and G.R. (Fred) Walter.
  405. Although hardly any of the original code remains.
  406. .SH BUGS
  407. Probably.
  408. See ":help todo" for a list of known problems.
  409. .PP
  410. Note that a number of things that may be regarded as bugs by some, are in fact
  411. caused by a too-faithful reproduction of Vi's behaviour.
  412. And if you think other things are bugs "because Vi does it differently",
  413. you should take a closer look at the vi_diff.txt file (or type :help
  414. vi_diff.txt when in Vim).
  415. Also have a look at the 'compatible' and 'cpoptions' options.
  416.