How to Install Latest Version Vim in Ubuntu 14.04 LTS

Thu, Jun 30, 2016 Last Modified: Jul 7, 2016
Category: tutorial Tags: [vim] [linux]

Vim Icon svg

Ubuntu comes with Vim-Tiny

First of all, Ubuntu 14.04 LTS comes with Vim.Tiny with the version 2:7.4.052-1ubuntu3 which is Vim 7.4.052, already fairly new. Unfortunately I was looking specifically for markdown editing and syntax highlighting and I found that starting from 7.4.480 vim can pick up *.md files as markdown files by default. So I wanted to find a newer version of Vim to install.

Install Vim with PPA

I have tried to install Vim with debian packages listed on Vim.org but they did not come with the dependencies. So PPA was an easier way to go. ppa:pkg-vim/vim-daily has version 7.4.826 which is good enough.

sudo add-apt-repository ppa:pkg-vim/vim-daily
sudo apt-get update
sudo apt-get install vim

You can use apt-cache policy vim to check the version of the vim in your repositories.

Install From Source

Vim.org has detailed instructions on how to git clone and install from source for the latest version of Vim and you can custom configure. One suggestion would be to use checkinstall just in case you ever want to cleanly remove the installation.

The Vim 7.4.826 version from the PPA does not have system clipboard support by default. Use vim --version | grep 'clipboard' at shell to check. If you have +clipboard and/or +xterm_clipboard then you are good to go. Otherwise you can either install from source or sudo apt-get install vim-gnome which already has the clipboard support.

Basic Configuration to Enable Markdown Highlighting

This ppa version of Vim does not automatically generate ~/.vimrc file but you can create the file yourself and put the following content in the file:

syntax on
colorscheme industry

then you are good to go. I am happy to find that mouse/touchpad scrolling also works to go up and down the lines instead of using j and k commands.

Why Vim?

A lot of people like Vim/Emacs. For me, Vim seems to be a very lightweight text editor which is very similar to Vi that comes with most server command line interfaces. It’s good to get familiar with at least the basic usage of Vim. I have been using atom in my Ubuntu but atom has a memory leak issue which sometimes causes Ubuntu to hang or even restart as an guest OS with Oracle VirtualBox in Windows 10 host. Going to light weight and more basic is also a good way to practice your programming language knowledges when you lose all the autocompletion, not that Vim cannot do autocompletion but you can pretend as if.

Example memory usage: Vim with a few buffers open switching between editing those files uses < 5 Mb and atom typically uses over 200 Mb memory with similar number of files open.

comments powered by Disqus