Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
99 lines (78 sloc) 3.4 KB
export ZSH=$HOME/.oh-my-zsh
export HISTCONTROL=ignoreboth:erasedups
export ALTERNATE_EDITOR=""
ZSH_THEME="avit"
plugins=(git)
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/jasamitier/bin/:$HOME/.composer/vendor/bin"
[[ -s $(brew --prefix)/etc/profile.d/autojump.sh ]] && . $(brew --prefix)/etc/profile.d/autojump.sh
os=`uname`;
if [[ "$os" == *"Darwin"* ]]; then
[[ -s $(brew --prefix)/etc/profile.d/autojump.sh ]] && . $(brew --prefix)/etc/profile.d/autojump.sh
test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"
alias afk="/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine"
fi
if [[ "$os" == *"Linux"* ]]; then
[[ -s /home/eckelon/.autojump/etc/profile.d/autojump.sh ]] && source /home/eckelon/.autojump/etc/profile.d/autojump.sh
autoload -U compinit && compinit -u
# terminator fix
export TERM=xterm-256color
fi
source $ZSH/oh-my-zsh.sh
if [ -f ~/.zsh/zshalias ]; then
source ~/.zsh/zshalias
fi
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
function t(){
tree --dirsfirst --filelimit 45 -L ${1:-3} -C $2
}
function gi() {
curl -L -s https://www.gitignore.io/api/$@ >> .gitignore;
}
function gitls() {
for d in *; do
if [[ -d "$d" && -e "$d/.git" ]]; then
echo "$d -> $(cd "$d" && git_prompt_info | sed 's/%//g;s/{//g;s/}//g')"
fi
done
}
function gupd() {
current_directory=$PWD
for d in *; do
if [[ -d "$d" && -e "$d/.git" ]]; then
cd $d
echo "$d -> $(git_prompt_info | sed 's/%//g;s/{//g;s/}//g')"
git fetch
git pull origin $(git_current_branch)
cd $current_directory
fi
done
}
#https://gist.github.com/junegunn/f4fca918e937e6bf5bad - https://gist.github.com/junegunn
function gitlg() {
git log --graph --pretty=format:"%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %Cblue<%an>%Creset" --abbrev-commit --date=relative --all "$@" |
fzf --ansi --no-sort --reverse --tiebreak=index --bind=ctrl-s:toggle-sort \
--bind "ctrl-m:execute:
(grep -o '[a-f0-9]\{7\}' | head -1 |
xargs -I % sh -c 'git show --color=always % | less -R') << 'FZF-EOF'
{}
FZF-EOF"
}
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
export SDKMAN_DIR="/home/eckelon/.sdkman"
[[ -s "/home/eckelon/.sdkman/bin/sdkman-init.sh" ]] && source "/home/eckelon/.sdkman/bin/sdkman-init.sh"
#export FZF_DEFAULT_COMMAND='ag --files --no-ignore --hidden --follow --glob "!.git/*"'
export FZF_DEFAULT_COMMAND='ag --hidden --ignore .git --ignore node_modules -g ""'
#Aliases
alias afk="/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine"
alias gls="gitls"
alias fuck='sudo $(history -p \!\!)' # As seen on https://twitter.com/liamosaur/status/506975850596536320 XDD
alias weather='curl -4 wttr.in/Zaragoza?lang=es'
alias vc='vagrant ssh -- -t'
alias mage_cache="vc 'php /var/www/magento/shell/clear-cache.php'"
alias redis_cache="vc 'redis-cli -s /var/run/redis/redis.sock -n 1 flushdb'"
alias magento='vc "/var/www/magento/bin/magento"'
alias vim=nvim
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh