diff options
-rw-r--r-- | README | 20 | ||||
-rw-r--r-- | bash/bash_profile | 12 | ||||
-rw-r--r-- | bash/bashrc | 42 | ||||
-rw-r--r-- | install.sh | 19 |
4 files changed, 78 insertions, 15 deletions
@@ -1,21 +1,11 @@ Personal repository of independent dotfiles. This is for all my personal configuration files that migrate well from machine -to machine. Note the presence of submodules, which means after checking out I -need to do something like: +to machine. -git submodule update --init +Then it's a matter of loading git submodules, deleting stock files and +symlinking everything in, which can be done with the included "dotfiles" +script: -Then it's a matter of symlinking everything in: - -rm -fr .vim -rm -fr .vimrc -rm -fr .gvimrc -rm -fr .gitconfig -rm -fr .tmux.conf -ln -s .dotfiles/vim .vim -ln -s .dotfiles/vim/vimrc .vimrc -ln -s .dotfiles/vim/gvimrc .gvimrc -ln -s .dotfiles/git/gitconfig .gitconfig -ln -s .dotfiles/tmux/tmux.conf .tmux.conf +$ bash .dotfiles/install.sh diff --git a/bash/bash_profile b/bash/bash_profile new file mode 100644 index 00000000..bae38cfa --- /dev/null +++ b/bash/bash_profile @@ -0,0 +1,12 @@ +# If running Bash, source .bashrc. +if [ -n "$BASH_VERSION" ]; then + if [ -f "$HOME/.bashrc" ]; then + . "$HOME/.bashrc" + fi +fi + +# Add ~/bin to the path if it exists. +if [ -d "$HOME/bin" ]; then + PATH="$HOME/bin:$PATH" +fi + diff --git a/bash/bashrc b/bash/bashrc new file mode 100644 index 00000000..dc60e9d3 --- /dev/null +++ b/bash/bashrc @@ -0,0 +1,42 @@ +# Don't do anything if not running interactively. +[ -z "$PS1" ] && return + +# Don't put duplicate lines in history, and keep plenty of it. +HISTCONTROL=ignoreboth +HISTSIZE=5000 + +# Append rather than overwrite Bash history. +shopt -s histappend + +# Update columns and rows if window size changes. +shopt -s checkwinsize + +# Simple prompt. +PS1='\u@\h:\w\$ ' + +# Use colors for ls and grep, if available. +if [ -x /usr/bin/dircolors ]; then + eval "$(dircolors -b)" + alias ls='ls --color=auto' + alias grep='grep --color=auto' +fi + +# Use completion, if available. +if [ -f /etc/bash_completion ]; then + . /etc/bash_completion +fi + +# SSH agent setup, if available. +if [ -e ~/.bash_sshagent ]; then + . ~/.bash_sshagent +fi + +# Turn off annoying and useless flow control keys. +stty -ixon + +# Use vim as my text editor, if available. +hash vim &>/dev/null +if [ $? -eq 0 ]; then + export EDITOR=vim +fi + diff --git a/install.sh b/install.sh new file mode 100644 index 00000000..72edeef9 --- /dev/null +++ b/install.sh @@ -0,0 +1,19 @@ +#!/bin/bash +cd $HOME/.dotfiles +git submodule update --init +cd $HOME +rm -f .bashrc +rm -f .bash_profile .bash_login .profile +rm -f .gitconfig +rm -f .tmux.conf +rm -f .vimrc +rm -f .gvimrc +rm -fr .vim +ln -s .dotfiles/bash/bashrc .bashrc +ln -s .dotfiles/bash/bash_profile .bash_profile +ln -s .dotfiles/git/gitconfig .gitconfig +ln -s .dotfiles/tmux/tmux.conf .tmux.conf +ln -s .dotfiles/vim/vimrc .vimrc +ln -s .dotfiles/vim/gvimrc .gvimrc +ln -s .dotfiles/vim .vim + |