Install vim on macOS High Sierra using source code

Using git to clone the source code and change directory to vim/src, build the source code using make and then install it into /usr/local/bin.

~$ git clone https://github.com/vim/vim.git
~$ cd vim/src
~$ sudo make 
~$ sudo make install

After above, restart the terminal, run below commands to verify the installation.

~$ vim --version

Output will be something like below

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jan 24 2018 14:10:16)

macOS version

Included patches: 1-1428

Compiled by xxxx@xxx.local

Huge version without GUI.  Features included (+) or not (-):      

+extra_search      +mouse_netterm     +tag_old_static    

   system vimrc file: "$VIM/vimrc"

     user vimrc file: "$HOME/.vimrc"

 2nd user vimrc file: "~/.vim/vimrc"

      user exrc file: "$HOME/.exrc"

       defaults file: "$VIMRUNTIME/defaults.vim"

  fall-back for $VIM: "/usr/local/share/vim"

Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X -DMACOS_X_DARWIN  -O2   -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1       

Linking: gcc   -L/usr/local/lib -o vim        -lm -lncurses  -liconv -lintl -framework AppKit   

Check the vim installation path

~$ which vim
/usr/local/bin/vim

 

 

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s