Vim is pre-installed on both Linux and OSX, but the version may not have the
which allows copy/pasting between Vim panes in tmux (see this post for an
intro to tmux). Copy/pasting between panes is a really useful feature, so it is worth spending ten minutes to make sure this
option is available.
This post describes how to install a version of Vim which has the
+clipboard flag for OSX.
There is also another post describing how to enable this option in OSX.
Check if Vim is installed
First, in a terminal try:
If it says something like
The program "vim" can be found in the following packages:..., then it is not installed.
Or, if that produces too much output, try:
vim --version | grep VIM
and this should display the version number in the first line.
Installing Vim on Linux
Assuming you use Ubuntu, the following command will install Vim:
sudo apt-get install vim-gnome
(Enter your superuser password, and later type
Enter when asked if you really want to install 30MB of files.)
Then check the version:
The version should be something like 7.3 (you may need to scroll up to see the first line).
Vim and the system clipboard
vim-gnome is used instead of simply
vim; this is because this version will come with the
clipboard option enabled. Even if you are using KDE, still use this command. Then, if (after installing) you enter the command:
vim --version | grep clipboard
you should then see the entries
+ means that the clipboard is enabled and using the Vim commands
p will copy/paste from the clipboard. If instead of seeing the
+, you see:
then this means that the clipboard does not work.
I found this tip in this post.
Obtaining the vimrc
Step 1: Download the necessary files
Copy/paste the following into a terminal.
To copy, use
Ctrl-C. To paste in the terminal, use
Note: When you highlight the following text, the
$ symbols will not be included (and they should not be!) - they just indicate that the commands must be entered copy/pasted into the terminal.
#create and move to ~/build/vim dir
mkdir -p ~/build
mkdir -p ~/build/vim
#get necessary files
wget --content-disposition http://www.vim.org/scripts/download_script.php?src_id=22665
#move to ~/.vim dir - different to ~/build/vim!
mkdir -p ~/.vim
cp ~/build/vim/delimitMate-2.7.zip ./
#include wombat colorscheme
if [ -d "./colors" ]; then cd ./colors; else mkdir ./colors; cd ./colors; fi
cp ~/build/vim/wombat16.vim ./
#if there already exists vimrc file, then copy here to back it up
if [ -f "~/.vimrc" ]; then cp ~/.vimrc ./bak_vimrc; fi
cp vimrc.txt ~/.vimrc
Setting the terminal colorscheme
The terminal might not display the colorscheme correctly. In order to use the wombat16 colorscheme, in the terminal window, select:
Edit → Profile preferences → Colors → Pallette → Built-in schemes
and then select Linux console or Xterm or White on Black. This is to make "greying" work between active/inactive panes on tmux.
If you' using KDE and Konsole, then go to: Settings → Edit Current Profile → Appearance and select Linux colors