dotfiles/zshrc

195 lines
7 KiB
Bash
Raw Normal View History

2016-03-06 13:11:21 +00:00
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="agnoster"
2016-03-06 13:11:21 +00:00
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to change how often to auto-update (in days).
export UPDATE_ZSH_DAYS=7
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git git-flow)
2016-03-06 13:11:21 +00:00
source $ZSH/oh-my-zsh.sh
# User configuration
2016-07-04 18:51:14 +01:00
# history
SAVEHIST=100000
# vim binddings
bindkey -v
2016-03-06 13:11:21 +00:00
2016-04-07 23:41:45 +01:00
# Source the untracked `extra` file
test -e $HOME/.extra && source $HOME/.extra
2017-02-14 23:11:34 +00:00
# Source VTE for Terminix
if [ $TERMINIX_ID ] || [ $VTE_VERSION ]; then
source /etc/profile.d/vte.sh
fi
# Determine the running OS
platform="unkown"
unamestr=$(uname -s)
if [[ "$unamestr" == 'Linux' ]]; then
platform="linux"
elif [[ "$unamestr" == 'Darwin' ]]; then
platform="osx"
fi
2016-03-06 13:11:21 +00:00
export PATH="/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin"
export MANPATH="/usr/local/man:$MANPATH"
# ZSH syntax highlighting
test -e /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh \
&& source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
test -e /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh \
&& source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
2016-03-06 13:11:21 +00:00
2016-07-04 18:51:14 +01:00
# ZSH history substring search
bindKeysZshHistoryOSX() {
zmodload zsh/terminfo
bindkey "$terminfo[kcuu1]" history-substring-search-up
bindkey "$terminfo[kcud1]" history-substring-search-down
}
bindKeysZshHistoryLinux() {
zmodload zsh/terminfo
bindkey "$terminfo[cuu1]" history-substring-search-up
bindkey "$terminfo[cud1]" history-substring-search-down
}
test -e /usr/local/opt/zsh-history-substring-search/zsh-history-substring-search.zsh \
&& source /usr/local/opt/zsh-history-substring-search/zsh-history-substring-search.zsh
2016-07-13 13:25:10 +01:00
test -e /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh \
&& source /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh
2016-07-04 18:51:14 +01:00
test "$platform" = 'osx' && bindKeysZshHistoryOSX
test "$platform" = 'linux' && bindKeysZshHistoryLinux
2016-07-04 18:56:01 +01:00
# ZSH autosuggestions
test -e /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh \
&& source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh
2016-07-13 13:25:10 +01:00
test -e /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh \
&& source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
2016-07-04 18:56:01 +01:00
2016-03-06 13:11:21 +00:00
# You may need to manually set your language environment
export LANG=en_GB.UTF-8
# Preferred editor for local and remote sessions
export EDITOR='vim'
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
alias auao="sudo apt update && apt list --upgradable"
alias aupg="sudo apt upgrade"
2016-03-06 13:11:21 +00:00
alias aurup="sudo aura -Akua"
alias bubc="brew upgrade && brew cleanup"
alias bubo="brew update && brew outdated"
alias brewcurl="/usr/local/opt/curl/bin/curl --cacert /usr/local/etc/openssl/cert.pem"
2016-03-06 13:11:21 +00:00
alias brewssl="/usr/local/opt/openssl/bin/openssl"
2017-05-25 14:17:21 +01:00
alias ga="git add"
alias gf="git fetch --all; git fetch --tags"
alias gs="git status"
2016-09-05 20:49:53 +01:00
alias irc="ssh jmb -t '. ~/.zshrc; tmux attach -t irc'"
test "$platform" = 'linux' && alias ls="ls -F --color=always"
test "$platform" = 'osx' && alias ls="ls -FG"
2016-03-06 13:11:21 +00:00
alias phpunit="phpdbg -qrr vendor/bin/phpunit"
test "$platform" = 'linux' && alias pipup="pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 sudo pip install -U"
test "$platform" = 'osx' && alias pipup="pip3 freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip3 install -U"
2016-04-24 10:45:34 +01:00
alias rtor="tmux attach -t rtor"
2016-03-06 13:11:21 +00:00
alias startace="acestreamengine --client-console --upload-limit 0 --download-limit 0"
alias up="sudo pacman -Syu"
# Brew ZSH stuff
#unalias run-help
#autoload run-help
2016-07-04 21:19:51 +01:00
#HELPDIR=/usr/local/share/zsh/help
# credit Paul Irish: https://github.com/paulirish/dotfiles/blob/606d85f083eb53853789ce9dcaf31a49756471bd/.zshrc#L80
# Automatically list directory contents on `cd`.
auto-ls () {
2016-07-13 13:38:11 +01:00
emulate -L zsh;
# explicit sexy ls'ing as aliases arent honored in here.
hash gls >/dev/null 2>&1 && CLICOLOR_FORCE=1 gls -aFh --color --group-directories-first || ls
2016-07-04 21:19:51 +01:00
}
chpwd_functions=( auto-ls $chpwd_functions )
2016-03-06 13:11:21 +00:00
# Go Lang stuff
2017-02-17 21:23:37 +00:00
test "$platform" = 'linux' && export GOPATH=$HOME/go
test "$platform" = 'osx' && export GOPATH=$HOME/Development/go
2016-03-06 13:11:21 +00:00
export PATH="$PATH:/usr/local/opt/go/libexec/bin:$GOPATH/bin"
# GnuPG stuff
GPG_TTY=`tty`
export GPG_TTY
# composer global
test "$platform" = 'linux' && export PATH="$PATH:/home/jonny/.composer/vendor/bin"
test "$platform" = 'osx' && export PATH="$PATH:/Users/jonny/.composer/vendor/bin"
2016-03-06 13:11:21 +00:00
2016-10-19 20:27:50 +01:00
# yarn PATH
export PATH="$PATH:$HOME/.yarn/bin"
2017-01-08 19:28:53 +00:00
# rust/cargo bin PATH
export PATH="$PATH:$HOME/.cargo/bin"
2017-06-23 12:46:22 +01:00
# Ruby PATH
export PATH="$PATH:$HOME/.gem/ruby/2.4.0/bin"
2016-03-06 13:11:21 +00:00
# Set the DEFAULT_USER variable to me (jonny)
export DEFAULT_USER="jonny"
2016-04-29 15:21:03 +01:00
# No Homebrew analytics
export HOMEBREW_NO_ANALYTICS=1
2016-03-06 13:11:21 +00:00
# Colourised output for `ls`
export CLICOLOR=true
export CLICOLOR_FORCE=true
export LSCOLORS='dxfxcxdxbxegedabagacad'
2016-03-14 13:25:52 +00:00
export LS_COLORS='di=33;40:ln=35;40:so=32;40:pi=33;40:ex=31;40:bd=34;46:cd=34;43:su=0;41:sg=0;46:tw=0;42:ow=0;43:'
2016-03-06 13:11:21 +00:00
# Add zsh-completions to the fpath
2016-05-21 17:12:33 +01:00
# They are packaged correctly for Arch Linux
test "$platform" = 'osx' && fpath=(/usr/local/share/zsh-completions $fpath)
test -e ${HOME}/.iterm2_shell_integration.zsh && source ${HOME}/.iterm2_shell_integration.zsh