revamped install script, broke shell settings out into shell agnostic file
This commit is contained in:
parent
0fd9255f4c
commit
e71296fa60
1
.autoenv
Submodule
1
.autoenv
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 14d1951a827caac026cb7a082c23899b2d835148
|
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
[submodule ".autoenv"]
|
||||
path = .autoenv
|
||||
url = git://github.com/kennethreitz/autoenv.git
|
34
.shell_settings
Normal file
34
.shell_settings
Normal 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* }
|
1
.tmux-powerline/.tmux-powerline
Symbolic link
1
.tmux-powerline/.tmux-powerline
Symbolic link
@ -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
35
.zshrc
@ -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
|
74
install.sh
74
install.sh
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user