Skip to content

Instantly share code, notes, and snippets.

@nichoth
Last active August 18, 2018 18:07
Show Gist options
  • Save nichoth/5b58e301dd1f1e8d793f0a0a51a0b1d6 to your computer and use it in GitHub Desktop.
Save nichoth/5b58e301dd1f1e8d793f0a0a51a0b1d6 to your computer and use it in GitHub Desktop.
bash_profile
alias oneline="tr -d '\n' | tr -s ' ' | sed -e '\$a\\'"
alias random="node -e \"console.log(require('crypto').randomBytes(32).toString('hex'));\""
alias lsd="ls -lF -G | grep --color=never '^d'"
# IP addresses
alias ip="dig +short myip.opendns.com @resolver1.opendns.com"
# Trim new lines and copy to clipboard
alias c="tr -d '\n' | pbcopy"
alias mul="echo ×"
alias diamond="echo ♦"
# pretty date
alias datep="date +\"%m-%d-%y\""
# sortable date
alias date-l="date +\"%Y-%m-%d\""
# `stree` is a shorthand for `tree` with hidden files and color enabled, ignoring
# the `.git` directory, listing directories first. The output gets piped into
# `less` with options to preserve color and line numbers, unless the output is
# small enough for one screen.
function stree() {
tree -aC -I '.git|node_modules|bower_components' --dirsfirst "$@" | less -FRNX;
}
# Make vim the default editor
export EDITOR="vim";
# propmt
export PS1='\[\033[0;33m\]\W\[\033[38;5;214m\]$(__git_ps1 "(%s)")\[\033[00m\] \u\$ '
# z script
source ~/.z.sh
#add git auto-completion
source ~/.git-completion.bash
#add git branch to command prompt
source ~/.git-prompt.sh
# Highlight section titles in manual pages
export LESS_TERMCAP_md="${yellow}";
# Always enable colored `grep` output
export GREP_OPTIONS="--color=auto";
#for globbing
export GLOBIGNORE=.:..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment