# Allows for faster key repetition
set -s escape-time 0
-# multi-line shift+enter
-bind -n S-Enter send-keys C-j
+# extended keys
+set -g extended-keys on
+set -g extended-keys-format csi-u
# bind new keys for splits
bind | split-window -hc "#{pane_current_path}"
export LS_COLORS='di=34:ln=35:so=32:pi=33:ex=31:bd=34;46:cd=34;43'
-# Add Homebrew completion definitions without launching Homebrew at shell startup.
-if [[ -d /opt/homebrew/share/zsh/site-functions ]]; then
- FPATH="/opt/homebrew/share/zsh/site-functions:${FPATH}"
-elif [[ -d /usr/local/share/zsh/site-functions ]]; then
- FPATH="/usr/local/share/zsh/site-functions:${FPATH}"
-fi
-
autoload -Uz compinit
# Rebuild the completion cache only when it is more than 24 hours old.
if [[ -n ~/.zcompdump(#qN.mh+24) ]]; then compinit; else compinit -C; fi
alias ls='ls --color=auto'
fi
+# Shared settings initialize completion before Linux-specific plugins load.
+source "$HOME/.zsh/common.zsh"
+
if command -v fzf-tab >/dev/null 2>&1; then
source "$(dirname "$(command -v fzf-tab)")/../share/fzf-tab/fzf-tab.zsh" 2>/dev/null
fi
fi
if [[ -n ${HOMEBREW_PREFIX:-} ]]; then
- # Add Homebrew's tools to the environment without running `brew shellenv`.
+ # Add Homebrew's tools and completion definitions without running Homebrew.
export PATH="$HOMEBREW_PREFIX/bin:$HOMEBREW_PREFIX/sbin:$PATH"
export MANPATH="$HOMEBREW_PREFIX/share/man${MANPATH:+:$MANPATH}"
export INFOPATH="$HOMEBREW_PREFIX/share/info${INFOPATH:+:$INFOPATH}"
+ FPATH="$HOMEBREW_PREFIX/share/zsh/site-functions:${FPATH}"
+fi
+
+# fnm is installed through Homebrew on this macOS setup.
+if [[ -d "${HOMEBREW_PREFIX:-}/opt/fnm/bin" ]]; then
+ eval "$(fnm env --shell zsh)"
+fi
+# Load shared settings after Homebrew has added its completion definitions.
+source "$HOME/.zsh/common.zsh"
+
+# Load plugins after compinit; syntax highlighting must be the final plugin loaded.
+if [[ -n ${HOMEBREW_PREFIX:-} ]]; then
[[ -r "$HOMEBREW_PREFIX/opt/fzf-tab/share/fzf-tab/fzf-tab.zsh" ]] && \
source "$HOMEBREW_PREFIX/opt/fzf-tab/share/fzf-tab/fzf-tab.zsh"
[[ -r "$HOME/.zsh/fzf-tab.zsh" ]] && source "$HOME/.zsh/fzf-tab.zsh"
[[ -r "$HOMEBREW_PREFIX/share/zsh-autosuggestions/zsh-autosuggestions.zsh" ]] && \
source "$HOMEBREW_PREFIX/share/zsh-autosuggestions/zsh-autosuggestions.zsh"
- # Syntax highlighting must remain the final plugin loaded.
[[ -r "$HOMEBREW_PREFIX/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" ]] && \
source "$HOMEBREW_PREFIX/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
fi
-# Shared entry point
-source "$HOME/.zsh/common.zsh"
-
+# Each platform configuration loads the shared settings in the required order.
if [[ "$OSTYPE" == darwin* ]]; then
[[ -r "$HOME/.zsh/macos.zsh" ]] && source "$HOME/.zsh/macos.zsh"
elif [[ "$OSTYPE" == linux* ]]; then
[[ -r "$HOME/.zsh/linux.zsh" ]] && source "$HOME/.zsh/linux.zsh"
+else
+ # Use the shared configuration on an unrecognized platform.
+ source "$HOME/.zsh/common.zsh"
fi
# Optional machine- or work-specific settings.
- https://news.ycombinator.com/item?id=11070797
- https://shapeshed.com/vim-netrw/#netrw---the-unloved-directory-browser
- https://evanhahn.com/a-decade-of-dotfiles/
+- https://codeberg.org/EvanHahn/dotfiles
+