commit bc0433eb531224d2168b63d345ec9756ffcbc618
parent 88d3c55cd2f054ec61529137e2860e9ffdd0baf7
Author: Ed van Bruggen <edvb54@gmail.com>
Date: Thu, 31 Jul 2014 19:37:46 -0700
Bash: Chnage around bashrc and bash_profile contents
- Move contents from bash_profile and put in bashrc
- Add PATH options to bash_profile
- Remove colors.sh file and move needed colors to bashrc
Diffstat:
23 files changed, 131 insertions(+), 242 deletions(-)
diff --git a/bash_profile b/bash_profile
@@ -1,82 +1,21 @@
-# prompt statement{{{1
-random_happy_face() {
- local faces=(":)" ":D" ":)" ":D" ":)" ":D" ":)")
- local l=${#faces[*]}
- local sym=${faces[$(($RANDOM % $l))]}
- echo $sym
-}
-
-random_sad_face() {
- local faces=(":P" ":(" ":(" ":O" ":\\" ":|" ":(" ":(")
- local l=${#faces[*]}
- local sym=${faces[$(($RANDOM % $l))]}
- echo $sym
-}
-
-cmd_check() {
- if [[ $? = 0 ]]; then
- echo "${Green}$(random_happy_face)";
- else
- echo "${Red}$(random_sad_face)";
- fi;
-}
-
-PS1='\
-${Blue}\u\
- $(cmd_check) \
-$(__git_ps1 "${Cyan}%s ")${White}\
-\$${Color_Off} \
-'
-
-# PS1="\
-# ${Cyan}┌─${Cyan}\
-# (${BIBlue}\u${Cyan})─\
-# (${BIBlue}\h${Cyan})─\
-# (${BIBlue}\j${Cyan})
-# ${Cyan}└─\
-# ${Cyan}($(cmd_check)${Cyan})\
-# ${Cyan}❯${Color_Off}❯ \
-# "
-
-# PS1="${Blue}\u@\h${Color_Off}:${Cyan}\w${IBlue}❯${Color_Off}❯ "
-# PS1='C:${PWD////\\\\}>'
-
-PS2="\$"
-
-# basic{{{1
-export EDITOR='vim'
-# export EDITOR='emacs'
-
-if [ "$TERM" == "xterm" ]; then
- export TERM=xterm-256color
+# if running bash
+if [ -n "$BASH_VERSION" ]; then
+ # include .bashrc if found
+ if [ -f "$HOME/.bashrc" ]; then
+ . "$HOME/.bashrc"
+ fi
fi
-# fortune | cowsay
-
-# alias stuff{{{1
-bind '"\t":menu-complete'
-alias sb='source ~/.bashrc'
-alias r='reset'
-alias ..='cd ..'
-alias ...='cd ../..'
-alias ....='cd ../../..'
-
-alias mv='mv -i'
-alias cp='cp -i'
-alias ln='ln -i'
-alias rm='rm -i'
-
-alias vrc='$EDITOR ~/dotfiles/vimrc'
-alias vrcb='$EDITOR ~/dotfiles/vimrc.bundles'
-alias brc='$EDITOR ~/dotfiles/bashrc'
-alias bp='$EDITOR ~/dotfiles/bash_profile'
-alias tconf='$EDITOR ~/dotfiles/tmux.conf'
-
-alias v='xmodmap ~/.vim-keys.xmodmap'
-alias emacs='emacs -nw'
-alias vless='vim -u /usr/share/vim/vim74/macros/less.vim'
+# add sbin to PATH
+if [ -d "/sbin" ] ; then
+ PATH="/sbin:$PATH"
+fi
+if [ -d "/usr/sbin" ] ; then
+ PATH="/usr/sbin:$PATH"
+fi
-ipls () {
- ifconfig | grep 'inet addr:' | awk {'print $2'}
-}
+# add user's bin to PATH
+if [ -d "$HOME/bin" ] ; then
+ PATH="$HOME/bin:$PATH"
+fi
diff --git a/bashrc b/bashrc
@@ -19,101 +19,123 @@ HISTFILESIZE=2000
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
-# If set, the pattern "**" used in a pathname expansion context will
-# match all files and zero or more directories and subdirectories.
-#shopt -s globstar
-
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
-# set variable identifying the chroot you work in (used in the prompt below)
-if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
- debian_chroot=$(cat /etc/debian_chroot)
+# enable programmable completion features (you don't need to enable
+# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
+# sources /etc/bash.bashrc).
+if ! shopt -oq posix; then
+ if [ -f /usr/share/bash-completion/bash_completion ]; then
+ . /usr/share/bash-completion/bash_completion
+ elif [ -f /etc/bash_completion ]; then
+ . /etc/bash_completion
+ fi
fi
+#}}}
+# colors{{{
+Color_Off=$'\033[m'
+Red=$'\033[0;31m'
+Green=$'\033[0;32m'
+Blue=$'\033[0;34m'
+Cyan=$'\033[0;36m'
+White=$'\033[0;37m'
+#}}}
+# prompt statement{{{1
+random_happy_face() {
+ local faces=(":)" ":D" ":)" ":D" ":)" ":D" ":)")
+ local l=${#faces[*]}
+ local sym=${faces[$(($RANDOM % $l))]}
+ echo $sym
+}
+
+random_sad_face() {
+ local faces=(":P" ":(" ":(" ":O" ":\\" ":|" ":(" ":(")
+ local l=${#faces[*]}
+ local sym=${faces[$(($RANDOM % $l))]}
+ echo $sym
+}
+
+cmd_check() {
+ if [[ $? = 0 ]]; then
+ echo "${Green}$(random_happy_face)";
+ else
+ echo "${Red}$(random_sad_face)";
+ fi;
+}
-# set a fancy prompt (non-color, unless we know we "want" color)
-case "$TERM" in
- xterm-color) color_prompt=yes;;
-esac
+PS1='\
+${Blue}\u\
+ $(cmd_check) \
+$(__git_ps1 "${Cyan}%s ")${White}\
+\$${Color_Off} \
+'
-# uncomment for a colored prompt, if the terminal has the capability; turned
-# off by default to not distract the user: the focus in a terminal window
-# should be on the output of commands, not on the prompt
-force_color_prompt=yes
-
-if [ -n "$force_color_prompt" ]; then
- if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
- # We have color support; assume it's compliant with Ecma-48
- # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
- # a case would tend to support setf rather than setaf.)
- color_prompt=yes
- else
- color_prompt=
- fi
+# PS1="${Blue}\u@\h${Color_Off}:${Cyan}\w${White}❯❯${Color_Off} "
+# PS1='C:${PWD////\\\\}>'
+
+PS2="\$"
+
+# basic{{{1
+export EDITOR='vim'
+# export EDITOR='emacs'
+
+if [ "$TERM" == "xterm" ]; then
+ export TERM=xterm-256color
fi
-if [ "$color_prompt" = yes ]; then
- PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
-else
- PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
+# load other files
+source ~/dotfiles/bin/git-prompt.sh
+if [ -f ~/.fzf.bash ]; then
+ source ~/.fzf.bash
fi
-unset color_prompt force_color_prompt
-
-# If this is an xterm set the title to user@host:dir
-case "$TERM" in
-xterm*|rxvt*)
- PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
- ;;
-*)
- ;;
-esac
-# enable color support of ls and also add handy aliases
+# fortune | cowsay
+
+# alias stuff{{{1
+# better tab complete
+bind '"\t":menu-complete'
+
+# enable color support
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
-# some more ls aliases
+# shortcuts
+alias sb='source ~/.bashrc'
+alias r='reset'
+alias ..='cd ..'
+alias ...='cd ../..'
+alias ....='cd ../../..'
+
+# better ls-ing
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
-# Add an "alert" alias for long running commands. Use like so:
-# sleep 10; alert
+# make these commands safer
+alias mv='mv -i'
+alias cp='cp -i'
+alias ln='ln -i'
+alias rm='rm -i'
+
+alias vrc='$EDITOR ~/dotfiles/vimrc'
+alias vrcb='$EDITOR ~/dotfiles/vimrc.bundles'
+alias brc='$EDITOR ~/dotfiles/bashrc'
+alias bp='$EDITOR ~/dotfiles/bash_profile'
+alias tconf='$EDITOR ~/dotfiles/tmux.conf'
+
+# other
+alias v='xmodmap ~/.vim-keys.xmodmap'
+alias emacs='emacs -nw'
+alias vless='vim -u /usr/share/vim/vim74/macros/less.vim'
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
-# Alias definitions.
-# You may want to put all your additions into a separate file like
-# ~/.bash_aliases, instead of adding them here directly.
-# See /usr/share/doc/bash-doc/examples in the bash-doc package.
-if [ -f ~/.bash_aliases ]; then
- . ~/.bash_aliases
-fi
+ipls () {
+ ifconfig | grep 'inet addr:' | awk {'print $2'}
+}
-# enable programmable completion features (you don't need to enable
-# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
-# sources /etc/bash.bashrc).
-if ! shopt -oq posix; then
- if [ -f /usr/share/bash-completion/bash_completion ]; then
- . /usr/share/bash-completion/bash_completion
- elif [ -f /etc/bash_completion ]; then
- . /etc/bash_completion
- fi
-fi
#}}}
-# load other files
-source ~/dotfiles/bash_profile
-source ~/dotfiles/bin/colors.sh
-source ~/dotfiles/bin/git-prompt.sh
-if [ -f ~/.fzf.bash ]; then
- source ~/.fzf.bash
-fi
-
diff --git a/bin/colors.sh b/bin/colors.sh
@@ -1,72 +0,0 @@
-# Reset
-Color_Off=$'\033[m' # Text Reset
-
-# Regular Colors
-Black=$'\033[0;30m' # Black
-Red=$'\033[0;31m' # Red
-Green=$'\033[0;32m' # Green
-Yellow=$'\033[0;33m' # Yellow
-Blue=$'\033[0;34m' # Blue
-Purple=$'\033[0;35m' # Purple
-Cyan=$'\033[0;36m' # Cyan
-White=$'\033[0;37m' # White
-
-# Bold
-BBlack=$'\033[1;30m' # Black
-BRed=$'\033[1;31m' # Red
-BGreen=$'\033[1;32m' # Green
-BYellow=$'\033[1;33m' # Yellow
-BBlue=$'\033[1;34m' # Blue
-BPurple=$'\033[1;35m' # Purple
-BCyan=$'\033[1;36m' # Cyan
-BWhite=$'\033[1;37m' # White
-
-# Underline
-UBlack=$'\033[4;30m' # Black
-URed=$'\033[4;31m' # Red
-UGreen=$'\033[4;32m' # Green
-UYellow=$'\033[4;33m' # Yellow
-UBlue=$'\033[4;34m' # Blue
-UPurple=$'\033[4;35m' # Purple
-UCyan=$'\033[4;36m' # Cyan
-UWhite=$'\033[4;37m' # White
-
-# Background
-On_Black=$'\033[40m' # Black
-On_Red=$'\033[41m' # Red
-On_Green=$'\033[42m' # Green
-On_Yellow=$'\033[43m' # Yellow
-On_Blue=$'\033[44m' # Blue
-On_Purple=$'\033[45m' # Purple
-On_Cyan=$'\033[46m' # Cyan
-On_White=$'\033[47m' # White
-
-# High Intensty
-IBlack=$'\033[0;90m' # Black
-IRed=$'\033[0;91m' # Red
-IGreen=$'\033[0;92m' # Green
-IYellow=$'\033[0;93m' # Yellow
-IBlue=$'\033[0;94m' # Blue
-IPurple=$'\033[0;95m' # Purple
-ICyan=$'\033[0;96m' # Cyan
-IWhite=$'\033[0;97m' # White
-
-# Bold High Intensty
-BIBlack=$'\033[1;90m' # Black
-BIRed=$'\033[1;91m' # Red
-BIGreen=$'\033[1;92m' # Green
-BIYellow=$'\033[1;93m' # Yellow
-BIBlue=$'\033[1;94m' # Blue
-BIPurple=$'\033[1;95m' # Purple
-BICyan=$'\033[1;96m' # Cyan
-BIWhite=$'\033[1;97m' # White
-
-# High Intensty backgrounds
-On_IBlack=$'\033[0;100m' # Black
-On_IRed=$'\033[0;101m' # Red
-On_IGreen=$'\033[0;102m' # Green
-On_IYellow=$'\033[0;103m' # Yellow
-On_IBlue=$'\033[0;104m' # Blue
-On_IPurple=$'\033[10;95m' # Purple
-On_ICyan=$'\033[0;106m' # Cyan
-On_IWhite=$'\033[0;107m' # White
diff --git a/bin/git-prompt.sh b/bin/git-prompt.sh
diff --git a/vim/bundle/Vundle.vim b/vim/bundle/Vundle.vim
@@ -1 +1 @@
-Subproject commit 8db3bcb5921103f0eb6de361c8b25cc03cb350b5
+Subproject commit 0b28e334e65b6628b0a61c412fcb45204a2f2bab
diff --git a/vim/bundle/fzf b/vim/bundle/fzf
@@ -1 +1 @@
-Subproject commit de0965619716d7222ee0ff17cf8ef1a37f2fd861
+Subproject commit a54784cd53f12ea4b8b6bf63a42dd9c86bdb3346
diff --git a/vim/bundle/neocomplete.vim b/vim/bundle/neocomplete.vim
@@ -1 +1 @@
-Subproject commit 56fe81fd63a4282e2fe20732dcf5a4f3fe9b1c8a
+Subproject commit 26bb5c8ff619366b948c757a18ff7a4d71fbcf14
diff --git a/vim/bundle/neosnippet b/vim/bundle/neosnippet
@@ -1 +1 @@
-Subproject commit 578530edf1a85a623b7915cd2904407081cadf36
+Subproject commit 01d17aa88506a876d78bddfc029eb895a62fa2a0
diff --git a/vim/bundle/neosnippet-snippets b/vim/bundle/neosnippet-snippets
@@ -1 +1 @@
-Subproject commit 5571cf0c8f05204fafceb5aeafe2716ce91737cc
+Subproject commit 16570a91d81ea9c6dd7286a0579640ffea4e7d88
diff --git a/vim/bundle/tmux-complete.vim b/vim/bundle/tmux-complete.vim
@@ -1 +1 @@
-Subproject commit af9a1008a710091e1011c8e113990a0837ad3312
+Subproject commit f095f3320b773c3ea677f90914cdaa7811041d9b
diff --git a/vim/bundle/vim-commentary b/vim/bundle/vim-commentary
@@ -1 +1 @@
-Subproject commit 4658aa78fd1b797fb0645064afe8eebbf2bfbb54
+Subproject commit 8b4df6ca0ba9cd117d97a8fd26b44b2439d5e3f1
diff --git a/vim/bundle/vim-dispatch b/vim/bundle/vim-dispatch
@@ -1 +1 @@
-Subproject commit 9255742d23d15f53f88ac7dea43b1f4ee4f63c50
+Subproject commit 990d542c2d1da39d879a19dc07587240f8ea322e
diff --git a/vim/bundle/vim-easy-align b/vim/bundle/vim-easy-align
@@ -1 +1 @@
-Subproject commit fc9555cd659586d10e767d56794699ba96dd5278
+Subproject commit 5e2a588403c595a4d0505037745ba201e56a8c0e
diff --git a/vim/bundle/vim-endwise b/vim/bundle/vim-endwise
@@ -1 +1 @@
-Subproject commit 38541f3dbe53f0431a9181561c3b609d58b92d06
+Subproject commit ab5f7f99f49ee26a16563df00a79fbc3bf1090af
diff --git a/vim/bundle/vim-fugitive b/vim/bundle/vim-fugitive
@@ -1 +1 @@
-Subproject commit 416165f0630f683b859fd56161183ca3d6eecc44
+Subproject commit 90ee6fb5d255d14d9f12f2469f92ee50149f5b44
diff --git a/vim/bundle/vim-gitgutter b/vim/bundle/vim-gitgutter
@@ -1 +1 @@
-Subproject commit c9595f22e82e0c65b3267f39ff815a68f69e636a
+Subproject commit 83ace2014a626c6348359b5e27b9ac90c5946a1d
diff --git a/vim/bundle/vim-pencil b/vim/bundle/vim-pencil
@@ -1 +1 @@
-Subproject commit 84b66f57b557d523451330f0d122ff055dffd074
+Subproject commit 096dd965d7c8be7a7ae595ffe849dcbd776f390e
diff --git a/vim/bundle/vim-signature b/vim/bundle/vim-signature
@@ -1 +1 @@
-Subproject commit 875a5c232b4c19192a79ff4c94e553f9c923108f
+Subproject commit c7bec45105993f5d77246dfd13dafbe3db42d5fd
diff --git a/vim/bundle/vim-snippets b/vim/bundle/vim-snippets
@@ -1 +1 @@
-Subproject commit 45bcd32d596ef9db84919d7a1fcb20e4c920cf92
+Subproject commit fa2b5cb40205dbb01156b38e16603df5f5f22359
diff --git a/vim/bundle/vim-surround b/vim/bundle/vim-surround
@@ -1 +1 @@
-Subproject commit 42e9b46e7a20a2f394664874c7bbd9d6f6c39e8a
+Subproject commit fa433e0b7330753688f715f3be5d10dc480f20e5
diff --git a/vim/bundle/vim-tmux-navigator b/vim/bundle/vim-tmux-navigator
@@ -1 +1 @@
-Subproject commit d12c394110a803786cab2c488d83af72a23a063d
+Subproject commit 3de98bfcee1289ce8edc6daf9a18f243180c7168
diff --git a/vim/bundle/vim-unimpaired b/vim/bundle/vim-unimpaired
@@ -1 +1 @@
-Subproject commit 235be4ce59d3392b7f476814bb0d39de6c91bf2c
+Subproject commit 2791b1f27ec9eae210e27917c2d8b9c73bba9687
diff --git a/vim/bundle/vim-wordy b/vim/bundle/vim-wordy
@@ -1 +1 @@
-Subproject commit 0752ff35480284f57c696067b3621f596587d9a9
+Subproject commit ccdc24b7cb90ecacd9e9f9b5ee498fea22b229b0