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