configs
Configs
The live dotfiles from the machine flake; they deploy on rebuild. Hover a block for the copy button, or curl the raw URL from a new machine.
# The live file from the machine flake, symlinked into $HOME.
export PATH="$HOME/.local/bin:$HOME/.bun/bin:$HOME/go/bin:$PATH"
# History: shared across sessions, duplicates dropped, a leading space
# keeps a command out of the file.
HISTSIZE=100000
SAVEHIST=100000
setopt share_history hist_ignore_all_dups hist_ignore_space hist_reduce_blanks
# Native build deps for Rust crates with C dependencies (openssl-sys, etc.).
export OPENSSL_NO_VENDOR=1
export PKG_CONFIG_PATH="/run/current-system/sw/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
# LD_LIBRARY_PATH for unpatched binaries that dlopen shared libs at
# runtime. /etc/runtime-libs is a curated two-library directory; do NOT
# point this at the whole system profile. LD_LIBRARY_PATH outranks
# RPATH, so the system profile would shadow whatever a nix binary was
# actually built against.
export LD_LIBRARY_PATH="/etc/runtime-libs${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
# Catppuccin zsh-syntax-highlighting theme (deployed by the rebuild)
[ -f "$HOME/.config/zsh/catppuccin_mocha-zsh-syntax-highlighting.zsh" ] && \
source "$HOME/.config/zsh/catppuccin_mocha-zsh-syntax-highlighting.zsh"
# FZF catppuccin mocha colors
export FZF_DEFAULT_OPTS=" \
--color=bg+:#313244,bg:#1e1e2e,spinner:#f5e0dc,hl:#f38ba8 \
--color=fg:#cdd6f4,header:#f38ba8,info:#cba6f7,pointer:#f5e0dc \
--color=marker:#b4befe,fg+:#cdd6f4,prompt:#cba6f7,hl+:#f38ba8 \
--color=selected-bg:#45475a \
--multi"
# Tools
eval "$(zoxide init zsh --cmd cd)"
# fzf keybindings: ctrl-r history search, ctrl-t file picker, alt-c cd.
source <(fzf --zsh)
# devenv auto-activation: cd into a project with devenv.nix and drop
# into its shell. Guarded: dotfiles deploy by symlink on save, but the
# devenv binary only lands on PATH after a rebuild.
command -v devenv >/dev/null && eval "$(devenv hook zsh)"
# ESP32 Xtensa toolchain, generated by espup install.
[ -f "$HOME/export-esp.sh" ] && . "$HOME/export-esp.sh"
# Aliases
alias ls="eza --tree --level 1 --icons=always"
alias vim="nvim"
alias cat="bat"
alias fbranch='git branch | cut -c 3- | gum filter | xargs -I {} git switch {}'
alias ccbranch='git branch | grep "*" | cut -c 3- | tr -d "\n" | wl-copy'
alias dbranch='git branch | cut -c 3- | gum choose --no-limit | xargs -I {} git branch -D {}'
alias fuckit="git reset --hard HEAD"
alias ngrok="op plugin run -- ngrok"
# Fun (only tools that are actually installed)
alias aquarium="asciiquarium"
alias wisdom="fortune | cowsay"
# Functions
intj() { idea "${1:-.}" &>/dev/null &disown; }
use-java() { nix shell "nixpkgs#temurin-bin-${1}" -c "$SHELL"; }
# Prompt (must be last)
eval "$(starship init zsh)"rawcurl -sL https://wihan.dev/configs/zsh
""" Map leader to space ---------------------
let mapleader=" "
""" Plugins --------------------------------
set surround
set multiple-cursors
set commentary
set argtextobj
set easymotion
set textobj-entire
set ReplaceWithRegister
" Highlight copied text (no `set` shorthand for this one)
Plug 'machakann/vim-highlightedyank'
""" Plugin settings -------------------------
let g:argtextobj_pairs="[:],(:),<:>"
""" Common settings -------------------------
set showmode
set scrolloff=5
set incsearch
set nu
""" Idea specific settings ------------------
set ideajoin
set ideastatusicon=gray
set idearefactormode=keep
set visualbell
set noerrorbells
""" Mappings --------------------------------
map <leader>f <Plug>(easymotion-s)
map <leader>e <Plug>(easymotion-f)
""" Toggle relative line numbers
map <leader>rn :set relativenumber!<CR>
map <leader>R <Action>(RenameElement)
map <leader>c <Action>(Stop)
map <leader>z <Action>(ToggleDistractionFreeMode)
map <leader>s <Action>(SelectInProjectView)
map <leader>a <Action>(Annotate)
map <leader>h <Action>(Vcs.ShowTabbedFileHistory)
map <S-Space> <Action>(GotoNextError)
map <leader>b <Action>(ToggleLineBreakpoint)rawcurl -sL https://wihan.dev/configs/ideavim