From 13ab7d3f1746ffc2ee251581967f461229b3f60e Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Mon, 25 Aug 2014 20:06:54 -0700 Subject: [PATCH] Proper macvim setup. --- dotfiles/lib/shellrc/aliases.sh | 4 +++- dotfiles/lib/shellrc/brew.sh | 4 +--- resources/apt-get.sh | 7 ------ setup.sh | 41 +++++++++++++++++++++++++++++---- 4 files changed, 41 insertions(+), 15 deletions(-) delete mode 100644 resources/apt-get.sh diff --git a/dotfiles/lib/shellrc/aliases.sh b/dotfiles/lib/shellrc/aliases.sh index 8b02299d..dd2f8c0d 100644 --- a/dotfiles/lib/shellrc/aliases.sh +++ b/dotfiles/lib/shellrc/aliases.sh @@ -1,7 +1,7 @@ alias emacs="emacsclient -t" alias xemacs="\emacs --daemon > /dev/null 2&> /dev/null; emacsclient -c &" alias tmux="tmux -2" -reload_tmux_conf="tmux source-file .tmux.conf" +alias reload_tmux_conf="tmux source-file .tmux.conf" alias tmux_cb_to_remote_cb='tmux saveb - | linux_nc_paste_to_remote_clipboard' alias timestamp='date +%s' alias fn='find . -name ' @@ -47,3 +47,5 @@ done alias stfu="osascript -e 'set volume output muted true'" alias pumpitup="osascript -e 'set volume 7'" alias pip-upgrade="pip freeze --local | get_cols -F "=" 1 | xargs -n1 sudo pip install -U" + +[[ -e /usr/local/Cellar/macvim ]] && alias vim="$(find /usr/local/Cellar/macvim -depth 1 | grep "[0-9]$")/MacVim.app/Contents/MacOS/Vim" diff --git a/dotfiles/lib/shellrc/brew.sh b/dotfiles/lib/shellrc/brew.sh index fe153be2..6bb235cb 100755 --- a/dotfiles/lib/shellrc/brew.sh +++ b/dotfiles/lib/shellrc/brew.sh @@ -25,9 +25,9 @@ function do_the_brew() { "python --with-brewed-openssl" \ "htop" \ "greadlink" \ - "vim --override-system-vi" \ "zsh" \ "make" \ + "macvim --override-system-vim --custom-system-icons --with-features=huge --enable-rubyinterp --enable-pythoninterp --enable-perlinterp --enable-cscope" \ ) # `find`, `locate`, `updatedb`, and `xargs`, g-prefixed # core utilities (those that come with OS X are outdated) @@ -75,12 +75,10 @@ function do_the_brew() { "rsync" \ "svn" \ "unzip" \ - "macvim --override-system-vim --custom-system-icons" \ ) install_items=() OPTIND=1 - echo "${MISC[@]}" while getopts "uebsmah" OPTCHAR; do case $OPTCHAR in diff --git a/resources/apt-get.sh b/resources/apt-get.sh deleted file mode 100644 index 1b6a1734..00000000 --- a/resources/apt-get.sh +++ /dev/null @@ -1,7 +0,0 @@ -INSTALL="sudo apt-get -y install" -$INSTALL zsh -$INSTALL tmux -$INSTALL emacs24-nox -$INSTALL nmap -$INSTALL python2.7 -$INSTALL python-pip python-dev \ No newline at end of file diff --git a/setup.sh b/setup.sh index 808f3998..a0a37933 100755 --- a/setup.sh +++ b/setup.sh @@ -7,6 +7,16 @@ DOTFILES_DIRECTORY="$(dotfiles_abspath)/dotfiles" function symlink_dotfiles() { + local overwrite='' + OPTIND=1 + while getopts "o" OPTCHAR; + do + case $OPTCHAR in + o) + overwrite='yes' + ;; + esac + done cd $DOTFILES_DIRECTORY [ -a ~/.dotfiles-backups ] && mv ~/.dotfiles-backups ~/.dotfiles-backups.old mkdir ~/.dotfiles-backups @@ -16,21 +26,30 @@ function symlink_dotfiles() { echo "linking $link_destination to $link_target" # Using only test -e doesn't work here because it will return # false if the destination of the symbolic link at does not exist. - test -e $link_destination || test -L $link_destination && mv $link_destination ~/.dotfiles-backups - ln -si $link_target $link_destination + test -e $link_destination || test -L $link_destination && test $overwrite && mv $link_destination ~/.dotfiles-backups && ln -si $link_target $link_destination done [ -a ~/.dotfiles-backups.old ] && mv ~/.dotfiles-backups.old ~/.dotfiles-backups/.dotfiles-backups } function symlink_dotfiles_prompt() { - read -p "Symlinking files from $DOTFILES_DIRECTORY. This may overwrite existing files in your home directory. Do you wish to proceed? (y/n) " -n 1 + read -p "Symlinking files from $DOTFILES_DIRECTORY. This ? (y/n) " -n 1 if [[ $REPLY =~ ^[Yy]$ ]]; then echo symlink_dotfiles fi } +function apt-get() { + INSTALL="sudo apt-get -y install" + $INSTALL zsh + $INSTALL tmux + $INSTALL emacs24-nox + $INSTALL nmap + $INSTALL python2.7 + $INSTALL python-pip python-dev +} + function setup_help() { echo "setup Usage: -a Install apt-get packages. @@ -38,6 +57,7 @@ function setup_help() { -s Symlink dotfiles to home directory. -b Install brew packages. -p Install python packages. +-e Do absolutely everything with the most aggresive options. -h display this help message." } @@ -46,7 +66,7 @@ function setup() { setup_help exit 0 fi - while getopts "aosbp" OPTCHAR; + while getopts "aosbpe" OPTCHAR; do case $OPTCHAR in a) @@ -74,6 +94,19 @@ function setup() { fi install_python_packages $REPLY ;; + e) + case uname in + Darwin) + do_the_brew -au + ;; + Linux) + apt-get + ;; + esac + install_python_packages -a + symlink_dotfiles + source resources/osx.sh + ;; h) setup_help return