dotfiles-fish/config.fish

92 lines
2 KiB
Fish
Raw Normal View History

2024-10-25 11:48:49 +00:00
set fish_greeting ""
function filesize
for file in $argv
if [ -f "$file" ]
echo "$file: $(stat -c %s "$file" | numfmt --to=iec)"
else
echo "$file: not found"
end
end
end
function _fetch
if which ufetch > /dev/null 2>&1 && [ "$VSCODE_INJECTION" != "1" ]
ufetch
end
end
2024-12-12 08:22:16 +00:00
function _set_env
if [ "$TERM" = "foot" ] || [ "$TERM" = "xterm-kitty" ]
alias ssh="TERM=xterm-256color $(which ssh)"
alias gg="TERM=xterm-256color $(which gg)"
end
set -x VIRTUAL_ENV_DISABLE_PROMPT
set -x PF_INFO "ascii title os host kernel uptime memory de"
set -x FZF_DEFAULT_OPTS "\
--color=bg+:#1e1e2e,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"
2024-11-18 15:22:39 +00:00
end
2024-12-12 08:22:16 +00:00
function _set_aliases
if which eza > /dev/null 2>&1
alias ls="eza --icons=auto"
else if which exa > /dev/null 2>&1
alias ls="exa --icons=auto"
end
2024-10-25 11:48:49 +00:00
2024-12-12 08:22:16 +00:00
if which bat > /dev/null 2>&1
alias cat="bat"
else if which batcat > /dev/null 2>&1
alias cat="batcat"
end
2024-10-25 11:48:49 +00:00
2024-12-12 08:22:16 +00:00
if which python > /dev/null 2>&1
alias py="python"
end
2024-10-25 11:48:49 +00:00
2024-12-12 08:22:16 +00:00
if which distrobox-enter > /dev/null 2>&1
alias denter=distrobox-enter
end
2024-10-25 11:48:49 +00:00
2024-12-12 08:22:16 +00:00
if which nvim > /dev/null 2>&1
alias v "nvim"
alias V "sudoedit"
set -x EDITOR nvim
end
2024-10-25 11:48:49 +00:00
2024-12-12 08:22:16 +00:00
alias cdt "cd (mktemp -d)"
alias ":q" exit
end
2024-11-09 14:30:08 +00:00
2024-12-12 08:22:16 +00:00
function arm64cc-env
set -gx ARCH arm64
set -gx hardeningDisable all
set -gx CROSS_COMPILE aarch64-linux-gnu-
end
2024-10-25 11:48:49 +00:00
2024-12-12 08:22:16 +00:00
if which pyenv > /dev/null 2>&1
pyenv init - | source
end
2024-10-25 11:48:49 +00:00
2024-12-12 08:22:16 +00:00
if status is-interactive
bind \cl 'clear; _fetch; commandline -f repaint'
bind \cb btop
bind \cs 'source ~/.config/fish/config.fish'
2024-10-25 11:48:49 +00:00
2024-12-12 08:22:16 +00:00
if which zoxide > /dev/null 2>&1
zoxide init --cmd cd fish | source
end
if [ "$reload" = "" ]
_fetch
end
2024-10-25 11:48:49 +00:00
2024-12-12 08:22:16 +00:00
set reload "done"
_set_aliases
end
_set_env