dotfiles
- 28 commits
- 1 branch
- 0 tags
- updated
- CI 1/1
.bashrc
2.8 KB · 48 lines
1# ========================= personal config =========================2# ---- environment ------------------------------------------------------------3export EDITOR=hx # helix as default editor4export VISUAL=hx5export COLORTERM=truecolor # ssh drops this; bat, delta and helix need it for exact colors67# ---- path -------------------------------------------------------------------8export PATH="$HOME/go/bin:$PATH" # tools from `go install`910# ---- aliases ----------------------------------------------------------------11# LS_COLORS= stops Ubuntu's dircolors from overriding the eza theme12alias ll='LS_COLORS= eza -al --group-directories-first --icons --git --header --classify=auto'13alias lt='LS_COLORS= eza --tree --level=2 --icons --git-ignore'14alias cat='bat'1516# ---- tools ------------------------------------------------------------------17eval "$(~/.local/bin/mise activate bash)" # puts bat, eza, fzf, helix, zoxide... on PATH1819# ---- fzf --------------------------------------------------------------------20export FZF_DEFAULT_OPTS_FILE="$HOME/.config/fzf/fzfrc" # colors follow the Warp theme21__fz_skip=".git,node_modules,.venv,target,dist,.cache"22__fz_preview='if [ -d {} ]; then eza --tree --level=2 --icons=always --color=always --group-directories-first {}; else bat --color=always --style=numbers --line-range=:300 {}; fi'23export FZF_CTRL_T_OPTS="--walker=file,dir,follow,hidden --walker-skip=$__fz_skip --preview '$__fz_preview'"24export FZF_ALT_C_OPTS="--walker=dir,follow,hidden --walker-skip=$__fz_skip --preview 'eza --tree --level=2 --icons=always --color=always --group-directories-first {}'"2526# fzf's Ctrl-T / Ctrl-R / Alt-C keys: off, since Warp handles keys over ssh.27# Uncomment if you connect from Zed's terminal instead.28# eval "$(fzf --bash)"2930# fe [dir]: pick file(s) with a preview and open them in helix31fe() {32 local files=()33 mapfile -t files < <(fzf --multi --walker=file,follow,hidden --walker-skip="$__fz_skip" \34 --walker-root="${1:-.}" --preview "$__fz_preview")35 (( ${#files[@]} )) && ${EDITOR:-hx} "${files[@]}"36}3738# fcd [dir]: pick a folder below the current one and cd into it39fcd() {40 local dir41 dir=$(fzf --walker=dir,follow,hidden --walker-skip="$__fz_skip" --walker-root="${1:-.}" \42 --preview 'eza --tree --level=2 --icons=always --color=always --group-directories-first {}') && cd "$dir"43}4445# ---- zoxide (keep last) -----------------------------------------------------46# z <name> jumps to a folder you've visited, zi opens a picker47export _ZO_FZF_OPTS="--exact --no-sort --cycle --keep-right --info=inline-right --layout=reverse --tabstop=1 --exit-0 --bind=ctrl-z:ignore,btab:up,tab:down --preview='eza --tree --level=2 --icons=always --color=always --group-directories-first {2..}' --preview-window=down,40%"48eval "$(zoxide init bash)"