Files
nixos/Droidnix/assets/common/conf/zsh/custom.zsh
T

56 lines
1.7 KiB
Bash

#!/usr/bin/env zsh
# --- Environment Variables ---
export EDITOR="nvim"
export PATH="$HOME/.local/bin:$PATH"
export PATH="$HOME/.cargo/bin:$PATH" # Example: Add Rust's cargo binaries
# --- Aliases ---
# (You can move these from your Nix config to here if you prefer)
alias gs="git status"
alias ga="git add"
alias gc="git commit -m"
alias gp="git push"
alias gco="git checkout"
alias ll="exa --icons -la --group-directories-first"
alias ls="exa --icons -a --group-directories-first"
# --- Functions ---
# Example: Create a new directory and cd into it
mkcd() {
mkdir -p "$1" && cd "$1"
}
# --- Shell Options ---
setopt HIST_IGNORE_ALL_DUPS # Ignore duplicate commands in history
setopt HIST_IGNORE_SPACE # Ignore commands starting with a space
setopt APPEND_HISTORY # Append to history file, don't overwrite
setopt INC_APPEND_HISTORY # Append to history file as soon as the command is entered
# --- Key Bindings ---
# Example: Edit command line in $EDITOR
autoload -U edit-command-line
zle -N edit-command-line
bindkey '^xe' edit-command-line # Ctrl+x, e
# --- Prompt Customization ---
# (Starship usually handles this, but you can add pre-starship prompts here)
# --- Load other files ---
# Source other files (e.g., secrets, local overrides)
[[ -f "$HOME/.zshrc.local" ]] && source "$HOME/.zshrc.local"
# --- Fuzzy Finder (fzf) ---
# If not already loaded in .zshrc
[[ $- == *i* ]] && source "$(brew --prefix)/opt/fzf/shell/key-bindings.zsh" 2>/dev/null
[[ $- == *i* ]] && source "$(brew --prefix)/opt/fzf/shell/completion.zsh" 2>/dev/null
# --- Conditional Loading ---
# Only load if not already loaded
if [[ -z "$TMUX" ]]; then
# Example: Start tmux if not already in a session
if command -v tmux &>/dev/null && [ -n "$PS1" ]; then
exec tmux
fi
fi