diff --git a/.gitignore b/.gitignore index 35ce1ff..1293ae4 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/zsh/.config/zsh/.zprofile b/zsh/.config/zsh/.zprofile new file mode 100644 index 0000000..9b9bb5b --- /dev/null +++ b/zsh/.config/zsh/.zprofile @@ -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" diff --git a/zsh/.config/zsh/.zshrc b/zsh/.config/zsh/.zshrc new file mode 100644 index 0000000..74d8548 --- /dev/null +++ b/zsh/.config/zsh/.zshrc @@ -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)" diff --git a/zsh/.zshenv b/zsh/.zshenv new file mode 100644 index 0000000..2f5e933 --- /dev/null +++ b/zsh/.zshenv @@ -0,0 +1,2 @@ +export XDG_CONFIG_HOME="$HOME/.config" +export ZDOTDIR="$XDG_CONFIG_HOME/zsh"