mirror of
https://github.com/prdlk/dotfiles.git
synced 2026-11-02 19:32:43 +00:00
config(fish): add fish completions for cli tools
This commit is contained in:
1 parent
b1fb6ee6fb
commit
7db95c2076
48 files changed
+2241
No files matched your search
@@ -0,0 +1,14 @@
|
||||
# PATH — runs for every shell (scripts need these too).
|
||||
# ~/.local/bin and ~/.cargo/bin are handled by inir-path.fish / rustup.fish.
|
||||
fish_add_path $HOME/.bun/bin
|
||||
fish_add_path $HOME/go/bin
|
||||
fish_add_path $HOME/.maestro/bin
|
||||
fish_add_path $HOME/.grok/bin
|
||||
fish_add_path $HOME/.opencode/bin
|
||||
fish_add_path -a $HOME/.foundry/bin
|
||||
fish_add_path -a $HOME/local/share/pnpm
|
||||
source $HOME/.atuin/bin/env.fish
|
||||
|
||||
# pnpm
|
||||
set -gx PNPM_HOME $HOME/.local/share/pnpm
|
||||
fish_add_path $PNPM_HOME/bin
|
||||
@@ -0,0 +1,46 @@
|
||||
# Environment — non-secret. Secrets live in conf.d/secrets.fish (gitignored).
|
||||
set -g fish_greeting
|
||||
|
||||
# Bottom-pinned prompt toggle (config.fish + functions/clear.fish).
|
||||
# 1 = pin prompt to the bottom of the terminal, 0 = default top prompt.
|
||||
# Respects an inherited value, so `FISH_BOTTOM_PROMPT=0 fish` opts out.
|
||||
set -q FISH_BOTTOM_PROMPT; or set -gx FISH_BOTTOM_PROMPT 0
|
||||
|
||||
# GPU (ROCm / HIP) — used by ML scripts, so set unconditionally.
|
||||
set -gx HSA_OVERRIDE_GFX_VERSION 11.5.0
|
||||
set -gx ROCR_VISIBLE_DEVICES 0
|
||||
set -gx HIP_VISIBLE_DEVICES 0
|
||||
|
||||
# Repo roots (ghq)
|
||||
set -gx GHQ_ROOT $HOME/Developer
|
||||
set -gx CODE_ROOT $HOME/Developer
|
||||
|
||||
# Git hosts (non-secret; tokens are in secrets.fish)
|
||||
set -gx GITEA_LOGIN code.sonr.org
|
||||
set -gx GITLAB_HOST git.sonr.org
|
||||
|
||||
set -gx BROWSER /usr/bin/brave-origin-nightly
|
||||
set -gx CHROME_EXECUTABLE /usr/bin/chromium
|
||||
# Puppeteer / CDP tools — chrome-headless-shell via @puppeteer/browsers,
|
||||
# symlinked from ~/.config/chrome-headless-shell/<version>/ into ~/.local/bin.
|
||||
# NOTE: omp's browser tool prefers detected system Chrome over this env var;
|
||||
# ~/.local/bin/google-chrome-stable shims its first detection candidate to the
|
||||
# same binary (and masks the broken /usr/bin/google-chrome wrapper).
|
||||
set -gx PUPPETEER_EXECUTABLE_PATH $HOME/.local/bin/chrome-headless-shell
|
||||
set -gx ZEAL_DOCSETS $HOME/.var/app/org.zealdocs.Zeal/data/Zeal/Zeal/docsets
|
||||
set -gx SHARP_IGNORE_GLOBAL_LIBVIPS 1
|
||||
|
||||
set -gx FZF_DEFAULT_OPTS "
|
||||
--height=~40%
|
||||
--layout=default
|
||||
--info=inline-right
|
||||
--border=rounded
|
||||
--prompt=' '
|
||||
--pointer='▶'
|
||||
--marker='✓'
|
||||
--color=fg:#ffffff,fg+:#ffffff,bg:-1,bg+:#3c4048
|
||||
--color=hl:#5ef1ff,hl+:#5ef1ff
|
||||
--color=info:#7b8496,header:#7b8496,border:#7b8496
|
||||
--color=prompt:#5ef1ff,pointer:#ffaecf,marker:#5eff6c,spinner:#f1ff5e
|
||||
--color=gutter:-1,query:#ffffff
|
||||
"
|
||||
@@ -0,0 +1,61 @@
|
||||
# Aliases
|
||||
|
||||
# Editors / file managers
|
||||
alias e nvim
|
||||
alias e.d 'cd ~/.config/dotstate/storage/Rogz/.config && yazi'
|
||||
alias e.f 'cd ~/.config/fish && yazi '
|
||||
alias e.k 'yazi ~/.config/kitty'
|
||||
alias e.n 'yazi ~/.config/niri'
|
||||
alias e.v 'yazi ~/.config/nvim/lua'
|
||||
alias e.y 'yazi ~/.config/yazi'
|
||||
alias e.t 'nvim ~/.config/tmux/tmux.conf'
|
||||
|
||||
alias hx 'helix'
|
||||
|
||||
# Quick directory jumps
|
||||
alias cdc 'cd /home/prad/.config && yazi'
|
||||
alias cdd 'cd /home/prad/Developer && yazi'
|
||||
alias cdk 'cd /home/prad/Documents/Knowledge && obsidian'
|
||||
alias cdl 'cd /home/prad/.local && yazi'
|
||||
alias cds 'cd /home/prad/.local/share/services && ls'
|
||||
alias cdw 'cd /home/prad/Downloads && yazi'
|
||||
|
||||
# Tools
|
||||
alias dd lazydocker
|
||||
alias gg lazygit
|
||||
alias ff 'exec fish'
|
||||
alias npx bunx
|
||||
alias cpy wl-copy
|
||||
alias pst wl-paste
|
||||
alias sm 'sudo micro'
|
||||
# q exits the shell; if this shell was spawned from yazi's own `q` bind
|
||||
# (`shell "$SHELL" --block`), also tell that yazi to quit so exiting
|
||||
# doesn't bounce back into the file manager.
|
||||
function q --description 'exit (and quit parent yazi)'
|
||||
if set -q YAZI_ID; and command -q ya
|
||||
ya emit quit 2>/dev/null
|
||||
end
|
||||
exit
|
||||
end
|
||||
alias sd 'ssh prad@192.168.1.68'
|
||||
alias oc opencode
|
||||
alias gop 'gh repo view --web'
|
||||
alias dss 'dotstate sync'
|
||||
alias fabric fabric-ai
|
||||
alias bk bead-kanban
|
||||
|
||||
alias sua 'shelly upgrade-all -n'
|
||||
|
||||
alias lc 'leetcode'
|
||||
alias tk 'task'
|
||||
|
||||
# Interactive-only: don't override `ls` for scripts.
|
||||
if status is-interactive
|
||||
# `clear` is functions/clear.fish (kitty scrollback + bottom-pinned
|
||||
# prompt) — don't alias it here, an alias would shadow the autoload.
|
||||
alias celar clear
|
||||
alias claer clear
|
||||
if command -v eza >/dev/null 2>&1
|
||||
alias ls 'eza --icons'
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,13 @@
|
||||
# Start or reuse a single ssh-agent shared across shells.
|
||||
# Respects an externally provided SSH_AUTH_SOCK (systemd unit, forwarding, keyring).
|
||||
if status is-interactive; and not set -q SSH_AUTH_SOCK
|
||||
set -l env_file $HOME/.ssh/agent.env.fish
|
||||
test -r $env_file; and source $env_file
|
||||
|
||||
# ssh-add exit 2 = no agent reachable (0/1 = agent alive)
|
||||
ssh-add -l >/dev/null 2>&1
|
||||
if test $status -eq 2
|
||||
ssh-agent -c | string replace -r '^setenv (\S+) (\S+);$' 'set -gx $1 $2' | string match -rv '^echo ' >$env_file
|
||||
source $env_file
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,26 @@
|
||||
# Tool initialization.
|
||||
# mise provides tool shims, so activate it for every shell (scripts included).
|
||||
mise activate fish | source
|
||||
|
||||
# Everything below spawns subprocesses or only matters for a prompt —
|
||||
# skip it for non-interactive shells to keep scripts fast.
|
||||
status is-interactive; or return
|
||||
|
||||
# Material You terminal colors generated from the wallpaper (quickshell).
|
||||
if test -f ~/.local/state/quickshell/user/generated/terminal/sequences.txt
|
||||
cat ~/.local/state/quickshell/user/generated/terminal/sequences.txt
|
||||
end
|
||||
|
||||
command -v starship >/dev/null 2>&1; and starship init fish | source
|
||||
command -v zoxide >/dev/null 2>&1; and zoxide init fish | source
|
||||
command -v entire >/dev/null 2>&1; and entire completion fish | source
|
||||
# television fuzzy finder — sourced BEFORE hishtory so hishtory keeps
|
||||
# ctrl-r; tv's default binds are curated in fish_user_key_bindings.
|
||||
command -v tv >/dev/null 2>&1; and tv init fish | source
|
||||
|
||||
# hishtory shell history
|
||||
test -f ~/.hishtory/config.fish; and source ~/.hishtory/config.fish
|
||||
|
||||
# unsloth studio python venv
|
||||
test -f ~/.unsloth/studio/unsloth_studio/bin/activate.fish
|
||||
and source ~/.unsloth/studio/unsloth_studio/bin/activate.fish
|
||||
@@ -0,0 +1,8 @@
|
||||
# Set the tmux/screen window name from $PWD (the ESC-k sequence).
|
||||
# fish_title() handles the regular terminal title; this targets multiplexers.
|
||||
status is-interactive; or return
|
||||
|
||||
function terminal_title --on-variable PWD
|
||||
printf '\033k%s\033\\' (prompt_pwd)
|
||||
end
|
||||
terminal_title
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
source "$HOME/.atuin/bin/env.fish"
|
||||
@@ -0,0 +1,3 @@
|
||||
# iNiR environment — auto-generated by setup install
|
||||
set -gx INIR_VENV "/home/prad/.local/state/quickshell/.venv"
|
||||
set -gx ILLOGICAL_IMPULSE_VIRTUAL_ENV "$INIR_VENV"
|
||||
@@ -0,0 +1,3 @@
|
||||
if not contains -- "/home/prad/.local/bin" $PATH
|
||||
set -gx PATH "/home/prad/.local/bin" $PATH
|
||||
end
|
||||
@@ -0,0 +1,28 @@
|
||||
set --query XDG_DATA_HOME || set --local XDG_DATA_HOME ~/.local/share
|
||||
set --query nvm_mirror || set --global nvm_mirror https://nodejs.org/dist
|
||||
set --query nvm_data || set --global nvm_data $XDG_DATA_HOME/nvm
|
||||
|
||||
function _nvm_install --on-event nvm_install
|
||||
test ! -d $nvm_data && command mkdir -p $nvm_data
|
||||
echo "Downloading the Node distribution index..." 2>/dev/null
|
||||
_nvm_index_update
|
||||
end
|
||||
|
||||
function _nvm_update --on-event nvm_update
|
||||
set --query --universal nvm_data && set --erase --universal nvm_data
|
||||
set --query --universal nvm_mirror && set --erase --universal nvm_mirror
|
||||
set --query nvm_mirror || set --global nvm_mirror https://nodejs.org/dist
|
||||
end
|
||||
|
||||
function _nvm_uninstall --on-event nvm_uninstall
|
||||
command rm -rf $nvm_data
|
||||
|
||||
set --query nvm_current_version && _nvm_version_deactivate $nvm_current_version
|
||||
|
||||
set --names | string replace --filter --regex -- "^nvm" "set --erase nvm" | source
|
||||
functions --erase (functions --all | string match --entire --regex -- "^_nvm_")
|
||||
end
|
||||
|
||||
if status is-interactive && set --query nvm_default_version && ! set --query nvm_current_version
|
||||
nvm use --silent $nvm_default_version
|
||||
end
|
||||
@@ -0,0 +1,42 @@
|
||||
# ~/.config/fish/conf.d/pnpm-filter.fish
|
||||
|
||||
# Shared helper: pick a workspace package name via gum filter
|
||||
function __pnpm_pick_pkg
|
||||
pnpm m ls --depth -1 --json 2>/dev/null \
|
||||
| jq -r '.[] | select(.name != null) | .name' \
|
||||
| gum filter --placeholder "Select package…" --height 12
|
||||
end
|
||||
|
||||
# pnpmf: add deps to a selected package
|
||||
# usage: pnpmf viem zod
|
||||
function pnpmf -d "pnpm add to a workspace package (gum filter)"
|
||||
set -l pkg (__pnpm_pick_pkg); or return
|
||||
gum spin --title "Adding $argv → $pkg" -- pnpm --filter $pkg add $argv
|
||||
end
|
||||
|
||||
# pnpmfd: add devDependencies
|
||||
function pnpmfd -d "pnpm add -D to a workspace package"
|
||||
set -l pkg (__pnpm_pick_pkg); or return
|
||||
gum spin --title "Adding (dev) $argv → $pkg" -- pnpm --filter $pkg add -D $argv
|
||||
end
|
||||
|
||||
# pnpmfr: remove deps
|
||||
function pnpmfr -d "pnpm remove from a workspace package"
|
||||
set -l pkg (__pnpm_pick_pkg); or return
|
||||
pnpm --filter $pkg remove $argv
|
||||
end
|
||||
|
||||
# pnpmfw: link a sibling workspace package (workspace:^)
|
||||
function pnpmfw -d "pnpm add --workspace sibling package"
|
||||
set -l pkg (__pnpm_pick_pkg); or return
|
||||
set -l dep (__pnpm_pick_pkg); or return
|
||||
pnpm --filter $pkg add $dep --workspace
|
||||
end
|
||||
|
||||
# pnpmfx: run a script in a selected package, script also picked via gum
|
||||
function pnpmfx -d "pnpm run script in a workspace package"
|
||||
set -l pkg (__pnpm_pick_pkg); or return
|
||||
set -l dir (pnpm m ls --depth -1 --json | jq -r ".[] | select(.name == \"$pkg\") | .path")
|
||||
set -l script (jq -r '.scripts | keys[]' $dir/package.json | gum filter --placeholder "Script…"); or return
|
||||
pnpm --filter $pkg run $script
|
||||
end
|
||||
@@ -0,0 +1 @@
|
||||
source "$HOME/.cargo/env.fish"
|
||||
Reference in new issue
Block a user