dotfiles/home/.zshrc

77 lines
2.4 KiB
Bash
Raw Normal View History

# Back out if we're surrounded by Emacs
[ "$TERM" = "eterm-color" ] && exec bash
2019-07-30 23:54:50 +02:00
[ "$TERM" = "xterm-termite" ] && export TERM=xterm-256color
2019-03-07 11:28:43 +01:00
# Back out if we are in a Emacs tramp session
2019-07-30 23:54:50 +02:00
if [[ $TERM == "eterm-color " ]] || [[ $TERM == "dumb" ]]; then
unsetopt zle
PS1='$ '
return
fi
2019-03-07 11:28:43 +01:00
plugins=(fzf fasd dotenv tmuxinator)
2019-07-30 23:54:50 +02:00
fpath=( ~/.kubectx/completion "${fpath[@]}" )
2019-07-30 23:54:50 +02:00
ZSH_CUSTOM="${HOME}/.zsh-custom"
ZSH_THEME="powerlevel10k/powerlevel10k"
ZSH_DOTENV_FILE=".direnv"
FZF_MARKS_FILE="${HOME}/.config/fzf/${HOSTNAME}"
2017-12-05 22:12:38 +01:00
2019-07-30 23:54:50 +02:00
export ZSH=/home/bascht/.oh-my-zsh
2019-07-30 23:54:50 +02:00
source $ZSH/oh-my-zsh.sh
source $ZSH_CUSTOM/plugins/fzf-marks/fzf-marks.plugin.zsh
2017-12-05 22:12:38 +01:00
alias va="vagrant"
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"
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 --rm -itv /var/run/docker.sock:/var/run/docker.sock skanehira/docui"
2019-03-07 11:28:35 +01:00
alias k=kubectl
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 }
letterup() { take $1 && cp -a ~/Documents/Personal/Brief-Vorlage/2017-LaTeX/* .; }
2018-02-07 07:30:29 +01:00
# Override the tmux ssh auth sock
SSH_TMUX_SOCK="${HOME}/.ssh/ssh_auth_sock"
if [ "${SSH_AUTH_SOCK}" != "${SSH_TMUX_SOCK}" ]; then
ln -sf "$SSH_AUTH_SOCK" "$SSH_TMUX_SOCK"
fi
#source /usr/share/zsh/site-functions/tmuxinator.zsh
# Via @dohq
# https://gist.github.com/dohq/1dc702cc0b46eb62884515ea52330d60
function fzf-ssh () {
2019-07-30 23:54:50 +02:00
local selected_host=$(grep "Host " ~/.ssh/config | grep -v '*' | cut -b 6- | fzf --reverse --height=20 --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
2019-07-30 23:54:50 +02:00
# Via @leahneukirchen
autoload -Uz copy-earlier-word
zle -N copy-earlier-word
bindkey "^[m" copy-earlier-word
if [ -f ~/Code/architecture/bin/ia ]; then
source <(~/Code/architecture/bin/ia completion)
fi;
2019-07-30 23:54:50 +02:00
source ~/.zsh-custom/plugins/
# To customize prompt, run `p9k_configure` or edit ~/.p10k.zsh.
source ~/.p10k.zsh