Migrating stuff over to OSX

This commit is contained in:
Josh Sherman 2012-06-23 12:19:11 -04:00
parent 311629e01f
commit f147852215
8 changed files with 148 additions and 83 deletions

130
bashrc
View file

@ -1,11 +1,27 @@
# To use, simply add the following to /etc/bash.bashrc or ~/.bashrc # To use, simply add the following to:
# /etc/bash.bashrc or ~/.bashrc (Linux)
# ~/.bash_profile (Mac OS X)
# #
# if [ -f /path/to/this/bash.bashrc ] && ! shopt -oq posix; then # if [ -f /path/to/this/bash.bashrc ] && ! shopt -oq posix;
# then
# . /path/to/this/bash.bashrc # . /path/to/this/bash.bashrc
# fi # fi
export PATH="$HOME/Source/bash:$PATH" if [ `uname` == "Darwin" ];
export EDITOR=vim then
# Tell ls to be colourful
export CLICOLOR=1
export LSCOLORS=Exfxcxdxbxegedabagacad
# Tell grep to highlight matches
export GREP_OPTIONS='--color=auto'
export PATH=/usr/local/bin:/usr/local/sbin:$PATH
export EDITOR="mvim -v"
else
export PATH="$HOME/Source/bash:$PATH"
export EDITOR=vim
fi
export GIT_PS1_SHOWDIRTYSTATE=true export GIT_PS1_SHOWDIRTYSTATE=true
export GIT_PS1_SHOWSTASHSTATE=true export GIT_PS1_SHOWSTASHSTATE=true
@ -66,58 +82,72 @@ export PS2="$D_WHITE> $RESET"
# Aliases # Aliases
# apt-* # apt-*
alias ac="sudo apt-cache" alias ac="sudo apt-cache"
alias acs="sudo apt-cache search" alias acs="sudo apt-cache search"
alias ag="sudo apt-get" alias ag="sudo apt-get"
alias agar="sudo apt-get autoremove" alias agar="sudo apt-get autoremove"
alias agi="sudo apt-get install" alias agi="sudo apt-get install"
alias agp="sudo apt-get purge" alias agp="sudo apt-get purge"
alias agr="sudo apt-get remove" alias agr="sudo apt-get remove"
alias agud="sudo apt-get update" alias agud="sudo apt-get update"
alias agug="sudo apt-get upgrade" alias agug="sudo apt-get upgrade"
alias aguu="sudo apt-get update && sudo apt-get upgrade" alias aguu="sudo apt-get update && sudo apt-get upgrade"
# cd * # cd *
alias desktop="cd ~/Desktop" alias desktop="cd ~/Desktop"
# free # free
alias fm="free -m" alias fm="free -m"
# git # git
alias ga="git add" alias ga="git add"
alias gaa="git add ." alias gaa="git add ."
alias gb="git branch" alias gb="git branch"
alias gba="git branch -a" alias gba="git branch -a"
alias gc="git commit" alias gc="git commit"
alias gca="git commit -a" alias gca="git commit -a"
alias gcl="git clone" alias gcl="git clone"
alias gco="git checkout" alias gco="git checkout"
alias gcob="git checkout -B" alias gcob="git checkout -B"
alias gcom="git checkout master" alias gcom="git checkout master"
alias gd="git diff" alias gd="git diff"
alias gdb="git delete-branch" alias gdb="git delete-branch"
alias gf="git fetch" alias gf="git fetch"
alias gl="git log" alias gl="git log"
alias gm="git merge" alias gm="git merge"
alias gmm="git merge master" alias gmm="git merge master"
alias gp="git push" alias gp="git push"
alias gpoh="git push origin HEAD" alias gpoh="git push origin HEAD"
alias gpom="git push origin master" alias gpom="git push origin master"
alias gpu="git pull" alias gpu="git pull"
alias gpuoh="git pull origin HEAD" alias gpuoh="git pull origin HEAD"
alias gpuom="git pull origin master" alias gpuom="git pull origin master"
alias gr="git remote" alias gr="git remote"
alias gra="git remote add" alias gra="git remote add"
alias grao="git remote add origin" alias grao="git remote add origin"
alias grr="git remote rm" alias grr="git remote rm"
alias grro="git remote rm origin" alias grro="git remote rm origin"
alias grm="git rm" alias grm="git rm"
alias gs="git status" alias gs="git status"
# memcached # memcached
alias mc="telnet localhost 11211" alias mc="telnet localhost 11211"
# mysql # mysql
alias mycs="mysql crowdsavings" alias mycs="mysql crowdsavings"
alias mysk="mysql scenekids" alias mysk="mysql scenekids"
# service # service
alias service="sudo service" alias service="sudo service"
# vim # vim
alias v="vim" if [ `uname` == "Darwin" ];
alias vd="vimdiff" then
alias vo="vim -O" alias v='mvim -v'
alias vd="mvimdiff -v"
alias vo="mvim -v -O"
else
alias v="vim"
alias vd="vimdiff"
alias vo="vim -O"
fi

View file

@ -9,7 +9,7 @@
color = true color = true
[core] [core]
editor = vi editor = /usr/bin/vim
[color] [color]
branch = auto branch = auto

30
osx-setup.sh Executable file
View file

@ -0,0 +1,30 @@
#!/bin/bash
# TODO Installs Homebew
brew install git ssh-copy-id bash-completion macvim multitail nmap tmux wget
# TODO Installs Server stuff (nginx, php53, pear, redis, memcached, what have you)
# Clears out the old .bash_profile
if [ -f ~/.bash_profile ];
then
rm ~/.bash_profile
fi
PWD=`pwd`
# Adds paths and custom .bashrc
echo "
export PATH=\"$PWD/git:$PATH\"
if [ -f $PWD/bashrc ] && ! shopt -oq posix;
then
. $PWD/bashrc
fi
if [ -f `brew --prefix`/etc/bash_completion ];
then
. `brew --prefix`/etc/bash_completion
fi
" >> ~/.bash_profile
#./vim-setup.sh

View file

@ -62,38 +62,7 @@ fi
# Symlinks back to our scripts # Symlinks back to our scripts
ln -s $PWD/nautilus-scripts ~/.gnome2/nautilus-scripts ln -s $PWD/nautilus-scripts ~/.gnome2/nautilus-scripts
# Copies .vimrc ./vim-setup.sh
if [ -f ~/.vimrc ];
then
rm ~/.vimrc
fi
cp $PWD/vimrc ~/.vimrc
# Pulls down and installs vim plugins
DOTVIM=~/.vim
if [ -d $DOTVIM ];
then
rm -r $DOTVIM
fi
mkdir $DOTVIM
OWNERS=( "ervandew" "msanders" "nvie" "scrooloose" "scrooloose" "tpope" "vim-scripts" )
REPOS=( "supertab" "snipmate.vim" "vim-togglemouse" "nerdtree" "syntastic" "vim-fugitive" "Command-T" )
for (( i = 0 ; i < ${#OWNERS[@]} ; i++ ))
do
git clone git://github.com/${OWNERS[$i]}/${REPOS[$i]}.git /tmp/${REPOS[$i]}
cp -R /tmp/${REPOS[$i]}/* $DOTVIM
rm -rf /tmp/${REPOS[$i]}
done
# Finish up Command-T installation
cd $DOTVIM/ruby/command-t
ruby extconf.rb
make
echo; echo "SETUP COMPLETE!!~!" echo; echo "SETUP COMPLETE!!~!"
echo; echo "For further enhancement, do this: http://www.omgubuntu.co.uk/2011/10/use-adwaita-dark-as-your-system-theme/" echo; echo "For further enhancement, do this: http://www.omgubuntu.co.uk/2011/10/use-adwaita-dark-as-your-system-theme/"

36
vim/vim-setup.sh Executable file
View file

@ -0,0 +1,36 @@
#!/bin/bash
PWD=`pwd`
# Copies .vimrc
if [ -f ~/.vimrc ];
then
rm ~/.vimrc
fi
cp $PWD/vimrc ~/.vimrc
# Pulls down and installs vim plugins
DOTVIM=~/.vim
if [ -d $DOTVIM ];
then
rm -r $DOTVIM
fi
mkdir $DOTVIM
OWNERS=( "ervandew" "msanders" "nvie" "scrooloose" "scrooloose" "tpope" "vim-scripts" )
REPOS=( "supertab" "snipmate.vim" "vim-togglemouse" "nerdtree" "syntastic" "vim-fugitive" "Command-T" )
for (( i = 0 ; i < ${#OWNERS[@]} ; i++ ))
do
git clone git://github.com/${OWNERS[$i]}/${REPOS[$i]}.git /tmp/${REPOS[$i]}
cp -R /tmp/${REPOS[$i]}/* $DOTVIM
rm -rf /tmp/${REPOS[$i]}
done
# Finish up Command-T installation
cd $DOTVIM/ruby/command-t
ruby extconf.rb
make

View file