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