Skip to content

Instantly share code, notes, and snippets.

@AdrienGiboire
Created June 27, 2012 15:00
Show Gist options
  • Save AdrienGiboire/3004640 to your computer and use it in GitHub Desktop.
Save AdrienGiboire/3004640 to your computer and use it in GitHub Desktop.
Install Vim 7.3 on MacOSX Lion
separator = String.new
8.times { separator += '-' }
separator = "\n" + separator + "\n"
def newblock(text)
puts "\n#{separator}" + text + + "#{separator}\n"
end
newblock "Prerequisites (iconv)"
if not system("which iconv")
puts "You have to install `libicon` (http://www.gnu.org/software/libiconv/), first."
exit
end
newblock "Ensure that the right version of Ruby (1.8.7) is set"
if system('type -a rvm')
system "rvm use system"
end
newblock "CD to `/tmp/`"
system "cd /tmp/"
newblock "Get Vim through CURL"
system "curl ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2 | tar -xz"
system "cd vim73"
newblock "Start configure"
system "./configure --enable-pythoninterp --enable-rubyinterp --enable-perlinterp --enable-gui --enable-multibyte"
if `uname -m`.include? "x86_64"
newblock "Your achitecture is x86_64. Set `config.mk` to handle this information."
config = File.read("#{Dir.pwd}/src/auto/config.mk")
r = config.gsub(/.*LDFLAGS.*/,"LDFLAGS = -L. -arch x86_64 -L/usr/local/lib")
File.open("#{Dir.pwd}/src/auto/config.mk", "w") { |file| file.puts r }
end
newblock "Make"
system "make && make install"
newblock "Old Vim symlink moved to /usr/bin/vim.old"
system "sudo mv /usr/bin/vim /usr/bin/vim.old"
system "sudo ln -s /usr/local/bin/vim /usr/bin/vim"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment