Skip to content

Commit

Permalink
Add initial bash options
Browse files Browse the repository at this point in the history
  • Loading branch information
briancain committed Nov 18, 2014
1 parent 8758b5c commit e3bf7c6
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 7 deletions.
49 changes: 49 additions & 0 deletions bashrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace

# append to the history file, don't overwrite it
shopt -s histappend

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

case "$TERM" in
xterm-color) color_prompt=yes;;
esac

# User specific aliases and functions

alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'

alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi

# User prompt
export PS1="\u@\h:\W\\ $ "
22 changes: 15 additions & 7 deletions install.bash
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ function os_type() {
}
}

function setup_bash() {
echo 'setup bash'
}
# function setup_bash() {
# # TODO: Bash customization
# }

function setup_zsh() {
echo 'Adding oh-my-zsh to dotfiles...'
Expand Down Expand Up @@ -66,8 +66,13 @@ function setup_git() {

function symlink_files() {
ln -s ~/.dotfiles/vimrc ~/.vimrc
ln -s ~/.dotfiles/zshrc ~/.zshrc
ln -s ~/.dotfiles/oh-my-zsh ~/.oh-my-zsh

if [[ $LOGIN_SHELL == 'bash' ]] ; then
ln -s ~/.dotfiles/bashrc ~/.bashrc
elif [[ $LOGIN_SHELL == 'zsh' ]] ; then
ln -s ~/.dotfiles/zshrc ~/.zshrc
ln -s ~/.dotfiles/oh-my-zsh ~/.oh-my-zsh
fi
}

set -e
Expand All @@ -78,7 +83,7 @@ set -e

determine_shell
if [[ $LOGIN_SHELL == 'bash' ]] ; then
setup_bash
# setup_bash
packages=(${packages[@]} 'bash')
elif [[ $LOGIN_SHELL == 'zsh' ]] ; then
setup_zsh
Expand Down Expand Up @@ -112,7 +117,10 @@ set -e
setup_vim

if [[ $LOGIN_SHELL == 'bash' ]] ; then
echo 'bash'
echo "Operating System setup complete."
echo "Reloading session"

source ~/.bashrc
elif [[ $LOGIN_SHELL == 'zsh' ]] ; then
echo "Changing shells to ZSH"
chsh -s /bin/zsh
Expand Down

0 comments on commit e3bf7c6

Please sign in to comment.