Last active
December 13, 2017 20:24
-
-
Save roipoussiere/710cc0126668ba4402a0cc5b1c57e00d to your computer and use it in GitHub Desktop.
My zsh config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################## | |
### VARIABLES EXPORT ### | |
######################## | |
# Path | |
export PATH=$HOME/bin:/usr/local/bin:$HOME/.anaconda3/bin:$HOME/scripts/:$PATH | |
# Shell | |
export EDITOR=nano | |
export ZSH=$HOME/.oh-my-zsh # path to oh-my-zsh installation | |
# Misc. | |
export JAVA_HOME=/usr/lib/jvm/java-7-oracle | |
export LANG=en_US.UTF-8 | |
############### | |
### ALIASES ### | |
############### | |
# ls aliases | |
alias la="ls -AlhX" | |
alias lr="ls -R" | |
# Pipe aliases (end of command) | |
alias -g H="| head" | |
alias -g T="| tail" | |
alias -g G="| grep" | |
alias -g L="| less" | |
alias -g N='| notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' | |
# Redirection aliases (end of command) | |
alias -g LL="2>&1 | less" | |
alias -g CA="2>&1 | cat -A" | |
alias -g NE="2> /dev/null" | |
alias -g NUL="> /dev/null 2>&1" | |
# apt-get aliases | |
alias apts="apt-cache search" | |
alias apti="sudo apt-get install" | |
alias aptu="sudo apt-get update" | |
alias aptr="sudo apt-get remove" | |
# Shortcuts for installed programs | |
alias h="howdoi -c -n5" # see https://github.com/gleitz/howdoi | |
alias g="googler" # see https://github.com/jarun/googler | |
# Misc. | |
alias zconf="$EDITOR ~/.zshrc" | |
alias f="find . -name " | |
alias hfind="history | grep " | |
############ | |
### MISC ### | |
############ | |
# Ctr-D adds sudo to current or previous line | |
sudo-command-line() { | |
[[ -z $BUFFER ]] && zle up-history | |
[[ $BUFFER != sudo\ * ]] && BUFFER="sudo $BUFFER" | |
zle end-of-line | |
} | |
zle -N sudo-command-line | |
bindkey "^[s" sudo-command-line # Defined shortcut keys | |
######################## | |
### Oh-my-zsh config ### | |
######################## | |
HISTSIZE=10000 | |
HISTFILESIZE=20000 | |
ZSH_THEME="agnoster" # see http://askubuntu.com/questions/283908/how-can-i-install-and-use-powerline-plugin | |
HIST_STAMPS="dd.mm.yyyy" | |
plugins=(git, pip, colored-man-pages) | |
source $ZSH/oh-my-zsh.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment