Created
September 12, 2010 15:46
-
-
Save fnichol/576195 to your computer and use it in GitHub Desktop.
MacVIM installer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# ## Installing MacVim on Mac OS X 10.5/10.6 | |
# | |
# bash < <(curl -L http://gist.github.com/raw/576195/macvim_install.sh) | |
# | |
case $(sw_vers -productVersion) in | |
10.5.*) | |
url="http://github.com/downloads/b4winckler/macvim/MacVim-7_3-53-ppc-i386-OSX10_5.tbz" | |
;; | |
10.6.*) | |
url="http://github.com/downloads/b4winckler/macvim/MacVim-7_3-53.tbz" | |
;; | |
*) | |
printf ">>> Not a supported version of Mac OS X so quitting.\n" | |
exit 1 | |
;; | |
esac | |
tar="${url##http*/}" | |
download_dir="/tmp/macvim-$$" | |
printf "===> Attempting sudo for mvim installation ...\n" | |
sudo echo "Done." | |
printf "===> Downloading $tar to $download_dir ...\n" | |
mkdir -p "$download_dir" | |
curl -L "$url" -o "${download_dir}/${tar}" | |
printf "===> Installing /Applications/MacVim.app ...\n" | |
tar xpfj "${download_dir}/${tar}" -C /Applications \ | |
--strip-components=1 */MacVim.app | |
printf "===> Installing /usr/local/bin/mvim wrapper ...\n" | |
sudo mkdir -p /usr/local/bin | |
sudo tar xfj "${download_dir}/${tar}" -C /usr/local/bin \ | |
--strip-components=1 */mvim | |
sudo chmod 755 /usr/local/bin/mvim | |
for sym in mvimdiff mview mex rmvim ; do | |
printf "===> Installing /usr/local/bin/$sym symlink ...\n" | |
(builtin cd /usr/local/bin && sudo ln -snf ./mvim "$sym") | |
done | |
printf "===> Cleaning up $download_dir ...\n" | |
rm -rf "$download_dir" | |
printf "===> MacVim installation complete. w00t.\n\n\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment