From 8fdb1e4d87496835e1ee4b0cd06c48ddf0e86bc1 Mon Sep 17 00:00:00 2001 From: GRMrGecko Date: Fri, 13 Feb 2026 09:05:36 -0600 Subject: [PATCH] Replace ZDOTDIR with custom ZSH_CONFIG var and fix keybinds Use ZSH_CONFIG instead of ZDOTDIR to avoid conflicts with zsh internals (e.g. tmux). Register custom word-movement widgets with zle -N, remove incorrect TERM="konsole" export, add local.zsh config loading, and add ~/.local/bin to PATH. --- .config/zsh/functions | 12 ++++++------ .config/zsh/keybinds.zsh | 2 ++ .zshrc | 13 ++++++++----- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/.config/zsh/functions b/.config/zsh/functions index 8c50d32..0da1041 100644 --- a/.config/zsh/functions +++ b/.config/zsh/functions @@ -1,12 +1,12 @@ #!/bin/zsh function zsh_add_config() { - [ -f "$ZDOTDIR/$1" ] && ! [ -L "$ZDOTDIR/$1" ] && source "$ZDOTDIR/$1" + [ -f "$ZSH_CONFIG/$1" ] && ! [ -L "$ZSH_CONFIG/$1" ] && source "$ZSH_CONFIG/$1" } function zsh_add_plugin() { PLUGIN_NAME=$(echo $1 | cut -d"/" -f2) - if ! [ -d "$ZDOTDIR/plugins/$PLUGIN_NAME" ]; then - git clone "https://github.com/$1.git" "$ZDOTDIR/plugins/$PLUGIN_NAME" + if ! [ -d "$ZSH_CONFIG/plugins/$PLUGIN_NAME" ]; then + git clone "https://github.com/$1.git" "$ZSH_CONFIG/plugins/$PLUGIN_NAME" fi zsh_add_config "plugins/$PLUGIN_NAME/$PLUGIN_NAME.plugin.zsh" zsh_add_config "plugins/$PLUGIN_NAME/$PLUGIN_NAME.zsh" @@ -16,8 +16,8 @@ function zsh_add_plugin() { function zsh_fpath_plugin() { PLUGIN_NAME=$(echo $1 | cut -d"/" -f2) - if ! [ -d "$ZDOTDIR/plugins/$PLUGIN_NAME" ]; then - git clone "https://github.com/$1.git" "$ZDOTDIR/plugins/$PLUGIN_NAME" + if ! [ -d "$ZSH_CONFIG/plugins/$PLUGIN_NAME" ]; then + git clone "https://github.com/$1.git" "$ZSH_CONFIG/plugins/$PLUGIN_NAME" fi - fpath+=($ZDOTDIR/plugins/$PLUGIN_NAME) + fpath+=($ZSH_CONFIG/plugins/$PLUGIN_NAME) } diff --git a/.config/zsh/keybinds.zsh b/.config/zsh/keybinds.zsh index b76e87e..7b1c801 100644 --- a/.config/zsh/keybinds.zsh +++ b/.config/zsh/keybinds.zsh @@ -2,6 +2,8 @@ WORDCHARS='~!#$%^&*(){}[]<>?+;' MOTION_WORDCHARS='~!#$%^&*(){}[]<>?+;' ''{back,for}ward-word() WORDCHARS=$MOTION_WORDCHARS zle .$WIDGET +zle -N backward-word +zle -N forward-word bindkey '^[[1;3C' forward-word bindkey '^[[1;3D' backward-word diff --git a/.zshrc b/.zshrc index 1950e91..d9773a9 100644 --- a/.zshrc +++ b/.zshrc @@ -4,26 +4,29 @@ HISTFILE="$HOME/.zsh_history" HISTSIZE=10000 SAVEHIST=10000 -export PATH="/usr/local/ubin:$HOME/bin:$HOME/go/bin:$HOME/.cargo/bin:$PATH" +export PATH="/usr/local/ubin:$HOME/bin:$HOME/go/bin:$HOME/.cargo/bin:$home/.local/bin:$PATH" export EDITOR="vim" export TERMINAL="konsole" -export TERM="konsole" export BROWSER="firefox" export VIDEO="mpv" export OPENER="xdg-open" export GOPATH="$HOME/go" -export ZDOTDIR="$HOME/.config/zsh" - # Set emacs key binding. bindkey -e +# Set zsh config directory. +ZSH_CONFIG="$HOME/.config/zsh" + # Import functions. -source "$ZDOTDIR/functions" +source "$ZSH_CONFIG/functions" # Set custom key bindings. zsh_add_config keybinds.zsh +# Load configs local to the system. +zsh_add_config local.zsh + # Configure pure-prompt. export PURE_PROMPT_SYMBOL="$" if [ "$USER" = "root" ]; then