usr_01.txt 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. *usr_01.txt* For Vim version 9.0. Last change: 2019 Nov 21
  2. VIM USER MANUAL - by Bram Moolenaar
  3. About the manuals
  4. This chapter introduces the manuals available with Vim. Read this to know the
  5. conditions under which the commands are explained.
  6. |01.1| Two manuals
  7. |01.2| Vim installed
  8. |01.3| Using the Vim tutor
  9. |01.4| Copyright
  10. Next chapter: |usr_02.txt| The first steps in Vim
  11. Table of contents: |usr_toc.txt|
  12. ==============================================================================
  13. *01.1* Two manuals
  14. The Vim documentation consists of two parts:
  15. 1. The User manual
  16. Task oriented explanations, from simple to complex. Reads from start to
  17. end like a book.
  18. 2. The Reference manual
  19. Precise description of how everything in Vim works.
  20. The notation used in these manuals is explained here: |notation|
  21. JUMPING AROUND
  22. The text contains hyperlinks between the two parts, allowing you to quickly
  23. jump between the description of an editing task and a precise explanation of
  24. the commands and options used for it. Use these two commands:
  25. Press CTRL-] to jump to a subject under the cursor.
  26. Press CTRL-O to jump back (repeat to go further back).
  27. Many links are in vertical bars, like this: |bars|. The bars themselves may
  28. be hidden or invisible; see below. An option name, like 'number', a command
  29. in double quotes like ":write" and any other word can also be used as a link.
  30. Try it out: Move the cursor to CTRL-] and press CTRL-] on it.
  31. Other subjects can be found with the ":help" command; see |help.txt|.
  32. The bars and stars are usually hidden with the |conceal| feature. They also
  33. use |hl-Ignore|, using the same color for the text as the background. You can
  34. make them visible with: >
  35. :set conceallevel=0
  36. :hi link HelpBar Normal
  37. :hi link HelpStar Normal
  38. ==============================================================================
  39. *01.2* Vim installed
  40. Most of the manuals assume that Vim has been properly installed. If you
  41. didn't do that yet, or if Vim doesn't run properly (e.g., files can't be found
  42. or in the GUI the menus do not show up) first read the chapter on
  43. installation: |usr_90.txt|.
  44. *not-compatible*
  45. The manuals often assume you are using Vim with Vi-compatibility switched
  46. off. For most commands this doesn't matter, but sometimes it is important,
  47. e.g., for multi-level undo. An easy way to make sure you are using a nice
  48. setup is to copy the example vimrc file. By doing this inside Vim you don't
  49. have to check out where it is located. How to do this depends on the system
  50. you are using:
  51. Unix: >
  52. :!cp -i $VIMRUNTIME/vimrc_example.vim ~/.vimrc
  53. MS-Windows: >
  54. :!copy $VIMRUNTIME/vimrc_example.vim $VIM/_vimrc
  55. Amiga: >
  56. :!copy $VIMRUNTIME/vimrc_example.vim $VIM/.vimrc
  57. If the file already exists you probably want to keep it.
  58. If you start Vim now, the 'compatible' option should be off. You can check it
  59. with this command: >
  60. :set compatible?
  61. If it responds with "nocompatible" you are doing well. If the response is
  62. "compatible" you are in trouble. You will have to find out why the option is
  63. still set. Perhaps the file you wrote above is not found. Use this command
  64. to find out: >
  65. :scriptnames
  66. If your file is not in the list, check its location and name. If it is in the
  67. list, there must be some other place where the 'compatible' option is switched
  68. back on.
  69. For more info see |vimrc| and |compatible-default|.
  70. Note:
  71. This manual is about using Vim in the normal way. There is an
  72. alternative called "evim" (easy Vim). This is still Vim, but used in
  73. a way that resembles a click-and-type editor like Notepad. It always
  74. stays in Insert mode, thus it feels very different. It is not
  75. explained in the user manual, since it should be mostly
  76. self-explanatory. See |evim-keys| for details.
  77. ==============================================================================
  78. *01.3* Using the Vim tutor *tutor* *vimtutor*
  79. Instead of reading the text (boring!) you can use the vimtutor to learn your
  80. first Vim commands. This is a 30-minute tutorial that teaches the most basic
  81. Vim functionality hands-on.
  82. On Unix, if Vim has been properly installed, you can start it from the shell:
  83. >
  84. vimtutor
  85. On MS-Windows you can find it in the Program/Vim menu. Or execute
  86. vimtutor.bat in the $VIMRUNTIME directory.
  87. This will make a copy of the tutor file, so that you can edit it without
  88. the risk of damaging the original.
  89. There are a few translated versions of the tutor. To find out if yours is
  90. available, use the two-letter language code. For French: >
  91. vimtutor fr
  92. On Unix, if you prefer using the GUI version of Vim, use "gvimtutor" or
  93. "vimtutor -g" instead of "vimtutor".
  94. For OpenVMS, if Vim has been properly installed, you can start vimtutor from a
  95. VMS prompt with: >
  96. @VIM:vimtutor
  97. Optionally add the two-letter language code as above.
  98. On other systems, you have to do a little work:
  99. 1. Copy the tutor file. You can do this with Vim (it knows where to find it):
  100. >
  101. vim --clean -c 'e $VIMRUNTIME/tutor/tutor' -c 'w! TUTORCOPY' -c 'q'
  102. <
  103. This will write the file "TUTORCOPY" in the current directory. To use a
  104. translated version of the tutor, append the two-letter language code to the
  105. filename. For French:
  106. >
  107. vim --clean -c 'e $VIMRUNTIME/tutor/tutor.fr' -c 'w! TUTORCOPY' -c 'q'
  108. <
  109. 2. Edit the copied file with Vim:
  110. >
  111. vim --clean TUTORCOPY
  112. <
  113. The --clean argument makes sure Vim is started with nice defaults.
  114. 3. Delete the copied file when you are finished with it:
  115. >
  116. del TUTORCOPY
  117. <
  118. ==============================================================================
  119. *01.4* Copyright *manual-copyright*
  120. The Vim user manual and reference manual are Copyright (c) 1988-2003 by Bram
  121. Moolenaar. This material may be distributed only subject to the terms and
  122. conditions set forth in the Open Publication License, v1.0 or later. The
  123. latest version is presently available at:
  124. http://www.opencontent.org/openpub/
  125. People who contribute to the manuals must agree with the above copyright
  126. notice.
  127. *frombook*
  128. Parts of the user manual come from the book "Vi IMproved - Vim" by Steve
  129. Oualline (published by New Riders Publishing, ISBN: 0735710015). The Open
  130. Publication License applies to this book. Only selected parts are included
  131. and these have been modified (e.g., by removing the pictures, updating the
  132. text for Vim 6.0 and later, fixing mistakes). The omission of the |frombook|
  133. tag does not mean that the text does not come from the book.
  134. Many thanks to Steve Oualline and New Riders for creating this book and
  135. publishing it under the OPL! It has been a great help while writing the user
  136. manual. Not only by providing literal text, but also by setting the tone and
  137. style.
  138. If you make money through selling the manuals, you are strongly encouraged to
  139. donate part of the profit to help AIDS victims in Uganda. See |iccf|.
  140. ==============================================================================
  141. Next chapter: |usr_02.txt| The first steps in Vim
  142. Copyright: see |manual-copyright| vim:tw=78:ts=8:noet:ft=help:norl: