Skip to content

Instantly share code, notes, and snippets.

@bronson
Created June 29, 2011 04:37
Show Gist options
  • Select an option

  • Save bronson/1053164 to your computer and use it in GitHub Desktop.

Select an option

Save bronson/1053164 to your computer and use it in GitHub Desktop.
Installing Vim from source on Ubuntu to fix crashing
# The vim included with Ubuntu Natty is heinously buggy. Also Lucid it appears.
# Fix that by compiling the latest Vim 7.3 yourself:
sudo dpkg --purge vim-runtime vim-gui-common vim-gtk vim-gnome vim-nox
cd vim/src
sudo apt-get install mercurial libgnome2-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev libperl-dev python-dev ruby-dev
hg clone https://vim.googlecode.com/hg/ vim
rvm use system # (if you're using rvm)
./configure --enable-perlinterp --enable-pythoninterp --enable-rubyinterp --enable-cscope --with-features=huge --enable-gui=gnome2 --with-x
make -j 3 # 3 jobs in parallel, 1 more than # of cores
sudo make install
sudo ln -s /usr/local/bin/vim /usr/local/bin/vi
# Done! Now your vim won't crash when you invoke Command-T or Hammer.
# If vim still crashes and you use rvm, you need to do this to ensure
# that vim is running against the system's ruby:
sudo mv /usr/local/bin/vim /usr/local/bin/vim.orig
sudo tee /usr/local/bin/vim << 'EOL'
#!/bin/bash
if type -t rvm >/dev/null 2>&1; then
exec rvm system exec -a "$0" vim.orig "$@"
else
exec -a "$0" vim.orig "$@"
fi
EOL
sudo chmod a+x /usr/local/bin/vim
@bronson

bronson commented Oct 12, 2011

Copy link
Copy Markdown
Author

It appears that all this mess is to work around rvm. rbenv doesn't suffer the same problem. If you compile Command-T against system Ruby, everything just works.

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