diff options
| author | srdusr <trevorgray@srdusr.com> | 2025-09-24 00:49:52 +0200 |
|---|---|---|
| committer | srdusr <trevorgray@srdusr.com> | 2025-09-24 00:49:52 +0200 |
| commit | a70909b2057bf8d5923241d53e8ef3daef328458 (patch) | |
| tree | 4e215383912f7d035d61cc10ec06e86fc04deacc /common/config/zsh/.zshrc | |
| parent | 280f7799be30cba8fa893b489c49ac511cefe229 (diff) | |
| download | dotfiles-a70909b2057bf8d5923241d53e8ef3daef328458.tar.gz dotfiles-a70909b2057bf8d5923241d53e8ef3daef328458.zip | |
Zsh config changes
Diffstat (limited to 'common/config/zsh/.zshrc')
| -rw-r--r-- | common/config/zsh/.zshrc | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/common/config/zsh/.zshrc b/common/config/zsh/.zshrc new file mode 100644 index 0000000..0ada4f5 --- /dev/null +++ b/common/config/zsh/.zshrc @@ -0,0 +1,73 @@ +# ███████╗███████╗██╗ ██╗██████╗ ██████╗ +# ╚══███╔╝██╔════╝██║ ██║██╔══██╗██╔════╝ +# ███╔╝ ███████╗███████║██████╔╝██║ +# ███╔╝ ╚════██║██╔══██║██╔══██╗██║ +# ███████╗███████║██║ ██║██║ ██║╚██████╗ +# ╚══════╝╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ + +# Profile zsh time +#zmodload zsh/zprof + +# If not running interactively, and not being sourced, don’t do anything +[[ $- != *i* ]] && [[ "${BASH_SOURCE[0]:-${(%):-%N}}" == "$0" ]] && return + +# Terminal key bindings +#stty intr '^q' # Free Ctrl+C for copy use Ctrl+Q instead for Interrupt +stty lnext '^-' # Free Ctrl+V for paste use Ctrl+- instead for Literal next +stty stop undef # Disable Ctrl+S to freeze terminal +stty start undef # Disable Ctrl+Q nfreeze terminal + +# Set the current prompt file (e.g., prompt, or prompt_minimal) +ZSH_PROMPT="${ZSH_PROMPT:-prompt}" +#ZSH_PROMPT="${ZSH_PROMPT:-prompt_minimal}" +#ZSH_PROMPT="${ZSH_PROMPT:-prompt_new}" +#ZSH_PROMPT="${ZSH_PROMPT:-prompt_simple}" + +# Source common Zsh files (excluding any that start with 'prompt') +ZSH_SOURCES=() + +for zsh_source in "$HOME"/.config/zsh/user/*.zsh; do + if [[ $(basename "$zsh_source") == prompt* && $(basename "$zsh_source" .zsh) != "$ZSH_PROMPT" ]]; then + continue + fi + ZSH_SOURCES+=("$zsh_source") +done + +# Source ZSH files +for zsh_source in "${ZSH_SOURCES[@]}"; do + source "$zsh_source" +done + +# Faster SSH +if [[ -n "$SSH_CLIENT" ]]; then + export KEYTIMEOUT=10 +else + export KEYTIMEOUT=15 +fi + +# Prevent non-login shell anomalies or toolchain misidentification in VS Code +if [[ "${TERM_PROGRAM:-}" == "vscode" ]]; then + unset ARGV0 +fi + +########## Source Plugins, should be last ########## + +# Load fzf keybindings and completion if fzf is installed +if command -v fzf >/dev/null 2>&1; then + FZF_BASE="/usr/local/bin/fzf/shell" + [[ -f "${FZF_BASE}/key-bindings.zsh" ]] && source "${FZF_BASE}/key-bindings.zsh" + [[ -f "${FZF_BASE}/completion.zsh" ]] && source "${FZF_BASE}/completion.zsh" +fi + +# Source plugins +for plugin in \ + "$HOME/.config/zsh/plugins/zsh-you-should-use/you-should-use.plugin.zsh" \ + "$HOME/.config/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" \ + "$HOME/.config/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh" \ + "$HOME/.config/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh" +do + [ -f "$plugin" ] && source "$plugin" +done + +# Profile zsh time +#zprof # At the end of .zshrc |
