Install Vim On Mac

Posted on  by admin

I'd use Homebrew to install Vim on macOS, with brew install vim, but the Homebrew Formula for Vim seems to install many additional features that I don't need. For example, while I do plan on using Vim to edit Ruby files, I don't plan on using the Ruby interface to Vim. (See:help ruby.). I'm using brew vim which is currently at version 8.0.1850 but 8.1 has just been released and I'm wondering if there is a way to upgrade to it yet? I've done some digging and can't see an option to.

Vim is available for many different systems and there are several versions.This page will help you decide what to download.Most popular:
MS-Windows:Click this link to download the self-installing executable(using ftp).
Signed MS-Windows files are available on thevim-win32-installer site(gvim_8.2.0012_x86_signed.exe is recommended)
Unix:See the GitHub page, or Mercurial, if you prefer that.There is also anAppimagewhich is build daily and runs on many Linux systems.
Mac:See the MacVim project for a GUI version and Homebrew for a terminal version

Details and options for:

MirrorsAlternative sites to download Vim files from.
SourcesBuild Vim yourself and/or make changes.
GitHubObtain Vim sources with a git client (recommended).
MercurialObtain Vim sources with a Mercurial client(recommended if you don't like git).
PatchesInclude the latest improvements (requires sources and rebuilding).
RuntimeGet the latest syntax files, documentation, etc..
Script linksLinks to individual syntax, indent, color, compiler and ftplugin scripts.
TranslationsNon-English documentation packages.

Versions before 7.3 can also be obtained withSubversionandCVS.Vim 8.2 is the latest stable version. It is highly recommended, many bugs have been fixed since previous versions.If you have a problem with it (e.g.,when it's too big for your system), you could try version 6.4 or 5.8 instead.

To avoid having to update this page for every new version, there arelinks to the directories. From there select the files you want to download.In the file names ## stands for the version number. For example,vim##src.zipwith version 8.2 is andvim-##-src.tar.gz for version 8.2is vim-8.2-src.tar.gz.Links are provided for quick access to the latest version.
Note that the links point to the latest version (currently 8.2) to avoidthat caching causes you to get an older version.

The best way to install Vim on Unix is to use the sources. This requires acompiler and its support files. Compiling Vim isn't difficult at all.You can simply type 'make install' when you are happy with the defaultfeatures. Edit the Makefile in the 'src' directory to select specificfeatures.

You need to download at the sources and the runtime files.And apply all the latest patches.For Vim 6 up to 7.2 you can optionally get the 'lang' archive, which adds translated messages and menus. For 7.3 and later this is included with the runtime files.

Using git
This is the simplest and most efficient way to obtain the latest version, including all patches. This requires the 'git' command.
The explanations are on the GitHub page.


Using Mercurial
This is another simple and most efficient way to obtain the latest version, including all patches. This requires the 'hg' command.
The explanations are on this page:Mercurial


version 7.x and 8.x
There is one big file to download that contains almost everything.It is found inthe unix directory(ftp):
The runtime and source files together:vim-##.tar.bz2vim-8.2.tar.bz2 (ftp)
The files ending in '.tar.gz' are tar archives that are compressed with gzip.Unpack them with tar -xzf filename.
The single big file ending in '.tar.bz2' is a tar archive compressed withbzip2. Uncompress and unpack it withbunzip2 -c filename tar -xf -.

Install Vim-fugitive On Mac

All archives should be unpacked in the same directory.

If you can't compile yourself or don't want to, look at the site of thesupplier of your Unix version for a packaged Vim executable. For Linuxdistributions and FreeBSD these are often available shortly after a new Vimversion has been released. But you can't change the features then.

  • Debian packages are available at:
  • Sun Solaris Vim is included in the Companion Software:
    Vim for other Sun systems can be found at
  • HPUX with GTK GUI for various HPUX versions: or (note that the remark about the GNU GPL is wrong)
For modern MS-Windows systems (starting with XP) you can simply use the executable installer:
gvim82.exe (ftp)
It includes GUI and console versions, for 32 bit and 64 bit systems.You can select what you want to install and includes an uninstaller.

If you want a signed version you can get a build from
It supports many interfaces, such as Perl, Tcl, Lua, Python and Ruby.There are also 64bit versions which only run on 64 bit MS-Windows and use alot more memory, but is compatible with 64 bit plugins.
You can also get a nightly build from there with the most recent improvements,with a small risk that something is broken.

Since there are so many different versions of MS operating systems, there areseveral versions of Vim for them.
For Vim 5.x, Vim 6.x and Vim 7 look inthe pc directory (ftp).

Self-installing executable gvim##.exe gvim82.exe (ftp)
For Vim 6 and later. This includes a GUI versionof Vim - with many features and OLE support - and all the runtime files.It works well on MS-Windows 95/98/ME/NT/2000/XP/Vista/7.Use this if you have enough disk space and memory. It's the simplest way tostart using Vim on the PC. The installer allows you to skip the parts youdon't want.
For Vim 6.3 and later it also includes a console version, both for MS-Windows 95/98/ME and MS-Windows NT/2000/XP/Vista/7. The installer automatically selects the right one.
Runtime files (ftp)
For all the following binary versions you need this runtime archive, whichincludes the documentation, syntax files, etc. Always get this, unless youuse the self-installing executable.

There are three versions that run as an MS-Windows application. These providemenus, scrollbars and a toolbar.

GUI executable (ftp)
This is the 'normal' GUI version.
OLE GUI executable (ftp)
A GUI version with OLE support. This offers a few extra features,such as integration with Visual Developer Studio. But it uses quite a bitmore memory.
There are three versions that run on MS-DOS or in a console window inMS-Windows:
Win32 console executable (ftp)
The Win32 console version works well on MS-Windows NT/2000/XP/Vista/7. It supports long file names and is compiled with 'big' features. It does not runperfectly well on MS-Windows 95/98/ME, especially when resizing the consolewindow (this may crash MS-Windows...).
32 bit DOS executable (ftp)
The 32 bit DOS version works well on MS-Windows 95/98/ME. It requires a DPMImanager, which needs to be installed on MS-DOS. MS-Windows already has one.It supports long file names, but NOT on MS-Windows NT/2000/XP/Vista/7. It is compiled with 'big' features.
Not available for 7.4 and later.
16 bit DOS executable (ftp)
The 16 bit DOS version is the only one that runs on old MS-DOS systems. Onlyuse this if you are really desparate, because it excludes many useful features(such as syntax highlighting and long file names) and quickly runs out ofmemory.
The last version available is 7.1. Version 7.2 and later are too big to fit in the DOS memory model.
There are a few extra files:
iconv librarylibiconv
A library used for converting character sets.Put 'iconv.dll' in the same directory as gvim.exe to be able to edit files inmany encodings. You can find the dll file in the bin directory of the'libiconv-win32' archive.
newer intl librarylibintl
The included libintl.dll does not support encoding conversion.If you have installed the iconv library, as mentioned above, you can install agettext library that uses it.Get 'intl.dll' from the bin directory in the gettext-win32 archive and store itas 'libintl.dll' in the same directory as gvim.exe, overwriting the filethat may already be there.
PC sources (ftp)
The source files, packed for the PC. This only includes the files needed onthe PC, not for other systems. The files are in dos format CR-LF.
PC debug files gvim##.pdb gvim82.pdb (ftp) gvim##ole.pdb gvim82ole.pdb (ftp) vim##w32.pdb vim80w32.pdb (ftp)
When you notice a bug or a crash in Vim these files can be used to help tracing down the problem. In Vim 7 do ':help debug-win32' to see how.
PC translations (ftp)
Only for 7.2 and earlier, for 7.3 and later these are included in the 'rt' archive.Translated messages and menu files, packed for the PC. Use this to seenon-English menus. The messages are only translated when the libintl.dlllibrary is installed.
Windows 3.1 GUI executable and
These are GUI versions for 16 bit windows (Windows 3.1). The 'w16' has manyfeatures, 'm16' has few features (for when you're short on memory).
The files ending in '.zip' can be unpacked with any unzip program.Make sure you unpack them all in the same directory!

Alternate distributions

Yongwei's build
You may also try Yongwei's build,executables with slightly different interfaces supported.
For an unofficial version that used to include all the latest patches andoptionally a bitmore: Cream.The 'one-click installer' mentioned includes the Cream changes.For the 'real Vim' use the 'without Cream' version listed further down.
Unfortunately, it stopped updating since Vim 8.0.
For a Cygwin binary look at others.
Quite a long time ago, Vim development started on the Amiga. Although it's areally old system now, it might still work. However, this has not been tested recently.You may have to use an older version for which Amiga binaries are available.

For Vim 5.x and Vim 6 look inthe amiga directory (ftp).
Vim 7 files can be found This is for AmigaOS 4. Made by Peter Bengtsson.

Runtime files vim##rt.tgz vim64rt.tgz (ftp)
Documentation, syntax files, etc. You always need this.
Executable vim##bin.tgz vim64bin.tgz (ftp)
The executables for Vim and Xxd.For Vim 6 it includes 'big' features, for Vim 5.x itincludes the normal features.For Vim 6.2 it is not available (my Amiga had harddisk problems then, this miraculously healed later).
Big executable vim##big.tgz
Vim with 'big' features and Xxd. Only for Vim 5.x.
Sources vim##src.tgz vim64src.tgz (ftp)
The source files for the Amiga.Only needed when you want to compile Vim yourself.
The files are all tar archives, compressed with gzip. To unpack, firstuncompress them with gzip -d filename. Then unpack withtar xf filename. You need to unpack the archives in the samedirectory.The OS/2 version runs in a console window.

For Vim 5.x and Vim 6 look inthe os2 directory (ftp).Version 6.2 is not available.Versions 6.3 and 6.4 were compiled by David Sanders.
Version 7.0 was compiled by David Sanders.

Runtime files (ftp)
Documentation, syntax files, etc. You always need this.
Executables (ftp)
Vim, Xxd, Tee and EMX libraries.
The files ending in '.zip' can be unpacked with any unzip program.Make sure you both zip archives in the same directory!

If you want to compile the OS/2 version, you need the EMX compiler. Use theUnix source archive, runtime files and the extra archive. After unpacking theruntime archive, move all the files and directories in the 'runtime'directory one level up.

The terminal version of Vim is included as 'vi', you already have it. It'slagging behind a bit though and has limited features, thus you may want toadditionally install a recent version or one with more features.


There most popular version is MacVim. This is being actively developed. Thisbehaves like a Mac application, using a GUI.

MacVim has more a Mac look and feel, is developed actively and most peopleprefer this version. Most of MacVim was made by Björn Winckler.

MacVim can be downloaded here:

New versions are made quite often.Subscribe to thevim-mac maillistto be informed about bugs and updates.


This is a terminal version installed with the 'brew' command.It is updated frequently.It can be downloaded here:


Older binaries for Mac OS/X can be found on thisSourceForge project.Maintained by Nicholas Stallard.

Here is a multi-byte version of Vim 5.7 (for Japanese, possibly also forKorean and Chinese; not for Unicode):


Most of the work forthe Macintosh port (Classic and Carbon) was done by Dany St-Amant.

If you have OSX and a setup for compiling programs, you can use the source codeand compile yourself. See the Unix section above. The development tools can bedownloaded from Apple's developer web site.

Turn to the vim-mac maillist to meet otherVim-Mac users.

This is a list of links to sites where various versions of Vim can be obtained.These are supported by individuals, use at your own risk.

Mac Vimrc

Android Search for 'Vim Touch' by Momodalo in the Play Store.
i/OS Run Vim on your iPhone or Ipad.
QNX (ftp) Provided by Yakov Zaytsev. Requires QNX 6.3.0/6.3.2 with service pack 2.
Cygwin (with GTK GUI)
Open VMS


System: macOS Mojave 10.14.6

vim version: 8.1 (higher than 7.4.1578 and supports Python 2 or Python 3)

CMake is a cross-platform project management tool. It can be obtained directly through brew

Vundle is an automated vim plug-in manager. Due to version updates, the configuration of Vundle is no longer consistent with half of the tutorials given online. Reference to Vundle's Official Documents To install Vundle, you can use the following commands

Once the download is complete, you can use Vundle to download and manage other plug-ins. First, specify the plug-in to use Vundle management in ~/.vimrc

The parameter after the Plugin command is the address of the plug-in to be managed at github. Once saved, open vim and run the command

Vundle checks whether these plug-ins are installed, and if not, it automatically downloads and installs them to github.

YouCompleteMe is also a plug-in, so it can be installed through Vundle. The difference is that

  1. YCM has a large volume and slow download speed. It's better to find a place to visit github fast to download.
  2. YCM needs to be compiled, so it will report an error after downloading, regardless of him.

Switch to YCM's download directory to run the installation script

If the C family needs to be semantically complemented, use parameters

If you're lucky enough, it should be ready. But in general, it's not possible (the hardest thing in history to install a plug-in is not for nothing). So YCM Official Documents The method of full manual installation is given in this paper.

1. Download YCM

This step can be done by pulling the git warehouse either by Vundle or manually.

It should be noted that many third-party warehouses are introduced in YCM warehouse. In especial

In this warehouse, the blogger did not succeed in two reloads (I don't know if this is the design). According to the official website, the installation of cregex is optional, and it may not matter if it is not downloaded. But after all, all the big heads are downloaded, and that's not bad.

2. Download libclang

This step is only necessary for C family semantic completion and can be skipped by unnecessary users. Direct access llvm official website Download llvm binary file

YCM officially requires llvm version not less than 8.0.0, but the maximum version 8.0.1 currently does not have macOS version, so you have to download this version first. If you have the latest version in the future, it is better to download the new version, so as not to recompile because of YCM updates.

Downloading precompiled llvm binaries is YCM's official recommendation, but using native llvm is also feasible

Because the blogger's network is so moving that it can't survive, and the result is unknown. Installed buddies can try.


The two steps mentioned earlier are probably the longest in the installation process. Therefore, before proceeding with the installation, it is better to backup the downloaded files, so as to avoid the subsequent installation failure and re-download. Bloggers put downloaded files on Baidu's web disk

Links: Password: zd3o

Compressed after about 600 MB, you can consider the speed of selective download.

Compile ycm_core

Next is the core of compiling YCM. First, you need to put the decompressed llvm in the ~/ycm_temp directory.

Then switch to the compiler directory

Start compiling

If it works properly, your YCM should already be available. Deleting the temporary path created above will not affect YCM work

Vim Download Mac

Compile regex

This step is optional in order to speed up the analysis of regular expressions. The compilation process is similar to that above.

After installation, YCM needs to be configured. If you use Vundle for management (YCM is in the ~/.vim/bundle/ directory), please confirm whether there is ~/.vimrc first.

Note that YCM declarations should be placed between vundle begin () and vundle end ().

Then I changed the location of the file., which I found in the YouCompleteMe / directory when I installed it. Estimation is another change in the process of renewal. In short, find the file and define it after the import statement

Install Vim On Mac Os

The annotated part is original. As you can see here, we define a list of flags as the return value of the FlagsForFile function. This list acts as a parameter following the gcc command. Look first at a series of values of - isystem, which contain paths that the compiler searches for when # include <...>. Although they are roughly the same, the paths of different computers may be slightly different and can be queried by command.

Notice that there is a line # include <...> search start here: the next few lines are the information we want.

After editing., you need to modify ~/.vimrc. Write after YCM's Plugin statement

It is equivalent to setting the newly modified file to the global YCM configuration. So YCM should be able to work. Open a source file at will, and the completion option will pop up automatically when the identifier is entered. If there is no response, or if you prompt The ycmd server SHUT DOWN on the bottom command line like a blogger, you need a little more work.


But if you install it successfully, congratulations, your vim already has IDE-level auto-completion. If necessary, it can also be configured in ~/.vimrc

According to the blogger's three-day experience of installing YCM, the main reason why this plug-in is difficult to install is that the download speed is slow. If you download the YouCompleteMe repository and llvm binary in advance, it will not be slow to install (bloggers will run out within five minutes of the last reload). So it's not difficult to reinstall as long as the backup is done before installation. Now let's talk about the problems I encountered during installation.

vim flashback, report python's Momsory Error

This problem occurred after I first used Vundle to install YCM. At that time, everything went amazingly well, Vundle downloaded YCM in less than half an hour, and reported an error Memory Error. But at that time, I thought that this mistake was the 'normal' mistake in the legend. I didn't care about him. When a set of installation process came down, I found that my vim was no longer in use.

Later, I found that the Vundle I installed was an old version, and all the commands I used were Bundle'Valloric/YouCompleteMe'. It may be compatibility issues and so on. In short, vim triggers MemoryError when it handles call vundle#rc(). Finally, delete the Vundle and reinstall it.

The ycmd server SHUT DOWN ... Unexpected exit code -11 ...

According to the prompt to check the log found to be empty, searched the Internet for a long time and no one said - 11 code corresponding to what the problem is... Maybe it's Unexpected. So the blogger used the omnipotent remedy.

Re-install. However, I gave up after two reinstallations. Generally speaking, installation errors are not so frequent. Later, I saw the ideas provided by netizens on a website.

  1. Use the command: YcmDiag to get specific information
  2. Comment let g:ycm_confirm_extra_conf=0 in ~/.vimrc to confirm compilation

The first method is actually equivalent to viewing the log, except that the log does not record information, and the command actually returns an error that the built-in completion function cannot recognize the file type. It's also because of this error message that I suspect the installation of llvm ( was used all the time before, and I didn't think that automatic downloading would cause problems).

The second method is a little more complicated. Normally, after entering vim, YCM will ask at the bottom command line if a. file is loaded unless this function is disabled in ~/. vimrc (that is, the function of the command above). So if compiled properly, there should be similar queries. Even if there is a mistake, it should collapse after asking. But the blogger's VIM prompts server shutdown as soon as it enters, so it's doubtful that there's something wrong with the compilation process.

As a result, reinstallation is necessary, but it's no longer reliable to install with scripts, so I chose to install manually. It has to be said that official documents should be taken seriously, even if there are problems after installation, it is generally not fatal.

Python version

How To Install Vim On Mac

The most common question asked online is the inconsistency of versions. There are two main inconsistencies: Python version and llvm version. Since llvm is downloaded manually from the official website, there is no such problem. As for the Python version, bloggers haven't figured out what the problem is... But as a result, ycmd server shutdown again. This time, instead of Unexpected, it reminds me that the Python version used at compile time is different from the Python version used at run time, and that the installation path of Python 2 needs to be given in ~/.vimrc. So there's a sentence like this.

As mentioned above, a flags list is added when modifying ~/.vim/bundle/YouCompleteMe/ The - isystem option in this list specifies the search path for the system header file. For the header file inside the project, there is only the phrase'-I','.'. If you use header files that are not in this directory in your project, you also need to modify this file. But obviously this is inefficient. Therefore, it is better to copy a configuration file to the root directory of the project source code and add the project header directory to the configuration file. Because YCM searches for. first for the current directory, then one by one for the parent directory, and finally for the global configuration file. Therefore, the configuration file of the project root directory can overwrite the global file. This is equivalent to specifying a separate configuration for each project, without polluting the system settings.

Posted by cyberrate on Tue, 13 Aug 2019 22:24:20 -0700