Skip to content

Instantly share code, notes, and snippets.

@StandardNerd
Created December 13, 2018 13:09
Show Gist options
  • Save StandardNerd/2d4790e8cedc14c4efb111015ace51ee to your computer and use it in GitHub Desktop.
Save StandardNerd/2d4790e8cedc14c4efb111015ace51ee to your computer and use it in GitHub Desktop.
gvim installation instructions

Vim Install/Compile

Debian/Ubuntu Machines

Tested on

  • Ubuntu v12.04 LTS
  • Ubuntu v12.10
  • Ubuntu v13.xx
  • Ubuntu v14.04 LTS
Optional: Good idea updating your sources.list first.

This might take awhile depending on how up to date your packages are. You can skip this step if you don't want.

sudo apt-get -y update && sudo apt-get -y upgrade

1. Install necessary build libraries

BUILD_LIBS=(libncurses5-dev
            libgnome2-dev
            libgnomeui-dev
            libgtk2.0-dev
            libatk1.0-dev
            libbonoboui2-dev
            libcairo2-dev
            libx11-dev
            libxpm-dev
            libxt-dev
            python-dev
            ruby-dev
            mercurial
)
sudo apt-get install -y "${BUILD_LIBS[@]}"

2. Start from scratch, remove base vim installation

sudo apt-get remove -y vim vim-runtime gvim vim-tiny vim-common vim-gui-common

Rebuild Dependencies

sudo apt-get -y autoclean && sudo apt-get -y build-dep vim

3. Build Source

Download source into your /tmp directory

cd /tmp && hg clone https://code.google.com/p/vim/
Setup (Let's do gtk+ and not gnome for gvim)

Run this whole block.

cd /tmp/vim
./configure --with-features=huge \
            --enable-multibyte \
            --enable-rubyinterp \
            --enable-pythoninterp \
            --with-python-config-dir="$(python-config --configdir)" \
            --enable-perlinterp \
            --enable-luainterp \
            --enable-gui=gtk2 \
            --enable-cscope \
            --prefix=/usr

Compile

If it fails at the compilation stage, make sure all the libraries in step 1 & 2 are installed.

This step can take a while.

VIMRUNTIMEDIR=/usr/share/vim/vim74 make && sudo make install

Set Default

Set vim as your default editor with update-alternatives.

sudo update-alternatives --install /usr/bin/editor editor /usr/bin/vim 1
sudo update-alternatives --set editor /usr/bin/vim
sudo update-alternatives --install /usr/bin/vi vi /usr/bin/vim 1
sudo update-alternatives --set vi /usr/bin/vim

5. Verify Successful Build

Run gvim --version should output something like this.

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Oct  4 2014 01:13:58)
Included patches: 1-463
Compiled by Sang Han 2014
Huge version with GTK2 GUI.  Features included (+) or not (-):
....
.... more stuff

Check the Header

  • Version = 7.4?
  • Compiled = now: compiled Oct....?
  • GUI = GTK2 GUI?
+acl             +farsi           +mouse_netterm   +syntax
+arabic          +file_in_path    +mouse_sgr       +tag_binary
+autocmd         +find_in_path    -mouse_sysmouse  +tag_old_static
+balloon_eval    +float           +mouse_urxvt     -tag_any_white
+browse          +folding         +mouse_xterm     -tcl
++builtin_terms  -footer          +multi_byte      +terminfo
+byte_offset     +fork()          +multi_lang      +termresponse
+cindent         +gettext         -mzscheme        +textobjects
+clientserver    -hangul_input    +netbeans_intg   +title
+clipboard       +iconv           +path_extra      +toolbar
+cmdline_compl   +insert_expand   +perl            +user_commands
+cmdline_hist    +jumplist        +persistent_undo +vertsplit
+cmdline_info    +keymap          +postscript      +virtualedit
+comments        +langmap         +printer         +visual
+conceal         +libcall         +profile         +visualextra
+cryptv          +linebreak       +python          +viminfo
+cscope          +lispindent      -python3         +vreplace
+cursorbind      +listcmds        +quickfix        +wildignore
+cursorshape     +localmap        +reltime         +wildmenu
+dialog_con_gui  +lua             +rightleft       +windows
+diff            +menu            +ruby            +writebackup
+digraphs        +mksession       +scrollbind      +X11
+dnd             +modify_fname    +signs           -xfontset
-ebcdic          +mouse           +smartindent     +xim
+emacs_tags      +mouseshape      -sniff           +xsmp_interact
+eval            +mouse_dec       +startuptime     +xterm_clipboard
+ex_extra        +mouse_gpm       +statusline      -xterm_save
+extra_search    -mouse_jsbterm   -sun_workshop    +xpm

Other Stuff

  • Activated: +
  • Deactivated: -

Check to make sure both +python and +ruby interpreters are activated.

If you have -python or -ruby, it means something wrong happened during compilation.

  • +python
  • +ruby

Done!

you're all set!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment