# Personal Zsh configuration file. It is strongly recommended to keep all # shell customization and configuration (including exported environment # variables such as PATH) in this file or in files source by it. # # Documentation: https://github.com/romkatv/zsh4humans/blob/v5/README.md setopt multios prompt_subst auto_pushd pushd_ignore_dups pushdminus inc_append_history 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 'yes' # Enable ('yes') or disable ('no') automatic teleportation of z4h over # ssh when connecting to these hosts. #zstyle ':z4h:ssh:example-hostname1' enable 'yes' zstyle ':z4h:ssh:*' enable 'no' zstyle ':z4h:ssh:*' send-extra-files '~/.nanorc' '~/.env.zsh' zstyle ':z4h:ssh-agent:' start no z4h install ohmyzsh/ohmyzsh || return z4h install urbainvaes/fzf-marks || 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 # Export environment variables. export GPG_TTY=$TTY # Source additional local files if they exist. z4h source $HOME/.config/local/env.zsh # Libraries z4h source $HOME/.config/zsh/sshagent.zsh z4h source $Z4H/ohmyzsh/ohmyzsh/lib/history.zsh z4h source $Z4H/ohmyzsh/ohmyzsh/lib/functions.zsh z4h source $Z4H/ohmyzsh/ohmyzsh/lib/completion.zsh z4h source $Z4H/ohmyzsh/ohmyzsh/lib/directories.zsh z4h source $Z4H/ohmyzsh/ohmyzsh/lib/key-bindings.zsh z4h source $Z4H/ohmyzsh/ohmyzsh/lib/termsupport.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 #zinit pack for ls_colors # Define key bindings. z4h bindkey z4h-backward-kill-word Ctrl+Backspace Ctrl+H z4h bindkey z4h-backward-kill-zword Ctrl+Alt+Backspace z4h bindkey undo Ctrl+/ # undo the last command line change z4h bindkey redo Alt+/ # redo the last undone command line change z4h bindkey z4h-cd-back Alt+Left # cd into the previous directory z4h bindkey z4h-cd-forward Alt+Right # cd into the next directory z4h bindkey z4h-cd-up Alt+Up # cd into the parent directory z4h bindkey z4h-cd-down Alt+Down # cd into a child directory # Autoload functions. autoload -Uz zmv # Define functions and completions. function md() { [[ $# == 1 ]] && mkdir -p -- "$1" && cd -- "$1" } compdef _directories md # 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|rsync):*' tag-order 'hosts:-host:host hosts:-domain:domain hosts:-ipaddr:ip\ address *' zstyle ':completion:*:(scp|rsync):*' group-order users files all-files hosts-domain hosts-host hosts-ipaddr zstyle ':completion:*:ssh:*' tag-order users 'hosts:-host:host hosts:-domain:domain hosts:-ipaddr:ip\ address *' 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 pxm 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: ~w <=> Windows home directory on WSL. [[ -z $z4h_win_home ]] || hash -d w=$z4h_win_home # History export SAVEHIST=200000 export HISTFILE=$HOME/.cache/zsh/history export SPACEVIMDIR="$HOME/.config/spacevim/" export FZF_MARKS_FILE=$HOME/.config/fzfmarks z4h source $Z4H/urbainvaes/fzf-marks/fzf-marks.plugin.zsh # Aliases z4h source $HOME/.config/zsh/aliases.zsh z4h source $HOME/.config/local/aliases.zsh # Add flags to existing aliases. alias ls="${aliases[ls]:-ls} -A" # Set shell options: http://zsh.sourceforge.net/Doc/Release/Options.html. setopt glob_dots # no special treatment for file names with a leading dot setopt no_auto_menu # require an extra TAB press to open the completion menu z4h source $HOME/.config/local/rc.zsh