diff --git a/bashrc b/bashrc index 191cad0..690fa96 100755 --- a/bashrc +++ b/bashrc @@ -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 # fi -export PATH="$HOME/Source/bash:$PATH" -export EDITOR=vim +if [ `uname` == "Darwin" ]; +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_SHOWSTASHSTATE=true @@ -66,58 +82,72 @@ export PS2="$D_WHITE> $RESET" # Aliases # apt-* -alias ac="sudo apt-cache" -alias acs="sudo apt-cache search" -alias ag="sudo apt-get" -alias agar="sudo apt-get autoremove" -alias agi="sudo apt-get install" -alias agp="sudo apt-get purge" -alias agr="sudo apt-get remove" -alias agud="sudo apt-get update" -alias agug="sudo apt-get upgrade" -alias aguu="sudo apt-get update && sudo apt-get upgrade" +alias ac="sudo apt-cache" +alias acs="sudo apt-cache search" +alias ag="sudo apt-get" +alias agar="sudo apt-get autoremove" +alias agi="sudo apt-get install" +alias agp="sudo apt-get purge" +alias agr="sudo apt-get remove" +alias agud="sudo apt-get update" +alias agug="sudo apt-get upgrade" +alias aguu="sudo apt-get update && sudo apt-get upgrade" + # cd * alias desktop="cd ~/Desktop" + # free -alias fm="free -m" +alias fm="free -m" + # git -alias ga="git add" -alias gaa="git add ." -alias gb="git branch" -alias gba="git branch -a" -alias gc="git commit" -alias gca="git commit -a" -alias gcl="git clone" -alias gco="git checkout" -alias gcob="git checkout -B" -alias gcom="git checkout master" -alias gd="git diff" -alias gdb="git delete-branch" -alias gf="git fetch" -alias gl="git log" -alias gm="git merge" -alias gmm="git merge master" -alias gp="git push" -alias gpoh="git push origin HEAD" -alias gpom="git push origin master" -alias gpu="git pull" -alias gpuoh="git pull origin HEAD" -alias gpuom="git pull origin master" -alias gr="git remote" -alias gra="git remote add" -alias grao="git remote add origin" -alias grr="git remote rm" -alias grro="git remote rm origin" -alias grm="git rm" -alias gs="git status" +alias ga="git add" +alias gaa="git add ." +alias gb="git branch" +alias gba="git branch -a" +alias gc="git commit" +alias gca="git commit -a" +alias gcl="git clone" +alias gco="git checkout" +alias gcob="git checkout -B" +alias gcom="git checkout master" +alias gd="git diff" +alias gdb="git delete-branch" +alias gf="git fetch" +alias gl="git log" +alias gm="git merge" +alias gmm="git merge master" +alias gp="git push" +alias gpoh="git push origin HEAD" +alias gpom="git push origin master" +alias gpu="git pull" +alias gpuoh="git pull origin HEAD" +alias gpuom="git pull origin master" +alias gr="git remote" +alias gra="git remote add" +alias grao="git remote add origin" +alias grr="git remote rm" +alias grro="git remote rm origin" +alias grm="git rm" +alias gs="git status" + # memcached -alias mc="telnet localhost 11211" +alias mc="telnet localhost 11211" + # mysql -alias mycs="mysql crowdsavings" -alias mysk="mysql scenekids" +alias mycs="mysql crowdsavings" +alias mysk="mysql scenekids" + # service alias service="sudo service" + # vim -alias v="vim" -alias vd="vimdiff" -alias vo="vim -O" +if [ `uname` == "Darwin" ]; +then + 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 diff --git a/gitconfig b/git/gitconfig similarity index 87% rename from gitconfig rename to git/gitconfig index 6823b66..7c1e801 100644 --- a/gitconfig +++ b/git/gitconfig @@ -9,7 +9,7 @@ color = true [core] - editor = vi + editor = /usr/bin/vim [color] branch = auto diff --git a/git/git-delete-branch b/git/scripts/git-delete-branch similarity index 100% rename from git/git-delete-branch rename to git/scripts/git-delete-branch diff --git a/git/git-github-init b/git/scripts/git-github-init similarity index 100% rename from git/git-github-init rename to git/scripts/git-github-init diff --git a/osx-setup.sh b/osx-setup.sh new file mode 100755 index 0000000..a640cf7 --- /dev/null +++ b/osx-setup.sh @@ -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 diff --git a/setup.sh b/ubuntu-setup.sh similarity index 76% rename from setup.sh rename to ubuntu-setup.sh index 1c1a70e..026f5fc 100755 --- a/setup.sh +++ b/ubuntu-setup.sh @@ -62,38 +62,7 @@ fi # Symlinks back to our scripts ln -s $PWD/nautilus-scripts ~/.gnome2/nautilus-scripts -# 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 +./vim-setup.sh 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/" diff --git a/vim/vim-setup.sh b/vim/vim-setup.sh new file mode 100755 index 0000000..37f4558 --- /dev/null +++ b/vim/vim-setup.sh @@ -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 diff --git a/vimrc b/vim/vimrc similarity index 100% rename from vimrc rename to vim/vimrc