codekingpro/portable-devtools
114k
1*usr_90.txt* For Vim version 9.2. Last change: 2026 Feb 142 3 4 VIM USER MANUAL by Bram Moolenaar5 6 7 Installing Vim8 9 *install*10Before you can use Vim you have to install it. Depending on your system it's11simple or easy. This chapter gives a few hints and also explains how12upgrading to a new version is done.13 14|90.1| Unix15|90.2| MS-Windows16|90.3| Upgrading17|90.4| Common installation issues18|90.5| Uninstalling Vim19 20 Previous chapter: |usr_52.txt| Write plugins using Vim9 script21Table of contents: |usr_toc.txt|22 23==============================================================================24*90.1* Unix25 26First you have to decide if you are going to install Vim system-wide or for a27single user. The installation is almost the same, but the directory where Vim28is installed in differs.29 For a system-wide installation the base directory "/usr/local" is often30used. But this may be different for your system. Try finding out where other31packages are installed.32 When installing for a single user, you can use your home directory as the33base. The files will be placed in subdirectories like "bin" and "share/vim".34 35 36FROM A PACKAGE37 38Depending on the Unix/Linux system used, there may exist pre-compiled binary39packages. You need to search for this. We used to keep a list for different40UNIX systems, but that list was outdated so the list was removed.41 42It is a good idea to compile your own UNIX version from the source. Also,43creating the editor from the source allows you to control which features are44compiled. This does require a compiler though.45 46If you have a Linux distribution, the "vi" program is probably a minimal47version of Vim. It doesn't do syntax highlighting, for example. Try finding48another Vim package in your distribution, or search on the web site.49 50 51FROM SOURCES52 53To compile and install Vim, you will need the following:54 55 - A C compiler (GCC or clang preferred)56 - git (optionally, only when cloning from github)57 - zip/unzip (to uncompress the archive)58 - The Vim source archives59 60To download the Vim source, you can either clone it from the Github project61page: >62 git clone https://github.com/vim/vim.git63<64or download the archive directly using:65 66 https://github.com/vim/vim/archive/refs/heads/master.zip67 68 69COMPILING70 71First create a top directory to work in, for example: >72 73 mkdir ~/vim74 cd ~/vim75 76Then unpack the archives there. You can unpack it like this: >77 78 unzip vim-master.zip79 80If you are satisfied with getting the default features, and your environment81is setup properly, you should be able to compile Vim with just this: >82 83 cd vim-master/src84 make85 86The make program will run configure and compile everything. Further on we87will explain how to compile with different features.88 If there are errors while compiling, carefully look at the error messages.89There should be a hint about what went wrong. Hopefully you will be able to90correct it. You might have to disable some features to make Vim compile.91Look in the Makefile for specific hints for your system.92 93 94TESTING95 96Now you can check if compiling worked OK: >97 98 make test99 100This will run a sequence of test scripts to verify that Vim works as expected.101Vim will be started many times and all kinds of text and messages flash by.102If it is alright you will finally see:103 104 test results: ~105 ALL DONE ~106 107If you get "TEST FAILURE" some test failed. If there are one or two messages108about failed tests, Vim might still work, but not perfectly. If you see a lot109of error messages or Vim doesn't finish until the end, there must be something110wrong. Either try to find out yourself, or find someone who can solve it.111You could look in the |maillist-archive| for a solution. If everything else112fails, you could ask in the vim |maillist| if someone can help you.113 114 115INSTALLING116 *install-home*117If you want to install in your home directory, edit the Makefile and search118for a line:119 120 #prefix = $(HOME) ~121 122Remove the # at the start of the line.123 When installing for the whole system, Vim has most likely already selected124a good installation directory for you. You can also specify one, see below.125You need to become root for the following.126 127To install Vim do: >128 129 make install130 131That should move all the relevant files to the right place. Now you can try132running vim to verify that it works. Use two simple tests to check if Vim can133find its runtime files: >134 135 :help136 :syntax enable137 138If this doesn't work, use this command to check where Vim is looking for the139runtime files: >140 141 :echo $VIMRUNTIME142 143You can also start Vim with the "-V" argument to see what happens during144startup: >145 146 vim -V147 148Don't forget that the user manual assumes you Vim in a certain way. After149installing Vim, follow the instructions at |not-compatible| to make Vim work150as assumed in this manual.151 152 153SELECTING FEATURES154 155Vim has many ways to select features. One of the simple ways is to edit the156Makefile. There are many directions and examples. Often you can enable or157disable a feature by uncommenting a line.158 An alternative is to run "configure" separately. This allows you to159specify configuration options manually. The disadvantage is that you have to160figure out what exactly to type.161 Some of the most interesting configure arguments follow. These can also be162enabled from the Makefile.163 164 --prefix={directory} Top directory where to install Vim.165 166 --with-features=tiny Compile with some features disabled.167 --with-features=normal Compile with more features enabled.168 --with-features=huge Compile with most features enabled.169 See |+feature-list| for which feature170 is enabled in which case.171 172 --enable-perlinterp Enable the Perl interface. There are173 similar arguments for ruby, python and174 tcl.175 176 --disable-gui Do not compile the GUI interface.177 --without-x Do not compile X-windows features.178 When both of these are used, Vim will179 not connect to the X server, which180 makes startup faster.181 182To see the whole list use: >183 184 ./configure --help185 186You can find a bit of explanation for each feature, and links for more187information here: |feature-list|.188 For the adventurous, edit the file "feature.h". You can also change the189source code yourself!190 191==============================================================================192*90.2* MS-Windows193 194There are several ways to install the Vim program for Microsoft Windows:195 196 1. Official Website Download (Stable)~197 198Visit the official Vim website at https://www.vim.org to download the latest199stable version. The site links to the Windows installer that works out of the200box for most users.201 202 2. Using winget (Windows Package Manager) ~203 204If you prefer using the command line, you can quickly install Vim using205Windows' built-in package manager for the stable version: >206 207 winget install vim.vim208 209Or to download the latest nightly version, use: >210 211 winget install vim.vim.nightly212 213This method ensures you get an up-to-date version with minimal hassle.214 215 3. GitHub Installer (All Architectures) ~216 217For more control over the installation (or if you're using a specific CPU218architecture like ARM), visit the official GitHub repository:219 220 https://github.com/vim/vim-win32-installer/221 222This repo provides daily installer and portable zip archives for:223 224 - x86 (32-bit)225 - x64 (64-bit)226 - ARM64227 228It's a great option if you want nightly builds or specific configuration229 230In case you are not satisfied with the features included in the supplied231binaries, you could try compiling Vim yourself. Get the source archive from232the same location as where the binaries are. You need a compiler for which a233makefile exists. Microsoft Visual C, MinGW and Cygwin compilers can be used.234Check the file src/INSTALLpc.txt for hints. You can get the source from:235 236 https://github.com/vim/vim237 238==============================================================================239*90.3* Upgrading240 241If you are running one version of Vim and want to install another, here is242what to do.243 244 245UNIX246 247When you type "make install" the runtime files will be copied to a directory248which is specific for this version. Thus they will not overwrite a previous249version. This makes it possible to use two or more versions next to250each other.251 The executable "vim" will overwrite an older version. If you don't care252about keeping the old version, running "make install" will work fine. You can253delete the old runtime files manually. Just delete the directory with the254version number in it and all files below it. Example: >255 256 rm -rf /usr/local/share/vim/vim74257 258There are normally no changed files below this directory. If you did change259the "filetype.vim" file, for example, you better merge the changes into the260new version before deleting it.261 262If you are careful and want to try out the new version for a while before263switching to it, install the new version under another name. You need to264specify a configure argument. For example: >265 266 ./configure --with-vim-name=vim8267 268Before running "make install", you could use "make -n install" to check that269no valuable existing files are overwritten.270 When you finally decide to switch to the new version, all you need to do is271to rename the binary to "vim". For example: >272 273 mv /usr/local/bin/vim8 /usr/local/bin/vim274 275 276MS-WINDOWS277 278Upgrading is mostly equal to installing a new version. Just unpack the files279in the same place as the previous version. A new directory will be created,280e.g., "vim82", for the files of the new version. Your runtime files, vimrc281file, viminfo, etc. will be left alone.282 If you want to run the new version next to the old one, you will have to do283some handwork. Don't run the install program, it will overwrite a few files284of the old version. Execute the new binaries by specifying the full path.285The program should be able to automatically find the runtime files for the286right version. However, this won't work if you set the $VIMRUNTIME variable287somewhere.288 If you are satisfied with the upgrade, you can delete the files of the289previous version. See |90.5|.290 291==============================================================================292*90.4* Common installation issues293 294This section describes some of the common problems that occur when installing295Vim and suggests some solutions. It also contains answers to many296installation questions.297 298 299Q: I Do Not Have Root Privileges. How Do I Install Vim? (Unix)300 301Use the following configuration command to install Vim in a directory called302$HOME/vim: >303 304 ./configure --prefix=$HOME305 306This gives you a personal copy of Vim. You need to put $HOME/bin in your307path to execute the editor. Also see |install-home|.308 309 310Q: The Colors Are Not Right on My Screen. (Unix)311 312Check your terminal settings by using the following command in a shell: >313 314 echo $TERM315 316If the terminal type listed is not correct, fix it. For more hints, see317|06.2|. Another solution is to always use the GUI version of Vim, called318gvim. This avoids the need for a correct terminal setup.319 320 321Q: My Backspace And Delete Keys Don't Work Right322 323The definition of what key sends what code is very unclear for backspace <BS>324and Delete <Del> keys. First of all, check your $TERM setting. If there is325nothing wrong with it, try this: >326 327 :set t_kb=^V<BS>328 :set t_kD=^V<Del>329 330In the first line you need to press CTRL-V and then hit the backspace key.331In the second line you need to press CTRL-V and then hit the Delete key.332You can put these lines in your vimrc file, see |05.1|. A disadvantage is333that it won't work when you use another terminal some day. Look here for334alternate solutions: |:fixdel|.335 336 337Q: I Am Using RedHat Linux. Can I Use the Vim That Comes with the System?338 339By default RedHat installs a minimal version of Vim. Check your RPM packages340for something named "Vim-enhanced-version.rpm" and install that.341 342 343Q: How Do I Turn Syntax Coloring On? How do I make plugins work?344 345Use the example vimrc script. You can find an explanation on how to use it346here: |not-compatible|.347 348See chapter 6 for information about syntax highlighting: |usr_06.txt|.349 350 351Q: What Is a Good vimrc File to Use?352 353See the www.vim.org Web site for several good examples.354 355 356Q: Where Do I Find a Good Vim Plugin?357 358See the Vim-online site: http://vim.sf.net. Many users have uploaded useful359Vim scripts and plugins there.360 361 362Q: Where Do I Find More Tips?363 364See the Vim-online site: http://vim.sf.net. There is an archive with hints365from Vim users. You might also want to search in the |maillist-archive|.366 367==============================================================================368*90.5* Uninstalling Vim369 370In the unlikely event you want to uninstall Vim completely, this is how you do371it.372 373 374UNIX375 376When you installed Vim as a package, check your package manager to find out377how to remove the package again.378 If you installed Vim from sources you can use this command: >379 380 make uninstall381 382However, if you have deleted the original files or you used an archive that383someone supplied, you can't do this. Do delete the files manually, here is an384example for when "/usr/local" was used as the root: >385 386 rm -rf /usr/local/share/vim/vim82387 rm /usr/local/bin/eview388 rm /usr/local/bin/evim389 rm /usr/local/bin/ex390 rm /usr/local/bin/gview391 rm /usr/local/bin/gvim392 rm /usr/local/bin/gvim393 rm /usr/local/bin/gvimdiff394 rm /usr/local/bin/rgview395 rm /usr/local/bin/rgvim396 rm /usr/local/bin/rview397 rm /usr/local/bin/rvim398 rm /usr/local/bin/rvim399 rm /usr/local/bin/view400 rm /usr/local/bin/vim401 rm /usr/local/bin/vimdiff402 rm /usr/local/bin/vimtutor403 rm /usr/local/bin/xxd404 rm /usr/local/man/man1/eview.1405 rm /usr/local/man/man1/evim.1406 rm /usr/local/man/man1/ex.1407 rm /usr/local/man/man1/gview.1408 rm /usr/local/man/man1/gvim.1409 rm /usr/local/man/man1/gvimdiff.1410 rm /usr/local/man/man1/rgview.1411 rm /usr/local/man/man1/rgvim.1412 rm /usr/local/man/man1/rview.1413 rm /usr/local/man/man1/rvim.1414 rm /usr/local/man/man1/view.1415 rm /usr/local/man/man1/vim.1416 rm /usr/local/man/man1/vimdiff.1417 rm /usr/local/man/man1/vimtutor.1418 rm /usr/local/man/man1/xxd.1419 420 421MS-WINDOWS422 423If you installed Vim with the self-installing archive you can run424the "uninstall-gui" program located in the same directory as the other Vim425programs, e.g. "c:\vim\vim82". You can also launch it from the Start menu if426installed the Vim entries there. This will remove most of the files, menu427entries and desktop shortcuts. Some files may remain however, as they need a428Windows restart before being deleted.429 You will be given the option to remove the whole "vim" directory. It430probably contains your vimrc file and other runtime files that you created, so431be careful.432 433Else, if you installed Vim with the zip archives, the preferred way is to use434the "uninstall" program. You can find it in the same directory as the435"install" program, e.g., "c:\vim\vim82". This should also work from the usual436"install/remove software" page.437 However, this only removes the registry entries for Vim. You have to438delete the files yourself. Simply select the directory "vim\vim82" and delete439it recursively. There should be no files there that you changed, but you440might want to check that first.441 The "vim" directory probably contains your vimrc file and other runtime442files that you created. You might want to keep that.443 444==============================================================================445 446Table of contents: |usr_toc.txt|447 448Copyright: see |manual-copyright| vim:tw=78:ts=8:noet:ft=help:norl:449 