Skip to content

Instantly share code, notes, and snippets.

@petrbel
Last active May 31, 2017 15:17
Show Gist options
  • Save petrbel/7a6c07d1f2be1a9c5970654cfbb913b8 to your computer and use it in GitHub Desktop.
Save petrbel/7a6c07d1f2be1a9c5970654cfbb913b8 to your computer and use it in GitHub Desktop.
oh-my-zsh
###################
# Petr Belohlavek #
###################
####################
# General settings
export ZSH=$HOME/.oh-my-zsh
ZSH_THEME="gianu"
export UPDATE_ZSH_DAYS=7
COMPLETION_WAITING_DOTS="true"
DISABLE_UNTRACKED_FILES_DIRTY="true"
####################
# Plugins
plugins=(common-aliases last-working-dir git git-extras svn compleat python pip scala sbt tmux docker rsync systemd)
# TMUX autostart
ZSH_TMUX_AUTOSTART=true
ZSH_TMUX_AUTOQUIT=false
source $ZSH/oh-my-zsh.sh
####################
# User configuration
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/$(whoami)/bin:$PATH"
export EDITOR=vim
export VISUAL=vim
# Keychain
# eval $(keychain --eval --quiet --noask id_rsa)
####################
# Aliases
# Proper ipython invokation regarding active virtualenv
alias ipython="python -c 'import IPython; IPython.terminal.ipapp.launch_new_instance()'"
# FUCK
# alias fuck='$(thefuck $(fc -ln -1))'
# Other aliases
alias tar-extract='tar -xzvf'
alias tar-list='tar -ztvf'
alias num-cpu='nproc'
alias ll='ls -lsh'
alias la='ls -a'
alias lla='ls -lash'
alias grin='grep -Rin'
alias antlr='java org.antlr.v4.Tool'
alias tb='tensorboard --logdir '
virtualenv-activate () {
source ~/.virtualenv/"$1"/bin/activate
}
virtualenv-create () {
python3.5 -m venv ~/.virtualenv/"$1"
virtualenv_activate "$1"
}
tar-max-file-size () {
tar -ztvf $1 | tr -s ' ' | cut -d ' ' -f 3 | sort -t= -nr | head -1
}
file-size () {
du -b $1 | cut -f1
}
git-prune-origin () {
git remote prune origin
}
git-delete-all-local-branches () {
git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -d
git gc
gba
}
git-delete-force-all-local-branches () {
git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -D
git gc
gba
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment