revamped install script, broke shell settings out into shell agnostic file

This commit is contained in:
Tony Grosinger 2013-03-21 20:56:52 -07:00
parent 0fd9255f4c
commit e71296fa60
10 changed files with 78 additions and 1189 deletions

1
.autoenv Submodule

@ -0,0 +1 @@
Subproject commit 14d1951a827caac026cb7a082c23899b2d835148

1
.bashrc Normal file
View File

@ -0,0 +1 @@
source ~/.shell_settings

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule ".autoenv"]
path = .autoenv
url = git://github.com/kennethreitz/autoenv.git

34
.shell_settings Normal file
View File

@ -0,0 +1,34 @@
# Navigation
alias c="clear & ls"
alias ..="cd .."
alias ls="ls --color=auto"
alias la="ls -lha"
# Applications
alias tmux="tmux -2"
# Computer information & control
alias df="df -h"
alias reboot="echo That would be bad..."
alias shutdown="echo Don't do that"
# Git
alias gp="git pull"
alias ga="git add "
alias gl="git log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short"
alias gc="git commit -m "
alias gs="git status"
alias gpp="git push"
# Autoenv
if [ -d ~/.autoenv ];
then
source ~/.autoenv/activate.sh
fi
# Functions
# (f)ind by (n)ame
# usage: fn foo
# to find all files containing 'foo' in the name
function fn() { ls **/*$1* }

View File

@ -0,0 +1 @@
/home/tony/Documents/personal/dotfiles/.tmux-powerline

@ -1 +0,0 @@
Subproject commit be5842a376f16c16c5dc4cc1879d7168a074f7de

File diff suppressed because it is too large Load Diff

35
.zshrc
View File

@ -27,37 +27,4 @@ precmd () {
PROMPT="$PS1"`[ -n "$TMUX" ] && tmux setenv TMUXPWD_$(tmux display -p "#I_#P") "$PWD"`
}
# Navigation
alias -r c="clear & ls -lha"
alias -r ..="cd .."
alias ls="ls --color=auto"
alias la="ls -lha"
alias clear="clear & ls"
# Applications
alias tmux="tmux -2"
# Computer control
alias -r reboot="echo That would be bad..."
alias -r shutdown="echo Don't do that"
# Git
alias gp="git pull"
alias ga="git add "
alias gl="git log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short"
alias gc="git commit -m "
alias gs="git status"
alias gpp="git push"
# Autoenv
if [ -d ~/.autoenv ];
then
source ~/.autoenv/activate.sh
fi
# Functions
# (f)ind by (n)ame
# usage: fn foo
# to find all files containing 'foo' in the name
function fn() { ls **/*$1* }
source ~/.shell_settings

View File

View File

@ -1,59 +1,59 @@
#!/bin/bash
DIR="$( cd "$( dirname "$0" )" && pwd )"
# Initialize any submodules
git submodule init
git submodule update
echo "This will create symlinks and destroy any conflicting configs already in place.";
read -p "Continue? [y/N] " choice
# Helper function to remove old file and link the new one
DIR="$( cd "$( dirname "$0" )" && pwd )"
function linkFile() {
if [ -f $1 ]; then
rm $1;
elif [ -d $1 ]; then
rm -rf $1
fi
ln -s $DIR/$1 $1;
}
function createDirectory() {
if [ -d $1 ]; then
rm -rf $1
fi
mkdir $1
}
# Perform the logic
case "$choice" in
Y|y|yes )
echo "Moving to Home directory...";
cd ~;
echo "Linking zsh...";
if [ -f .zshrc ];
then
rm .zshrc;
fi
ln -s $DIR/.zshrc .zshrc;
echo "Linking shell configs...";
linkFile .zshrc
linkFile .bashrc
linkFile .shell_settings
echo "Linking vim...";
if [ -f .vimrc ];
then
rm .vimrc;
fi
ln -s $DIR/.vimrc .vimrc;
if [ -d .vim ];
then
rm -rf .vim;
fi
ln -s $DIR/.vim .vim;
mkdir ~/.vim/swaps
mkdir ~/.vim/backups
linkFile .vimrc
createDirectory ~/.vim
createDirectory ~/.vim/swaps
createDirectory ~/.vim/backups
echo "Linking Git...";
if [ -f .gitconfig ];
then
rm .gitconfig;
fi
ln -s $DIR/.gitconfig .gitconfig;
linkFile .gitconfig
echo "Linking tmux...";
if [ -f .tmux.conf ];
then
rm .tmux.conf;
fi
ln -s $DIR/.tmux.conf .tmux.conf;
if [ -d .tmux-powerline ];
then
rm -rf .tmux-powerline;
fi
ln -s $DIR/.tmux-powerline .tmux-powerline;
linkFile .tmux.conf
linkFile .tmux-powerline
echo "Hotswapping zshrc...";
source .zshrc;
echo "Linking autoenv..."
linkFile .autoenv
echo "Done! Exiting."
echo "Done! Restart your shell to see changes"
;;
* ) echo "Aborted!";;
esac