Skip to content

Instantly share code, notes, and snippets.

@iho
Last active July 12, 2016 11:15
Show Gist options
  • Save iho/71e146b5341683f43325 to your computer and use it in GitHub Desktop.
Save iho/71e146b5341683f43325 to your computer and use it in GitHub Desktop.
ZSH=$HOME/.oh-my-zsh
#set -e
#export CHROMIUM_USER_FLAGS="--disk-cache-dir=/tmp --disk-cache-size=50000000"
ZSH_THEME="robbyrussell"
# ZSH_THEME="kolo"
DEFAULT_USER="ihor"
export UPDATE_ZSH_DAYS=2
COMPLETION_WAITING_DOTS="true"
DISABLE_UNTRACKED_FILES_DIRTY="true"
plugins=(pip git
# systemadmin
vagrant docker
# systemd
# zsh-completions
# zsh-autosuggestions
# systemd httpie heroku npm
# themes
# vi-mode # https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/vi-mode
# zsh-syntax-highlighting
)
# git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
# git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
#
# source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
# https://github.com/zsh-users/zsh-history-substring-search
source $ZSH/oh-my-zsh.sh
# For some themes
zstyle ':completion:*' expand prefix suffix
zstyle ':completion:*' file-sort access
zstyle ':completion:*' list-suffixes true
zstyle :compinstall filename '/home/ihor/.zshrc'
zstyle ':completion:*' verbose true
zstyle ':completion:*' extra-verbose true
autoload -Uz compinit
compinit
HISTFILE=~/.histfile
HISTSIZE=100000
SAVEHIST=100000000000000
bindkey -M emacs '^P' history-substring-search-up
bindkey -M emacs '^N' history-substring-search-down
# λ
zstyle -e ':completion:*:-command-:*:commands' list-colors 'reply=( '\''=(#b)('\''$words[CURRENT]'\''|)*-- #(*)=0=38;5;45=38;5;136'\'' '\''=(#b)('\''$words[CURRENT]'\''|)*=0=38;5;45'\'' )'
#
BROWSER=chromium-browser
exc () {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.tar.xz) tar xfJ $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*.7z) 7z x $1 ;;
*) echo "'$1' cannot be extracted via >extract<" ;;
esac
echo "'$1' успешно извлечен "
else
echo "'$1' is not a valid file"
fi
}
function pyclean() {
ZSH_PYCLEAN_PLACES=${*:-'.'}
find ${ZSH_PYCLEAN_PLACES} -type f -name "*.py[co]" -delete
find ${ZSH_PYCLEAN_PLACES} -type d -name "__pycache__" -delete
}
mkcd () {
mkdir "$1"
cd "$1"
}
alias ai="sudo aptitude install"
alias rpep="autopep8 -i -r . --exclude migrations --exclude .env; "
alias rsort="isort -rc . -s migrations -s .env"
alias b="cd .."
alias v="gvim"
alias e="emacsclient -c"
alias ar="sudo aptitude remove"
alias ap="sudo aptitude purge"
alias au="sudo aptitude update"
alias apg="sudo aptitude upgrade"
alias mong="mongod --noprealloc --smallfiles --nojournal run"
alias serv="python -m SimpleHTTPServer 8887"
alias gc="git clone"
alias cp="rsync -av -P "
alias as="sudo aptitude search"
alias pi="pip install"
alias pu="pip uninstall"
alias c="clear"
alias LL="LANGUAGE=en_US"
alias run="python ./manage.py runserver"
alias runt="python manage.py runserver --nothreading --noreload"
alias rq="pip freeze --local > requirements.txt"
alias ts="tmux attach || tmux new"
alias ramdisk="sudo mkdir /ramdisk -p; sudo mount -t tmpfs -o size=512m tmpfs /ramdisk; cd /ramdisk;"
alias rdzs='source ~/.zshrc'
alias g="git"
# alias lg="legit"
alias h="hg"
alias do="docker"
alias p="pyenv"
alias py="python"
alias py3="python3"
alias dea="pyenv deactivate"
alias mkv="pyenv virtualenv"
alias workon="pyenv activate"
alias rmv="pyenv uninstall"
alias pip7_update="pip install wheel pip setuptools -U"
alias alemb="alembic revision --autogenerate -m"
alias ihor="skype --dbpath ~/.Skype_oficial &"
setopt correctall
autoload -U compinit && compinit
load() {
export NVM_DIR="/home/ihor/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
export PATH=$PATH:~/.bin
NPM_PACKAGES="$HOME/.npm-packages"
PATH="$NPM_PACKAGES/bin:$PATH"
# pip install mercurial
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
}
export PATH=$PATH:~/.pyenv/versions/2.7.8/bin
export GIT_EDITOR=gvim
export DEV=1
# export VAGRANT_HOME=/mnt/windows/vagrant.d/
# export ANSIBLE_TRANSPORT="ssh"
# export ANSIBLE_SSH_ARGS="-o ForwardAgent=yes"
export CFLAGS='-g -O2'
unset MANPATH
export PATH=$PATH:/usr/local/go/bin
export GOPATH=$HOME/work
if [ -d "$HOME/bin" ]; then
PATH="$HOME/bin:$PATH"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment