Skip to content

Instantly share code, notes, and snippets.

@jayers99
Last active February 9, 2019 17:45
Show Gist options
  • Save jayers99/adc109fc070487ef54d31415aa2a5d26 to your computer and use it in GitHub Desktop.
Save jayers99/adc109fc070487ef54d31415aa2a5d26 to your computer and use it in GitHub Desktop.
# .bashrc
export PROMPT_COMMAND='history -a'
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=
# User specific aliases and functions
alias la='ls -la'
alias md='mkdir'
alias hist='history 60'
alias hg='history | grep '
alias hcds='history | grep -i -E '\''^\s[0-9]+\s+cd\s+'\'' | grep -iv -E '\''^\s[0-9]+\s+cd\s+\.\.'\'' | grep -iv -E '\''^\s[0-9]+\s+cd\s+\-'\'' | sort -r | awk '\''!seen[$3] {print $0} {++seen[$3]}'\'' | sort'
alias hcdcode='history | grep -i -E '\''^\s[0-9]+\s+cd\s+\~/code'\'' | sort -r | awk '\''!seen[$3] {print $0} {++seen[$3]}'\'' | sort'
alias hvims='history | grep vim'
alias hgits='history | grep git'
# my prompt
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\n\[\033[00;33m\]\u@\h\[\033[0m\]:\[\033[00;34m\]\w\[\033[00;32m\]\$(parse_git_branch)\[\033[00;0m\]\n\[\033[00;33m\]> $\[\033[00;0m\] "
# auto complete aws cli commands
complete -C '~/Library/Python/3.6/bin/aws_completer' aws
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment