2018-04-04 17:37:05 +02:00
|
|
|
source ~/.zplug/init.zsh
|
|
|
|
|
|
|
|
zplug "plugins/git", from:oh-my-zsh
|
2020-08-21 08:28:02 +02:00
|
|
|
zplug "zsh-users/zsh-completions"
|
2020-09-27 16:38:35 +02:00
|
|
|
zplug 'zsh-users/zsh-syntax-highlighting', defer:2
|
|
|
|
zplug 'zsh-users/zsh-history-substring-search', defer:3
|
|
|
|
zplug 'zsh-users/zsh-autosuggestions'
|
2018-04-04 17:37:05 +02:00
|
|
|
|
|
|
|
if ! zplug check --verbose; then
|
|
|
|
printf "Install? [y/N]: "
|
|
|
|
if read -q; then
|
|
|
|
echo; zplug install
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
zplug load
|
|
|
|
|
2020-09-27 16:38:35 +02:00
|
|
|
## History
|
|
|
|
HISTSIZE=50000
|
|
|
|
SAVEHIST=50000
|
|
|
|
HISTFILE=~/.zsh_history
|
|
|
|
setopt append_history
|
|
|
|
setopt extended_history
|
|
|
|
setopt hist_expire_dups_first
|
|
|
|
setopt hist_fcntl_lock
|
|
|
|
setopt hist_ignore_all_dups
|
|
|
|
setopt hist_ignore_space
|
|
|
|
setopt HIST_IGNORE_SPACE
|
|
|
|
setopt hist_lex_words
|
|
|
|
setopt hist_reduce_blanks
|
|
|
|
setopt hist_save_no_dups
|
|
|
|
setopt hist_subst_pattern
|
|
|
|
setopt hist_verify
|
|
|
|
setopt share_history
|
|
|
|
|
|
|
|
|
|
|
|
## zsh settings
|
|
|
|
setopt pipe_fail
|
|
|
|
setopt auto_pushd
|
|
|
|
setopt no_beep
|
|
|
|
setopt no_rm_star_silent
|
|
|
|
setopt extended_glob
|
|
|
|
setopt ksh_glob
|
|
|
|
setopt null_glob
|
2017-06-28 09:43:51 +02:00
|
|
|
|
2020-09-27 13:56:54 +02:00
|
|
|
## Completion
|
|
|
|
autoload -Uz compinit
|
|
|
|
compinit
|
2017-06-28 09:43:51 +02:00
|
|
|
|
2020-09-27 16:38:35 +02:00
|
|
|
## Keybindings
|
|
|
|
bindkey -e
|
|
|
|
bindkey '^[[A' history-substring-search-up
|
|
|
|
bindkey '^[[B' history-substring-search-down
|
|
|
|
bindkey '^P' history-substring-search-up
|
|
|
|
bindkey '^N' history-substring-search-down
|
|
|
|
|
|
|
|
|
2020-09-27 13:56:54 +02:00
|
|
|
## Gnupg / gpg / ssh / yubikey
|
|
|
|
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
|
2017-06-28 09:43:51 +02:00
|
|
|
|
2019-12-04 17:28:14 +01:00
|
|
|
|
2020-04-22 08:30:34 +02:00
|
|
|
## Pager
|
|
|
|
export LESS="--mouse --wheel-lines=1 -nRX"
|
2017-06-28 09:43:51 +02:00
|
|
|
|
2020-09-27 13:56:54 +02:00
|
|
|
## Aliases
|
|
|
|
alias cdiff='colordiff -u'
|
|
|
|
alias dotgit='git --work-tree $HOME --git-dir $HOME/.dot_git'
|
|
|
|
alias l='less -nRX'
|
2019-10-19 12:36:29 +02:00
|
|
|
alias ls=exa
|
2020-09-27 13:56:54 +02:00
|
|
|
alias tail='tail -n $LINES'
|
|
|
|
alias timestamp='TZ=Z date "+%Y%m%dT%H%M%SZ"'
|
|
|
|
alias tree='exa --tree'
|
|
|
|
alias xc='xclip -selection clipboard'
|
2018-01-17 21:38:11 +01:00
|
|
|
|
2018-01-03 08:47:21 +01:00
|
|
|
## vim
|
2020-09-27 13:56:54 +02:00
|
|
|
export EDITOR=nvim
|
2018-01-03 08:47:21 +01:00
|
|
|
export NVIM_LISTEN_ADDRESS=/tmp/nvimsocket
|
|
|
|
|
|
|
|
e ()
|
|
|
|
{
|
2020-01-08 16:29:30 +01:00
|
|
|
tmux select-window -t1
|
2018-01-03 08:47:21 +01:00
|
|
|
nvr --remote $(readlink -f "$@")
|
|
|
|
}
|
2017-06-28 09:43:51 +02:00
|
|
|
|
2020-09-28 13:43:50 +02:00
|
|
|
## fzf
|
|
|
|
export FZF_TMUX=1
|
|
|
|
export FZF_COMPLETION_TRIGGER=";"
|
|
|
|
export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git'
|
|
|
|
. /usr/share/fzf/completion.zsh
|
|
|
|
. /usr/share/fzf/key-bindings.zsh
|
|
|
|
|
2020-09-05 13:20:38 +02:00
|
|
|
## direnv
|
|
|
|
eval "$(direnv hook zsh)"
|
|
|
|
|
2020-09-27 13:56:54 +02:00
|
|
|
## Kubernetes
|
2020-04-22 18:54:47 +02:00
|
|
|
command -v kubectl >/dev/null 2>&1 && source <(kubectl completion zsh)
|
2019-12-02 11:30:13 +01:00
|
|
|
export PATH=$HOME/.krew/bin:$PATH
|
|
|
|
|
2020-09-27 13:56:54 +02:00
|
|
|
## Flux
|
2019-10-19 12:36:29 +02:00
|
|
|
export FLUX_FORWARD_NAMESPACE=flux
|
|
|
|
|
2020-09-27 13:56:54 +02:00
|
|
|
## Google Cloud
|
2017-08-09 08:43:48 +02:00
|
|
|
[ -f /opt/google-cloud-sdk/completion.zsh.inc ] && source /opt/google-cloud-sdk/completion.zsh.inc
|
|
|
|
|
2019-09-03 14:50:36 +02:00
|
|
|
## Golang
|
2020-09-27 13:56:54 +02:00
|
|
|
export PATH=$HOME/go/bin:$PATH
|
2019-09-03 14:50:36 +02:00
|
|
|
GOPROXY=https://proxy.golang.org/
|
|
|
|
|
|
|
|
## Ansible
|
|
|
|
export ANSIBLE_NOCOWS=1
|
2019-01-01 19:48:52 +01:00
|
|
|
|
2020-09-27 13:56:54 +02:00
|
|
|
## Prompt
|
2020-09-27 16:38:35 +02:00
|
|
|
function set_win_title(){
|
|
|
|
echo -ne "\033]0;${PWD}\007"
|
|
|
|
}
|
|
|
|
starship_precmd_user_func="set_win_title"
|
|
|
|
precmd_functions+=(set_win_title)
|
2019-12-04 17:28:14 +01:00
|
|
|
|
2020-09-27 16:38:35 +02:00
|
|
|
eval "$(starship init zsh)"
|
2019-01-01 19:48:52 +01:00
|
|
|
|
2020-09-12 17:37:28 +02:00
|
|
|
|
2020-09-27 16:38:35 +02:00
|
|
|
export PATH=$HOME/bin:$PATH
|