Skip to content

Instantly share code, notes, and snippets.

@remo5000
Created January 1, 2018 11:35
Show Gist options
  • Save remo5000/1f93f9f6534ecddd204b11b661746cbb to your computer and use it in GitHub Desktop.
Save remo5000/1f93f9f6534ecddd204b11b661746cbb to your computer and use it in GitHub Desktop.
a small but useful part of my zsh profile
export TERM=xterm-256color
export CLICOLOR=1
export GREP_OPTIONS='--color=auto'
function github() {
#call from a local repo to open the repository on github in browser
giturl=$(git config --get remote.origin.url)
if [ "$giturl" == "" ]
then
echo "Not a git repository or no remote.origin.url set"
exit 1;
fi
giturl=${giturl/git\@github\.com\:/https://github.com/}
giturl=${giturl/\.git//}
echo $giturl
open $giturl
}
###############################
## Aliases ##
###############################
alias reload='source ~/.bash_profile && source ~/.bashrc'
alias versions="python --version && ruby -v && rails -v && node --version && mongo --version && postgres --version"
alias ls='ls -hp'
alias ll='pwd && ls -l'
alias la='ls -la'
alias l='ls -CF'
alias cll="clear; ls -lAh"
alias ..="cd .."
alias ..2="cd ../../"
alias ..3="cd ../../../"
alias back='cd -'
alias ~='cd ~'
alias o='open'
alias bp='mate ~/.bash_profile'
alias trash='safe_rm'
alias grep='grep -H -n'
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias cwd='pwd | tr -d "\r\n" | pbcopy' #copy working directory
alias where="pwd"
##################
## Repositories ##
##################
alias repos='ls -1 ~/workspace/ | grep -v cloned'
repo() { cd ~/workspace/repository/$*; } #jump to repo
alias workspace='cd ~/workspace/'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment