Mercurial > vim
annotate runtime/doc/usr_90.txt @ 19592:5dc5f9bacd60
Added tag v8.2.0352 for changeset ac3f5096f438322a78091e686b1d10c6fa243b93
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 03 Mar 2020 23:15:05 +0100 |
parents | 9b7f90e56753 |
children | 83cfa1ef1bf2 |
rev | line source |
---|---|
18879 | 1 *usr_90.txt* For Vim version 8.2. Last change: 2008 Sep 10 |
7 | 2 |
3 VIM USER MANUAL - by Bram Moolenaar | |
4 | |
5 Installing Vim | |
6 | |
7 *install* | |
8 Before you can use Vim you have to install it. Depending on your system it's | |
9 simple or easy. This chapter gives a few hints and also explains how | |
10 upgrading to a new version is done. | |
11 | |
12 |90.1| Unix | |
13 |90.2| MS-Windows | |
14 |90.3| Upgrading | |
15 |90.4| Common installation issues | |
16 |90.5| Uninstalling Vim | |
17 | |
18 Previous chapter: |usr_45.txt| Select your language | |
19 Table of contents: |usr_toc.txt| | |
20 | |
21 ============================================================================== | |
22 *90.1* Unix | |
23 | |
24 First you have to decide if you are going to install Vim system-wide or for a | |
25 single user. The installation is almost the same, but the directory where Vim | |
26 is installed in differs. | |
27 For a system-wide installation the base directory "/usr/local" is often | |
28 used. But this may be different for your system. Try finding out where other | |
29 packages are installed. | |
30 When installing for a single user, you can use your home directory as the | |
31 base. The files will be placed in subdirectories like "bin" and "shared/vim". | |
32 | |
33 | |
34 FROM A PACKAGE | |
35 | |
36 You can get precompiled binaries for many different UNIX systems. There is a | |
37 long list with links on this page: | |
38 | |
39 http://www.vim.org/binaries.html ~ | |
40 | |
41 Volunteers maintain the binaries, so they are often out of date. It is a | |
42 good idea to compile your own UNIX version from the source. Also, creating | |
43 the editor from the source allows you to control which features are compiled. | |
44 This does require a compiler though. | |
45 | |
46 If you have a Linux distribution, the "vi" program is probably a minimal | |
47 version of Vim. It doesn't do syntax highlighting, for example. Try finding | |
48 another Vim package in your distribution, or search on the web site. | |
49 | |
50 | |
51 FROM SOURCES | |
52 | |
53 To compile and install Vim, you will need the following: | |
54 | |
55 - A C compiler (GCC preferred) | |
56 - The GZIP program (you can get it from www.gnu.org) | |
57 - The Vim source and runtime archives | |
58 | |
59 To get the Vim archives, look in this file for a mirror near you, this should | |
60 provide the fastest download: | |
61 | |
62 ftp://ftp.vim.org/pub/vim/MIRRORS ~ | |
63 | |
64 Or use the home site ftp.vim.org, if you think it's fast enough. Go to the | |
65 "unix" directory and you'll find a list of files there. The version number is | |
66 embedded in the file name. You will want to get the most recent version. | |
19116 | 67 You can get the files for Unix in one big archive that contains everything: |
7 | 68 |
19116 | 69 vim-8.2.tar.bz2 ~ |
7 | 70 |
19116 | 71 You need the bzip2 program to uncompress it. |
7 | 72 |
73 | |
74 COMPILING | |
75 | |
76 First create a top directory to work in, for example: > | |
77 | |
78 mkdir ~/vim | |
79 cd ~/vim | |
80 | |
19116 | 81 Then unpack the archives there. You can unpack it like this: > |
7 | 82 |
19116 | 83 tar xf path/vim-8.2.tar.bz2 |
7 | 84 |
19116 | 85 If your tar command doesn't support bz2 directly: > |
7 | 86 |
19116 | 87 bzip2 -d -c path/vim-8.2.tar.bz2 | tar xf - |
7 | 88 |
19116 | 89 Change "path" to where you have downloaded the file. |
7 | 90 If you are satisfied with getting the default features, and your environment |
91 is setup properly, you should be able to compile Vim with just this: > | |
92 | |
19116 | 93 cd vim82/src |
7 | 94 make |
95 | |
96 The make program will run configure and compile everything. Further on we | |
97 will explain how to compile with different features. | |
98 If there are errors while compiling, carefully look at the error messages. | |
99 There should be a hint about what went wrong. Hopefully you will be able to | |
100 correct it. You might have to disable some features to make Vim compile. | |
101 Look in the Makefile for specific hints for your system. | |
102 | |
103 | |
104 TESTING | |
105 | |
106 Now you can check if compiling worked OK: > | |
107 | |
108 make test | |
109 | |
110 This will run a sequence of test scripts to verify that Vim works as expected. | |
111 Vim will be started many times and all kinds of text and messages flash by. | |
112 If it is alright you will finally see: | |
113 | |
114 test results: ~ | |
115 ALL DONE ~ | |
116 | |
2033
de5a43c5eedc
Update documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
1702
diff
changeset
|
117 If you get "TEST FAILURE" some test failed. If there are one or two messages |
de5a43c5eedc
Update documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
1702
diff
changeset
|
118 about failed tests, Vim might still work, but not perfectly. If you see a lot |
de5a43c5eedc
Update documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
1702
diff
changeset
|
119 of error messages or Vim doesn't finish until the end, there must be something |
de5a43c5eedc
Update documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
1702
diff
changeset
|
120 wrong. Either try to find out yourself, or find someone who can solve it. |
de5a43c5eedc
Update documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
1702
diff
changeset
|
121 You could look in the |maillist-archive| for a solution. If everything else |
de5a43c5eedc
Update documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
1702
diff
changeset
|
122 fails, you could ask in the vim |maillist| if someone can help you. |
7 | 123 |
124 | |
125 INSTALLING | |
126 *install-home* | |
127 If you want to install in your home directory, edit the Makefile and search | |
128 for a line: | |
129 | |
130 #prefix = $(HOME) ~ | |
131 | |
132 Remove the # at the start of the line. | |
133 When installing for the whole system, Vim has most likely already selected | |
134 a good installation directory for you. You can also specify one, see below. | |
135 You need to become root for the following. | |
136 | |
137 To install Vim do: > | |
138 | |
139 make install | |
140 | |
141 That should move all the relevant files to the right place. Now you can try | |
142 running vim to verify that it works. Use two simple tests to check if Vim can | |
143 find its runtime files: > | |
144 | |
145 :help | |
146 :syntax enable | |
147 | |
148 If this doesn't work, use this command to check where Vim is looking for the | |
149 runtime files: > | |
150 | |
151 :echo $VIMRUNTIME | |
152 | |
153 You can also start Vim with the "-V" argument to see what happens during | |
154 startup: > | |
155 | |
156 vim -V | |
157 | |
158 Don't forget that the user manual assumes you Vim in a certain way. After | |
159 installing Vim, follow the instructions at |not-compatible| to make Vim work | |
160 as assumed in this manual. | |
161 | |
162 | |
163 SELECTING FEATURES | |
164 | |
165 Vim has many ways to select features. One of the simple ways is to edit the | |
166 Makefile. There are many directions and examples. Often you can enable or | |
167 disable a feature by uncommenting a line. | |
168 An alternative is to run "configure" separately. This allows you to | |
169 specify configuration options manually. The disadvantage is that you have to | |
170 figure out what exactly to type. | |
171 Some of the most interesting configure arguments follow. These can also be | |
172 enabled from the Makefile. | |
173 | |
174 --prefix={directory} Top directory where to install Vim. | |
175 | |
176 --with-features=tiny Compile with many features disabled. | |
177 --with-features=small Compile with some features disabled. | |
178 --with-features=big Compile with more features enabled. | |
179 --with-features=huge Compile with most features enabled. | |
180 See |+feature-list| for which feature | |
181 is enabled in which case. | |
182 | |
183 --enable-perlinterp Enable the Perl interface. There are | |
184 similar arguments for ruby, python and | |
185 tcl. | |
186 | |
187 --disable-gui Do not compile the GUI interface. | |
188 --without-x Do not compile X-windows features. | |
189 When both of these are used, Vim will | |
190 not connect to the X server, which | |
191 makes startup faster. | |
192 | |
193 To see the whole list use: > | |
194 | |
195 ./configure --help | |
196 | |
197 You can find a bit of explanation for each feature, and links for more | |
198 information here: |feature-list|. | |
199 For the adventurous, edit the file "feature.h". You can also change the | |
200 source code yourself! | |
201 | |
202 ============================================================================== | |
203 *90.2* MS-Windows | |
204 | |
205 There are two ways to install the Vim program for Microsoft Windows. You can | |
206 uncompress several archives, or use a self-installing big archive. Most users | |
207 with fairly recent computers will prefer the second method. For the first | |
208 one, you will need: | |
209 | |
210 - An archive with binaries for Vim. | |
211 - The Vim runtime archive. | |
212 - A program to unpack the zip files. | |
213 | |
214 To get the Vim archives, look in this file for a mirror near you, this should | |
215 provide the fastest download: | |
216 | |
217 ftp://ftp.vim.org/pub/vim/MIRRORS ~ | |
218 | |
219 Or use the home site ftp.vim.org, if you think it's fast enough. Go to the | |
220 "pc" directory and you'll find a list of files there. The version number is | |
221 embedded in the file name. You will want to get the most recent version. | |
19116 | 222 We will use "82" here, which is version 8.2. |
7 | 223 |
19116 | 224 gvim82.exe The self-installing archive. |
7 | 225 |
226 This is all you need for the second method. Just launch the executable, and | |
227 follow the prompts. | |
228 | |
229 For the first method you must chose one of the binary archives. These are | |
230 available: | |
231 | |
19116 | 232 gvim82.zip The normal MS-Windows GUI version. |
233 gvim82ole.zip The MS-Windows GUI version with OLE support. | |
7 | 234 Uses more memory, supports interfacing with |
235 other OLE applications. | |
19116 | 236 vim82w32.zip 32 bit MS-Windows console version. |
7 | 237 |
238 You only need one of them. Although you could install both a GUI and a | |
239 console version. You always need to get the archive with runtime files. | |
240 | |
19116 | 241 vim82rt.zip The runtime files. |
7 | 242 |
243 Use your un-zip program to unpack the files. For example, using the "unzip" | |
244 program: > | |
245 | |
246 cd c:\ | |
19116 | 247 unzip path\gvim82.zip |
248 unzip path\vim82rt.zip | |
7 | 249 |
19116 | 250 This will unpack the files in the directory "c:\vim\vim82". If you already |
7 | 251 have a "vim" directory somewhere, you will want to move to the directory just |
252 above it. | |
19116 | 253 Now change to the "vim\vim82" directory and run the install program: > |
7 | 254 |
255 install | |
256 | |
257 Carefully look through the messages and select the options you want to use. | |
258 If you finally select "do it" the install program will carry out the actions | |
259 you selected. | |
260 The install program doesn't move the runtime files. They remain where you | |
261 unpacked them. | |
262 | |
263 In case you are not satisfied with the features included in the supplied | |
264 binaries, you could try compiling Vim yourself. Get the source archive from | |
265 the same location as where the binaries are. You need a compiler for which a | |
19116 | 266 makefile exists. Microsoft Visual C, MinGW and Cygwin compilers can be used. |
267 Check the file src/INSTALLpc.txt for hints. | |
7 | 268 |
269 ============================================================================== | |
270 *90.3* Upgrading | |
271 | |
272 If you are running one version of Vim and want to install another, here is | |
273 what to do. | |
274 | |
275 | |
276 UNIX | |
277 | |
278 When you type "make install" the runtime files will be copied to a directory | |
279 which is specific for this version. Thus they will not overwrite a previous | |
280 version. This makes it possible to use two or more versions next to | |
281 each other. | |
282 The executable "vim" will overwrite an older version. If you don't care | |
283 about keeping the old version, running "make install" will work fine. You can | |
284 delete the old runtime files manually. Just delete the directory with the | |
285 version number in it and all files below it. Example: > | |
286 | |
19116 | 287 rm -rf /usr/local/share/vim/vim74 |
7 | 288 |
289 There are normally no changed files below this directory. If you did change | |
290 the "filetype.vim" file, for example, you better merge the changes into the | |
291 new version before deleting it. | |
292 | |
293 If you are careful and want to try out the new version for a while before | |
294 switching to it, install the new version under another name. You need to | |
295 specify a configure argument. For example: > | |
296 | |
19116 | 297 ./configure --with-vim-name=vim8 |
7 | 298 |
299 Before running "make install", you could use "make -n install" to check that | |
300 no valuable existing files are overwritten. | |
301 When you finally decide to switch to the new version, all you need to do is | |
302 to rename the binary to "vim". For example: > | |
303 | |
19116 | 304 mv /usr/local/bin/vim8 /usr/local/bin/vim |
7 | 305 |
306 | |
307 MS-WINDOWS | |
308 | |
309 Upgrading is mostly equal to installing a new version. Just unpack the files | |
310 in the same place as the previous version. A new directory will be created, | |
19116 | 311 e.g., "vim82", for the files of the new version. Your runtime files, vimrc |
7 | 312 file, viminfo, etc. will be left alone. |
313 If you want to run the new version next to the old one, you will have to do | |
314 some handwork. Don't run the install program, it will overwrite a few files | |
315 of the old version. Execute the new binaries by specifying the full path. | |
316 The program should be able to automatically find the runtime files for the | |
317 right version. However, this won't work if you set the $VIMRUNTIME variable | |
318 somewhere. | |
319 If you are satisfied with the upgrade, you can delete the files of the | |
320 previous version. See |90.5|. | |
321 | |
322 ============================================================================== | |
323 *90.4* Common installation issues | |
324 | |
325 This section describes some of the common problems that occur when installing | |
326 Vim and suggests some solutions. It also contains answers to many | |
327 installation questions. | |
328 | |
329 | |
330 Q: I Do Not Have Root Privileges. How Do I Install Vim? (Unix) | |
331 | |
332 Use the following configuration command to install Vim in a directory called | |
333 $HOME/vim: > | |
334 | |
335 ./configure --prefix=$HOME | |
336 | |
337 This gives you a personal copy of Vim. You need to put $HOME/bin in your | |
338 path to execute the editor. Also see |install-home|. | |
339 | |
340 | |
341 Q: The Colors Are Not Right on My Screen. (Unix) | |
342 | |
343 Check your terminal settings by using the following command in a shell: > | |
344 | |
345 echo $TERM | |
346 | |
347 If the terminal type listed is not correct, fix it. For more hints, see | |
348 |06.2|. Another solution is to always use the GUI version of Vim, called | |
349 gvim. This avoids the need for a correct terminal setup. | |
350 | |
351 | |
352 Q: My Backspace And Delete Keys Don't Work Right | |
353 | |
354 The definition of what key sends what code is very unclear for backspace <BS> | |
355 and Delete <Del> keys. First of all, check your $TERM setting. If there is | |
356 nothing wrong with it, try this: > | |
357 | |
358 :set t_kb=^V<BS> | |
359 :set t_kD=^V<Del> | |
360 | |
361 In the first line you need to press CTRL-V and then hit the backspace key. | |
362 In the second line you need to press CTRL-V and then hit the Delete key. | |
363 You can put these lines in your vimrc file, see |05.1|. A disadvantage is | |
364 that it won't work when you use another terminal some day. Look here for | |
365 alternate solutions: |:fixdel|. | |
366 | |
367 | |
368 Q: I Am Using RedHat Linux. Can I Use the Vim That Comes with the System? | |
369 | |
370 By default RedHat installs a minimal version of Vim. Check your RPM packages | |
371 for something named "Vim-enhanced-version.rpm" and install that. | |
372 | |
373 | |
374 Q: How Do I Turn Syntax Coloring On? How do I make plugins work? | |
375 | |
376 Use the example vimrc script. You can find an explanation on how to use it | |
377 here: |not-compatible|. | |
378 | |
379 See chapter 6 for information about syntax highlighting: |usr_06.txt|. | |
380 | |
381 | |
382 Q: What Is a Good vimrc File to Use? | |
383 | |
384 See the www.vim.org Web site for several good examples. | |
385 | |
386 | |
387 Q: Where Do I Find a Good Vim Plugin? | |
388 | |
389 See the Vim-online site: http://vim.sf.net. Many users have uploaded useful | |
390 Vim scripts and plugins there. | |
391 | |
392 | |
393 Q: Where Do I Find More Tips? | |
394 | |
395 See the Vim-online site: http://vim.sf.net. There is an archive with hints | |
396 from Vim users. You might also want to search in the |maillist-archive|. | |
397 | |
398 ============================================================================== | |
399 *90.5* Uninstalling Vim | |
400 | |
401 In the unlikely event you want to uninstall Vim completely, this is how you do | |
402 it. | |
403 | |
404 | |
405 UNIX | |
406 | |
407 When you installed Vim as a package, check your package manager to find out | |
408 how to remove the package again. | |
409 If you installed Vim from sources you can use this command: > | |
410 | |
411 make uninstall | |
412 | |
413 However, if you have deleted the original files or you used an archive that | |
414 someone supplied, you can't do this. Do delete the files manually, here is an | |
415 example for when "/usr/local" was used as the root: > | |
416 | |
19116 | 417 rm -rf /usr/local/share/vim/vim82 |
7 | 418 rm /usr/local/bin/eview |
419 rm /usr/local/bin/evim | |
420 rm /usr/local/bin/ex | |
421 rm /usr/local/bin/gview | |
422 rm /usr/local/bin/gvim | |
423 rm /usr/local/bin/gvim | |
424 rm /usr/local/bin/gvimdiff | |
425 rm /usr/local/bin/rgview | |
426 rm /usr/local/bin/rgvim | |
427 rm /usr/local/bin/rview | |
428 rm /usr/local/bin/rvim | |
429 rm /usr/local/bin/rvim | |
430 rm /usr/local/bin/view | |
431 rm /usr/local/bin/vim | |
432 rm /usr/local/bin/vimdiff | |
433 rm /usr/local/bin/vimtutor | |
434 rm /usr/local/bin/xxd | |
435 rm /usr/local/man/man1/eview.1 | |
436 rm /usr/local/man/man1/evim.1 | |
437 rm /usr/local/man/man1/ex.1 | |
438 rm /usr/local/man/man1/gview.1 | |
439 rm /usr/local/man/man1/gvim.1 | |
440 rm /usr/local/man/man1/gvimdiff.1 | |
441 rm /usr/local/man/man1/rgview.1 | |
442 rm /usr/local/man/man1/rgvim.1 | |
443 rm /usr/local/man/man1/rview.1 | |
444 rm /usr/local/man/man1/rvim.1 | |
445 rm /usr/local/man/man1/view.1 | |
446 rm /usr/local/man/man1/vim.1 | |
447 rm /usr/local/man/man1/vimdiff.1 | |
448 rm /usr/local/man/man1/vimtutor.1 | |
449 rm /usr/local/man/man1/xxd.1 | |
450 | |
451 | |
452 MS-WINDOWS | |
453 | |
454 If you installed Vim with the self-installing archive you can run | |
455 the "uninstall-gui" program located in the same directory as the other Vim | |
19116 | 456 programs, e.g. "c:\vim\vim82". You can also launch it from the Start menu if |
7 | 457 installed the Vim entries there. This will remove most of the files, menu |
458 entries and desktop shortcuts. Some files may remain however, as they need a | |
459 Windows restart before being deleted. | |
460 You will be given the option to remove the whole "vim" directory. It | |
461 probably contains your vimrc file and other runtime files that you created, so | |
462 be careful. | |
463 | |
464 Else, if you installed Vim with the zip archives, the preferred way is to use | |
18182
9b6bfce90778
patch 8.1.2086: missing a few changes for the renamed files
Bram Moolenaar <Bram@vim.org>
parents:
16606
diff
changeset
|
465 the "uninstall" program. You can find it in the same directory as the |
19116 | 466 "install" program, e.g., "c:\vim\vim82". This should also work from the usual |
18182
9b6bfce90778
patch 8.1.2086: missing a few changes for the renamed files
Bram Moolenaar <Bram@vim.org>
parents:
16606
diff
changeset
|
467 "install/remove software" page. |
7 | 468 However, this only removes the registry entries for Vim. You have to |
19116 | 469 delete the files yourself. Simply select the directory "vim\vim82" and delete |
7 | 470 it recursively. There should be no files there that you changed, but you |
471 might want to check that first. | |
472 The "vim" directory probably contains your vimrc file and other runtime | |
473 files that you created. You might want to keep that. | |
474 | |
475 ============================================================================== | |
476 | |
477 Table of contents: |usr_toc.txt| | |
478 | |
14519 | 479 Copyright: see |manual-copyright| vim:tw=78:ts=8:noet:ft=help:norl: |