refactor(fish): use command -q, group aliases, add mise config
- Replace test -x / command -qv with command -q for consistency - Move mise/direnv/zoxide/fzf init to top of interactive block - Group related aliases into if blocks - Remove redundant vim/vi->v aliases (nvim handles EDITOR) - Fix fabric alias: fabric-ai -> fabric - Add config/mise/config.toml with tool definitions - Swap realpath/nvim check order in script/v
This commit is contained in:
+39
-49
@@ -20,46 +20,55 @@ if status is-interactive
|
||||
# fish_config theme choose "kanagawa"
|
||||
# fish_config theme choose "Dracula"
|
||||
|
||||
command -qv nmcli && alias nmlist "nmcli device wifi list"
|
||||
command -qv tree && alias tree "tree -L 3 -a -I '.git' --charset X "
|
||||
command -qv tree && alias dtree "tree -L 3 -a -d -I '.git' --charset X "
|
||||
|
||||
command -qv wl-copy && alias cwd "wl-copy \$(pwd)"
|
||||
command -qv wl-copy && alias cc "wl-copy \$(echo \$history[1])"
|
||||
|
||||
command -qv fabric-ai && alias ai "fabric-ai -p \$(fabric-ai -l | fzf)"
|
||||
command -qv xdg-open && alias o "xdg-open"
|
||||
|
||||
command -qv lazygit && alias lg lazygit
|
||||
|
||||
if command -qv nvim;
|
||||
if ! command -qv ~/.local/bin/v;
|
||||
alias v nvim
|
||||
end
|
||||
alias vim v
|
||||
alias vi v
|
||||
alias mini "NVIM_APPNAME=mini.nvim nvim"
|
||||
set -gx EDITOR nvim
|
||||
end
|
||||
if command -qv vim;
|
||||
alias vi vim
|
||||
alias v vim
|
||||
set -gx EDITOR vim
|
||||
if command -q mise
|
||||
/usr/bin/mise activate fish | source
|
||||
end
|
||||
|
||||
command -qv jj && alias rev "jj log -G -T 'commit_id.short(8)'"
|
||||
if command -q direnv
|
||||
/usr/bin/direnv hook fish | source
|
||||
end
|
||||
|
||||
if command -qv shred
|
||||
if command -q zoxide
|
||||
/usr/bin/zoxide init fish | source
|
||||
end
|
||||
|
||||
if command -q fzf
|
||||
/usr/bin/fzf --fish | source
|
||||
alias zk="nvim \$(fzf --walker=file --walker-root=/home/sjb/Documents/nca-notes/ --preview 'bat --color=always -n --line-range :500 {}')"
|
||||
#set -gx FZF_CTRL_T_OPTS "--preview 'bat --color=always -n --line-range :500 {}'"
|
||||
#set -gx FZF_ALT_C_OPTS "--preview 'eza --icons=always --color=always {} | head -200'"
|
||||
end
|
||||
command -q nmcli && alias nmlist "nmcli device wifi list"
|
||||
|
||||
if command -q tree
|
||||
alias tree "tree -L 3 -a -I '.git' --charset X "
|
||||
alias dtree "tree -L 3 -a -d -I '.git' --charset X "
|
||||
end
|
||||
|
||||
if command -q wl-copy
|
||||
alias cwd "wl-copy \$(pwd)"
|
||||
alias cc "wl-copy \$(echo \$history[1])"
|
||||
end
|
||||
|
||||
command -q fabric && alias ai "fabric -p \$(fabric-ai -l | fzf)"
|
||||
command -q xdg-open && alias o "xdg-open"
|
||||
command -q lazygit && alias lg lazygit
|
||||
|
||||
command -q nvim && set -gx EDITOR nvim
|
||||
|
||||
command -q jj && alias rev "jj log -G -T 'commit_id.short(8)'"
|
||||
|
||||
if command -q shred
|
||||
alias nuke "shred -u -n 1"
|
||||
end
|
||||
|
||||
if command -qv wt;
|
||||
if command -q wt
|
||||
alias wtc "wt switch --create --execute=$EDITOR"
|
||||
alias wts "wt switch"
|
||||
alias wtr "wt remove @"
|
||||
end
|
||||
|
||||
if command -qv /usr/bin/opencode;
|
||||
if command -q /usr/bin/opencode
|
||||
alias oc "opencode"
|
||||
end
|
||||
|
||||
@@ -74,26 +83,7 @@ if status is-interactive
|
||||
|
||||
set -gx VISUAL $EDITOR
|
||||
|
||||
if test -x /usr/bin/mise;
|
||||
/usr/bin/mise activate fish | source
|
||||
end
|
||||
|
||||
if test -x /usr/bin/direnv;
|
||||
/usr/bin/direnv hook fish | source
|
||||
end
|
||||
|
||||
if test -x /usr/bin/zoxide;
|
||||
/usr/bin/zoxide init fish | source
|
||||
end
|
||||
|
||||
if test -x /usr/bin/fzf;
|
||||
/usr/bin/fzf --fish | source
|
||||
alias zk="nvim \$(fzf --walker=file --walker-root=/home/sjb/Documents/nca-notes/ --preview 'bat --color=always -n --line-range :500 {}')"
|
||||
#set -gx FZF_CTRL_T_OPTS "--preview 'bat --color=always -n --line-range :500 {}'"
|
||||
#set -gx FZF_ALT_C_OPTS "--preview 'eza --icons=always --color=always {} | head -200'"
|
||||
end
|
||||
|
||||
if test -x /usr/bin/jj;
|
||||
if command -q jj
|
||||
/usr/bin/jj util completion fish | source
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
[settings]
|
||||
experimental = true
|
||||
|
||||
[tools]
|
||||
age = "latest"
|
||||
bun = "latest"
|
||||
"cargo:cargo-llvm-cov" = "latest"
|
||||
codex = "latest"
|
||||
copilot-cli = "latest"
|
||||
"github:ZinoKader/portal" = "latest"
|
||||
"github:danielmiessler/fabric" = "latest"
|
||||
"github:mrusme/reader" = "latest"
|
||||
"github:ulyssa/iamb" = "latest"
|
||||
herdr = "latest"
|
||||
neovim = "latest"
|
||||
node = "latest"
|
||||
"npm:@earendil-works/pi-coding-agent" = "latest"
|
||||
"npm:mermaid-cli" = "latest"
|
||||
"npm:pi-acp" = "latest"
|
||||
opencode = "latest"
|
||||
pi = "latest"
|
||||
tree-sitter = "latest"
|
||||
worktrunk = "latest"
|
||||
Reference in New Issue
Block a user