zsh config

This commit is contained in:
William Ball 2025-03-05 00:06:59 -08:00
parent e8bc2be255
commit 906f18072c
Signed by: wball
GPG key ID: B8682D8137B70765
4 changed files with 90 additions and 1 deletions

2
.gitignore vendored
View file

@ -7,4 +7,4 @@ pianobar/.config/pianobar/info
pianobar/.config/pianobar/state
nvim/.config/nvim/lazy-lock.json
tmux/.config/tmux/plugins
vifm/.config/vifm/vifminfo.json
zsh/.config/zsh/.zcompdump

39
zsh/.config/zsh/.zprofile Normal file
View file

@ -0,0 +1,39 @@
#!/bin/zsh
# Add directories to PATH
export PATH="$HOME/.local/share/cargo/bin:$HOME/.cache/cabal/bin:$HOME/.local/bin:$HOME/j9.5/bin:$HOME/.local/share/rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin:/usr/lib/smlnj/bin:$HOME/.config/emacs/bin:$HOME/.elan/bin:$HOME/.local/share/pack/bin:$PATH"
# XDG directories
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share"
# General environment variables
export EDITOR=nvim
export VISUAL=nvim
export TERM=xterm-256color
export BROWSER=firefox
# Wayland settings
export MOZ_ENABLE_WAYLAND=1
export ELECTRON_OZONE_PLATFORM_HINT=auto
export GDK_BACKEND=wayland
# Miscellaneous
export LESSHISTFILE=-
export INPUTRC="$HOME/.config/readline/inputrc"
export HISTFILE="$XDG_CACHE_HOME/zsh/history"
export CARGO_HOME="$XDG_DATA_HOME/cargo"
# export GNUPGHOME="$XDG_DATA_HOME/gnupg"
export GPG_TTY="$(tty)"
export STACK_XDG=1
export GHCUP_USE_XDG_DIRS=true
export JULIA_DEPOT_PATH="$XDG_DATA_HOME/julia:$JULIA_DEPOT_PATH"
export JUPYTER_CONFIG_DIR="$XDG_CONFIG_HOME/jupyter"
export RUSTUP_HOME="$XDG_DATA_HOME/rustup"
export DOT_SAGE="$XDG_CONFIG_HOME/sage"
export MAXIMA_USERDIR="$XDG_CONFIG_HOME/maxima"
export AGDA_DIR="$HOME/.config/agda"
export PACK_DIR="$HOME/.local/share/pack"
export MIZFILES="$HOME/.local/share/mizar"
export RLWRAP_HOME="$XDG_DATA_HOME/rlwrap"

48
zsh/.config/zsh/.zshrc Normal file
View file

@ -0,0 +1,48 @@
#!/bin/zsh
# emacs-style keybindings
bindkey -e
# Aliases
alias grep='rg'
alias ls='eza'
alias sl='eza'
alias ll='eza -alF'
alias la='eza -a'
alias l='eza'
alias lal='eza -al'
alias cat='bat'
alias ip='ip --color=auto'
# history stuff
HISTSIZE=10000
SAVEHIST=10000
HISTFILE="$XDG_CACHE_HOME/zsh/history"
setopt HIST_IGNORE_DUPS
setopt HIST_REDUCE_BLANKS
setopt HIST_FIND_NO_DUPS
function fzf-history-widget() {
local selected_command=$(history -rn 1 | fzf --preview 'echo {}' --preview-window=down:3:wrap)
if [[ -n $selected_command ]]; then
LBUFFER="$selected_command"
fi
zle reset-prompt
}
zle -N fzf-history-widget
bindkey '^R' fzf-history-widget
# Enable command completion
autoload -Uz compinit && compinit
# completion stuff
zstyle ':completion:*' menu select
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'
# plugins
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
# prompt
eval "$(starship init zsh)"

2
zsh/.zshenv Normal file
View file

@ -0,0 +1,2 @@
export XDG_CONFIG_HOME="$HOME/.config"
export ZDOTDIR="$XDG_CONFIG_HOME/zsh"