# If not running interactively, don't do anything [[ $- != *i* ]] && return source ~/.bash/git-prompt source ~/.bash/colors alias ls='ls --color=auto' alias grep='grep --color=auto' alias vi='vim' && export EDITOR='vim' [ -x "$(command -v nvim)" ] && alias vi='nvim' && export EDITOR='nvim' alias sudo='sudo ' # Prints the last commands output for the PS1 STATUS='$(if [ $? = 0 ]; then printf -; else printf $?; fi)' export PS1="${C_BGB} \$(eval \"echo \${STATUS}\") ${C_N} [${C_EMW}\A ${C_Y}\u${SSH_CLIENT+@\h}${C_N} \W${C_Y}\$(__git_ps1 \" (%s)\")${C_N}]${C_G}\$ ${C_N}" # Instant history logging for working with multiple shells and history. shopt -s histappend # append to history, don't overwrite it export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND" # fix for gnome-terminal new tab not opening working dir #. /etc/profile.d/vte.sh # ssh alias to only use mosh when set in ssh config REAL_SSH=$(which ssh) ssh_mosher () { local SCRIPT="$REAL_SSH" if [ -n "$(grep -e "^Host $1\$" ~/.ssh/config)" ]; then NEXTLINE=$(awk "/^Host $1$/{getline; print}" ~/.ssh/config | sed -e 's/^ *//' -e 's/ *$//') if [ "$NEXTLINE" == "# mosh" ]; then SCRIPT="mosh" fi fi eval "$SCRIPT $@" } alias ssh="ssh_mosher" # Project browsing helper functions find_project() { WORD=${COMP_WORDS[COMP_CWORD]} COMPREPLY=( $(find ~/Projects -mindepth 2 -maxdepth 2 -follow -iname $WORD'*' -not -name '.*' -type d -exec basename {} ';') ) return 0 } goto_project() { cd $(find ~/Projects -mindepth 2 -maxdepth 2 -follow -iname $1 -not -name '.*' -type d) } alias gp=goto_project alias fp=find_project complete -F find_project goto_project complete -F find_project gp export PATH="/home/martijn/.gem/ruby/2.2.0/bin:$PATH" export LANG=en_US export LC_ALL=en_US [ -x $(command -v gpg-agent) ] && gpg-agent --daemon GPG_TTY=$(tty) export GPG_TTY