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