Last active
March 22, 2025 11:07
-
-
Save BMPixel/3c15404aae8e561fd66697bd6a66e464 to your computer and use it in GitHub Desktop.
Wenbo's Fish Shell Config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Utilities function | |
set -U fish_greeting "" | |
function has | |
command -v $argv >/dev/null ^&1 | |
end | |
# Healthcheck function adapted for fish | |
function healthcheck | |
for plugin in zoxide direnv fzf bat eza fd tmux uv rg nvim starship | |
if has $plugin | |
echo "$plugin: ✅" | |
else | |
echo "$plugin: ❌" | |
end | |
end | |
end | |
has zoxide; and zoxide init fish --cmd cd | source | |
has direnv; and eval (direnv hook fish) | |
has uv; and eval (uv generate-shell-completion fish) | |
# Common aliases | |
alias l 'ls' | |
alias ll 'ls -l' | |
alias la 'ls -a' | |
alias grep 'grep --color=auto' | |
alias fgrep 'fgrep --color=auto' | |
alias egrep 'egrep --color=auto' | |
alias rm 'rm -i' | |
alias cp 'cp -i' | |
alias mv 'mv -i' | |
alias mkdir 'mkdir -p' | |
alias df 'df -h' | |
alias du 'du -h' | |
alias sctl 'systemctl' | |
alias jctl 'journalctl' | |
alias ssr 'sudo systemctl restart' | |
alias sst 'sudo systemctl start' | |
alias sss 'sudo systemctl status' | |
alias ssj 'sudo journalctl -xeu' | |
alias ssp 'sudo systemctl stop' | |
has code; and alias c "code" | |
has cursor; and alias c "cursor" | |
has nvim; and alias vim "nvim" | |
has docker-compose; and alias dc "docker-compose" | |
# Initialize plugins | |
has zoxide; and zoxide init fish --cmd cd | source | |
has eza; and alias ls 'eza'; and alias tree 'eza --tree' | |
has fzf; and fzf --fish | source | |
test -f ~/.fzf.fish; and source ~/.fzf.fish | |
has direnv; and direnv hook fish | source | |
has uv; and uv generate-shell-completion fish | source | |
has uvx; and uvx --generate-shell-completion fish | source | |
has vim; and set -x EDITOR "vim" | |
has nvim; and set -x EDITOR "nvim" | |
has starship; and starship init fish | source |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment