2017-12-05 22:12:38 +01:00
|
|
|
export ZSH=/home/bascht/.oh-my-zsh
|
|
|
|
|
2018-02-14 11:19:39 +01:00
|
|
|
# Back out if we're surrounded by Emacs
|
|
|
|
[ "$TERM" = "eterm-color" ] && exec bash
|
|
|
|
|
2019-03-07 11:28:43 +01:00
|
|
|
# Back out if we are in a Emacs tramp session
|
|
|
|
[[ $TERM == "dumb" ]] && unsetopt zle && PS1='$ ' && return
|
|
|
|
|
2018-04-12 09:44:52 +02:00
|
|
|
source ~/.zplug/init.zsh
|
2018-04-23 08:27:53 +02:00
|
|
|
source $ZSH/oh-my-zsh.sh
|
2018-04-12 09:44:52 +02:00
|
|
|
|
|
|
|
zplug "plugins/fasd", from:oh-my-zsh
|
2019-01-14 16:50:29 +01:00
|
|
|
zplug "plugins/tmuxinator", from:oh-my-zsh
|
2018-04-12 09:44:52 +02:00
|
|
|
zplug "denysdovhan/spaceship-prompt", use:spaceship.zsh, from:github, as:theme
|
|
|
|
zplug "junegunn/fzf", use:shell/key-bindings.zsh
|
|
|
|
zplug "urbainvaes/fzf-marks"
|
|
|
|
zplug "Tarrasch/zsh-autoenv"
|
|
|
|
zplug "MichaelAquilina/zsh-emojis"
|
2017-12-05 22:12:38 +01:00
|
|
|
|
2018-04-23 08:27:53 +02:00
|
|
|
AUTOENV_FILE_ENTER=".direnv"
|
|
|
|
ZSH_THEME="spaceship"
|
|
|
|
|
2018-10-29 16:20:38 +01:00
|
|
|
# Only show kubecontext on demand
|
|
|
|
SPACESHIP_KUBECONTEXT_SHOW=false
|
2018-11-13 08:49:13 +01:00
|
|
|
SPACESHIP_PROMPT_ORDER=(
|
|
|
|
user
|
|
|
|
dir
|
|
|
|
host
|
|
|
|
git
|
|
|
|
ruby
|
|
|
|
docker
|
|
|
|
aws
|
|
|
|
kubecontext
|
|
|
|
exec_time
|
|
|
|
line_sep
|
|
|
|
jobs
|
|
|
|
exit_code
|
|
|
|
char
|
|
|
|
)
|
2018-10-29 16:20:38 +01:00
|
|
|
|
2017-12-05 22:12:38 +01:00
|
|
|
alias va="vagrant"
|
|
|
|
alias tm="tmux -2"
|
|
|
|
alias ta="tm a -t"
|
|
|
|
alias bi="bundle install"
|
|
|
|
alias be="bundle exec"
|
|
|
|
alias ber="bundle exec rake"
|
|
|
|
alias e=$EDITOR
|
|
|
|
alias ssh-yop="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
|
|
|
|
alias docker-rm-stopped="docker rm (docker ps -a -q)"
|
|
|
|
alias docker-rm-dangling="docker rmi (docker images -q -f dangling=true)"
|
|
|
|
alias dco="docker-compose"
|
2019-02-07 10:51:30 +01:00
|
|
|
alias dcorrm="docker-compose run --rm"
|
2017-12-05 22:12:38 +01:00
|
|
|
alias emacseval="emacs -batch -l ~/.emacs.d/init.el -eval '(org-batch-agenda "a")'"
|
|
|
|
alias dry="docker run -it -v /var/run/docker.sock:/var/run/docker.sock moncho/dry"
|
2019-03-07 11:28:35 +01:00
|
|
|
alias k=kubectl
|
2019-06-05 13:23:26 +02:00
|
|
|
alias git-cleanup-merged-branches="git fetch -va && git branch --merged | egrep -v '(^\*|master)' | xargs git branch -d"
|
2018-11-12 10:13:57 +01:00
|
|
|
timestamp() { date +%Y-%m-%d-%H%M%S }
|
2018-03-28 17:00:29 +02:00
|
|
|
letterup() { take $1 && cp -a ~/Documents/Personal/Brief-Vorlage/2017-LaTeX/* .; }
|
2018-02-07 07:30:29 +01:00
|
|
|
|
2018-02-21 13:06:45 +01:00
|
|
|
[ "$TERM" = "xterm-termite" ] && export TERM=xterm-256color
|
|
|
|
|
2018-04-12 09:44:52 +02:00
|
|
|
zplug load
|
2018-08-10 22:39:01 +02:00
|
|
|
|
2019-01-25 21:42:40 +01:00
|
|
|
# Override the tmux ssh auth sock
|
2019-01-29 20:43:05 +01:00
|
|
|
SSH_TMUX_SOCK="${HOME}/.ssh/ssh_auth_sock"
|
|
|
|
if [ "${SSH_AUTH_SOCK}" != "${SSH_TMUX_SOCK}" ]; then
|
|
|
|
ln -sf "$SSH_AUTH_SOCK" "$SSH_TMUX_SOCK"
|
2019-01-25 21:42:40 +01:00
|
|
|
fi
|
|
|
|
|
2019-06-05 13:22:52 +02:00
|
|
|
source /usr/share/zsh/site-functions/tmuxinator.zsh
|
|
|
|
|
|
|
|
# Via @dohq
|
|
|
|
# https://gist.github.com/dohq/1dc702cc0b46eb62884515ea52330d60
|
|
|
|
function fzf-ssh () {
|
|
|
|
local selected_host=$(grep "Host " ~/.ssh/config | grep -v '*' | cut -b 6- | fzf --query "$LBUFFER")
|
|
|
|
|
|
|
|
if [ -n "$selected_host" ]; then
|
|
|
|
BUFFER="ssh ${selected_host}"
|
|
|
|
zle accept-line
|
|
|
|
fi
|
|
|
|
zle reset-prompt
|
|
|
|
}
|
|
|
|
|
|
|
|
zle -N fzf-ssh
|
|
|
|
bindkey '\es' fzf-ssh
|
|
|
|
|
2018-08-10 22:39:01 +02:00
|
|
|
# Work around a broken autocompletion https://github.com/gopasspw/gopass/issues/585
|
|
|
|
source <(gopass completion zsh | head -n -1 | tail -n +2)
|
|
|
|
compdef _gopass gopass
|
|
|
|
|