dotfiles/dot_zshrc
2021-08-27 10:21:55 +02:00

77 lines
3.1 KiB
Text

# Documentation: https://github.com/romkatv/zsh4humans/blob/v5/README.md
zstyle ':z4h:' auto-update 'no'
zstyle ':z4h:' auto-update-days '28'
# tmux: integrated, system, no
zstyle ':z4h:' start-tmux 'no'
zstyle ':z4h:' prompt-at-bottom 'yes'
# keyboard setting
zstyle ':z4h:bindkey' keyboard 'pc'
zstyle ':z4h:autosuggestions' forward-char 'accept'
zstyle ':z4h:fzf-complete' recurse-dirs 'no'
# automatic teleportation of z4h to ssh 'yes' or 'no'
#zstyle ':z4h:ssh:example-hostname1' enable 'yes'
zstyle ':z4h:ssh:*' enable 'no'
#zstyle ':z4h:ssh-agent:' start no
z4h install ohmyzsh/ohmyzsh || return
z4h install urbainvaes/fzf-marks || return
z4h install mroth/evalcache || return
# Install or update core components (fzf, zsh-autosuggestions, etc.) and
# initialize Zsh. After this point console I/O is unavailable until Zsh
# is fully initialized. Everything that requires user interaction or can
# perform network I/O must be done above. Everything else is best done below.
z4h init || return
# exports
z4h source $HOME/.config/zsh/export.zsh
z4h source $HOME/.config/local/env.zsh
# Source Files
z4h source $HOME/.config/zsh/sshagent.zsh
z4h source $Z4H/ohmyzsh/ohmyzsh/lib/history.zsh
z4h source $Z4H/ohmyzsh/ohmyzsh/lib/completion.zsh
z4h source $Z4H/ohmyzsh/ohmyzsh/lib/directories.zsh
z4h source $Z4H/ohmyzsh/ohmyzsh/lib/clipboard.zsh
z4h source $Z4H/ohmyzsh/ohmyzsh/lib/grep.zsh
z4h source $Z4H/ohmyzsh/ohmyzsh/plugins/command-not-found/command-not-found.plugin.zsh
z4h source $Z4H/urbainvaes/fzf-marks/fzf-marks.plugin.zsh
z4h source $Z4H/mroth/evalcache/evalcache.plugin.zsh
#zinit pack for ls_colors
# zoxide
_evalcache zoxide init zsh
# aliases
z4h source $HOME/.config/zsh/aliases.zsh
z4h source $HOME/.config/local/aliases.zsh
# key bindings
run_ranger () { echo; ranger < $TTY; zle redisplay }
zle -N run_ranger
bindkey '^f' run_ranger
# fix ssh completions
zstyle ':completion:*:*:*:users' ignored-patterns '*'
zstyle -e ':completion:*:(ssh|scp|sftp|rsh|rsync):hosts' hosts 'reply=(${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) /dev/null)"}%%[# ]*}//,/ })'
zstyle ':completion:*:(scp|ssh):*' tag-order 'hosts:-host:host hosts:-domain:domain hosts:-ipaddr:ip\ address *'
zstyle ':completion:*:scp:*' group-order users files all-files hosts-domain hosts-host hosts-ipaddr
zstyle ':completion:*:ssh:*' group-order hosts-domain hosts-host users hosts-ipaddr
zstyle ':completion:*:*:*:hosts-host' ignored-patterns '*(.|:)*' loopback ip6-loopback localhost localhost4 localhost6 ip6-localhost broadcasthost
zstyle ':completion:*:*:*:hosts-domain' ignored-patterns '<->.<->.<->.<->' '^[-[:alnum:]]##(.[-[:alnum:]]##)##' '*@*' '*localdomain*' '*.eeleater.org' '*.local'
zstyle ':completion:*:*:*:hosts-ipaddr' ignored-patterns '^(<->.<->.<->.<->|(|::)([[:xdigit:].]##:(#c,2))##(|%*))' '127.0.0.<->' '255.255.255.255' '::1' 'fe80::*'
# Define named directories: ~wsl <=> Windows home directory on WSL.
[[ -z $z4h_win_home ]] || hash -d wsl=$z4h_win_home
# Set shell options: http://zsh.sourceforge.net/Doc/Release/Options.html
setopt multios
setopt prompt_subst
setopt inc_append_history
z4h source $HOME/.config/local/rc.zsh