4eb93b7640
Dotfiles managed with GNU Stow: Hyprland (Lua config), Neovim, zsh, tmux, ghostty, alacritty, waybar, yazi, lazygit, herdr, Claude Code. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
120 lines
3.0 KiB
Bash
120 lines
3.0 KiB
Bash
# Set vim mode
|
|
bindkey -v
|
|
|
|
# Check for Homebrew and set it up
|
|
if [[ -f "/opt/homebrew/bin/brew" ]]; then
|
|
eval "$(/opt/homebrew/bin/brew shellenv)"
|
|
elif [[ -f "/usr/local/bin/brew" ]]; then
|
|
eval "$(/usr/local/bin/brew shellenv)"
|
|
elif [[ -f "/home/linuxbrew/.linuxbrew/bin/brew" ]]; then
|
|
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
|
|
else
|
|
echo "Homebrew not installed!"
|
|
fi
|
|
|
|
if uwsm check may-start; then
|
|
exec uwsm start hyprland.desktop
|
|
fi
|
|
# Set the directory we want to store zinit and plugins
|
|
ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git"
|
|
|
|
# Download Zinit, if it's not there yet
|
|
if [ ! -d "$ZINIT_HOME" ]; then
|
|
mkdir -p "$(dirname $ZINIT_HOME)"
|
|
git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME"
|
|
fi
|
|
|
|
# Load secrets
|
|
[ -f "$HOME/.env" ] && source "$HOME/.env"
|
|
|
|
# Source/Load zinit
|
|
source "${ZINIT_HOME}/zinit.zsh"
|
|
|
|
# Add zsh plugins
|
|
zinit light zsh-users/zsh-syntax-highlighting
|
|
zinit light zsh-users/zsh-completions
|
|
zinit light zsh-users/zsh-autosuggestions
|
|
zinit light Aloxaf/fzf-tab
|
|
|
|
# Add in snippets
|
|
zinit snippet OMZP::git
|
|
zinit snippet OMZP::sudo
|
|
|
|
# Load completions
|
|
autoload -Uz compinit && compinit
|
|
|
|
zinit cdreplay -q
|
|
|
|
# History
|
|
HISTSIZE=5000
|
|
HISTFILE="$HOME/.zsh_history"
|
|
SAVEHIST=$HISTSIZE
|
|
HISTDUP=erase
|
|
setopt appendhistory
|
|
setopt sharehistory
|
|
setopt hist_ignore_space
|
|
setopt hist_ignore_all_dups
|
|
setopt hist_save_no_dups
|
|
setopt hist_ignore_dups
|
|
setopt hist_find_no_dups
|
|
|
|
# Completion styling
|
|
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
|
|
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
|
|
zstyle ':completion:*' menu no
|
|
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls --color $realpath'
|
|
zstyle ':fzf-tab:complete:__zoxide_z:*' fzf-preview 'ls --color $realpath'
|
|
|
|
# Aliases
|
|
alias ls='ls --color'
|
|
alias vim='nvim'
|
|
alias v='nvim'
|
|
alias c='clear'
|
|
alias air='$HOME/go/bin/air'
|
|
alias lg="lazygit"
|
|
|
|
alias claude="$HOME/.local/bin/claude"
|
|
# Oh-my-posh integration
|
|
eval "$(oh-my-posh init zsh --config $HOME/.ohmyposhconfig.yaml)"
|
|
|
|
# Shell integrations
|
|
eval "$(fzf --zsh)"
|
|
eval "$(zoxide init zsh)"
|
|
|
|
# Yazi wrapper
|
|
function y() {
|
|
local tmp="$(mktemp -t "yazi-cwd.XXXXXX")" cwd
|
|
yazi "$@" --cwd-file="$tmp"
|
|
if cwd="$(command cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
|
|
builtin cd -- "$cwd"
|
|
fi
|
|
rm -f -- "$tmp"
|
|
}
|
|
|
|
# Environment variables
|
|
|
|
export EDITOR=nvim
|
|
export KEYTIMEOUT=1 # Faster vim mode switching. Default 40ms
|
|
export XDG_PROJECTS_DIR='$HOME/projects'
|
|
|
|
# Path
|
|
export PATH=$PATH:$HOME/.local/bin
|
|
export PATH=$PATH:$(go env GOROOT)/bin
|
|
export PATH=$PATH:$(go env GOPATH)/bin
|
|
export PATH=$PATH:$HOME/sdks/flutter/bin
|
|
|
|
export NVM_DIR="$HOME/.nvm"
|
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
|
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
|
|
|
|
# opencode
|
|
export PATH=$HOME/.opencode/bin:$PATH
|
|
fpath=(~/.local/share/zsh/site-functions $fpath)
|
|
|
|
# bun completions
|
|
[ -s "$HOME/.bun/_bun" ] && source "$HOME/.bun/_bun"
|
|
|
|
# bun
|
|
export BUN_INSTALL="$HOME/.bun"
|
|
export PATH="$BUN_INSTALL/bin:$PATH"
|