dotfiles/dot_zshrc.tmpl

76 lines
2.5 KiB
Cheetah

# Profiling
# https://esham.io/2018/02/zsh-profiling
# See ~/prog/zsh_sort_timings.zsh to sort results
#zmodload zsh/datetime
#setopt PROMPT_SUBST
#PS4='+$EPOCHREALTIME %N:%i> '
#logfile=$(mktemp zsh_profile.XXXXXXXX)
#echo "Logging to $logfile"
#exec 3>&2 2>$logfile
#setopt XTRACE
bindkey -e
bindkey -s "^Z" '^Uzi^M'
export HISTFILE=~/.histfile
HISTSIZE=100000
SAVEHIST=100000
setopt appendhistory
setopt inc_append_history
setopt share_history
setopt extended_history
#setopt print_exit_value
setopt extendedglob
setopt nomatch
setopt interactivecomments
autoload -U select-word-style
select-word-style bash
autoload -U compinit
compinit
zstyle ':completion:*:*:cd:*' tag-order local-directories path-directories
zstyle ':completion:*' menu select=2
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
zstyle ':completion:*:rm:*' ignore-line yes
zstyle ':completion:*:mv:*' ignore-line yes
zstyle ':completion:*:cp:*' ignore-line yes
zstyle ':completion:::::' completer _expand _complete _ignored _approximate
zstyle ':completion::complete:*' use-cache on # completion caching, use rehash to clear
zstyle ':completion:*' cache-path ~/.zsh/cache # cache path
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' # ignore case
source ~/.zsh/aliases
source ~/.zsh/functions
source ~/.zsh/exports
source ~/.zsh/completion/fzf-completion.zsh
[[ -e ~/.zsh/exports_local ]] && source ~/.zsh/exports_local
[[ -e ~/.zsh/aliases_local ]] && source ~/.zsh/aliases_local
{{- if eq .chezmoi.hostname "taupo" }}
source ~/.zsh/aliases_taupo
source ~/.zsh/exports_taupo
source ~/.zsh/functions_taupo
source ~/.config/broot/launcher/bash/br
source /usr/share/virtualenvwrapper/virtualenvwrapper_lazy.sh
#source /usr/share/doc/fzf/examples/key-bindings.zsh
source ~/.zsh/completion/scw-completion.zsh
source ~/.zsh/completion/podman.zsh
{{- end }}
eval "$(zoxide init zsh)"
eval "$(sheldon source)"
#eval "$(starship init zsh)"
setopt PROMPT_SUBST
{{- if eq .chezmoi.hostname "taupo" }}
PROMPT='$(prmt --shell zsh --code $? "{path:cyan.bold} {git:purple.bold} {python:yellow.bold::🐍}{rust:red.bold:s:🦀}{node:green.bold:s:⬢}\nat {time:yellow.bold:24hs} {ok:green.bold}{fail:red.bold:code} ")'
{{- else }}
PROMPT='$(prmt --shell zsh --code $? "{env:yellow.bold:USER} in {env:green.bold:HOSTNAME} in {path:cyan.bold} {git:purple.bold} {python:yellow.bold::🐍}{rust:red.bold:s:🦀}{node:green.bold:s:⬢}\nat {time:yellow.bold:24hs} {ok:green.bold}{fail:red.bold:code} ")'
{{- end }}
# Profiling
#unsetopt XTRACE
#exec 2>&3 3>&-