if not status is-interactive exit end # xdg set -gx XDG_CONFIG_HOME "$HOME/.config" set -gx XDG_CACHE_HOME "$HOME/.cache" set -gx XDG_DATA_HOME "$HOME/.local/share" set -gx XDG_STATE_HOME "$HOME/.local/state" # fish set -gx FISH_CFG $XDG_CONFIG_HOME/fish set -g fish_greeting set -gx LANG "en_US.UTF-8" # home pollution fixes set -gx CARGO_HOME "$XDG_DATA_HOME/cargo" set -gx RUSTUP_HOME "$XDG_DATA_HOME/rustup" set -gx GOPATH "$XDG_DATA_HOME/go" set -gx GRADLE_USER_HOME "$XDG_DATA_HOME/gradle" set -gx GTK2_RC_FILES "$XDG_CONFIG_HOME/gtk-2.0/gtkrc" set -gx XCURSOR_PATH "/usr/share/icons:$XDG_DATA_HOME/icons" set -gx LESSHISTFILE "$XDG_STATE_HOME/less/history" set -gx NODE_REPL_HISTORY "$XDG_DATA_HOME/node_repl_history" set -gx NPM_CONFIG_USERCONFIG "$XDG_CONFIG_HOME/npm/npmrc" set -gx _JAVA_OPTIONS "-Djava.util.prefs.userRoot=$XDG_CONFIG_HOME/java" set -gx NUGET_PACKAGES "$XDG_CACHE_HOME/NuGetPackages" set -gx PASSWORD_STORE_DIR "$XDG_DATA_HOME/pass" set -gx PYTHONSTARTUP "/etc/python/pythonrc" set -gx W3M_DIR "$XDG_DATA_HOME/w3m" set -gx PNPM_HOME "$HOME/.local/share/pnpm" # program set -gx EDITOR "nvim" set -gx MANPAGER "nvim +Man!" set -gx MANWIDTH 999 set -gx PF_INFO "ascii title os wm editor shell kernel palette" set -gx BAT_THEME "ansi" set -gx LITE_SCALE 1.3 set -gx RANGER_LOAD_DEFAULT_RC "FALSE" # set -gx MANPATH /usr/local/texlive/2023/texmf-dist/doc/man set -gx INFOPATH /usr/local/texlive/2023/texmf-dist/doc/info # $PATH source $FISH_CFG/path.fish # colors source $FISH_CFG/colors.fish # bindings source $FISH_CFG/bindings.fish # configs source $FISH_CFG/done_cfg.fish # secrets source $FISH_CFG/secret.fish # abbreviations & aliases abbr -a paru paru --limit 10 abbr -a projects cd ~/Documents/RealProjects abbr -a gc git commit -m abbr -a ga git add abbr -a gcl git clone abbr -a pq pacman -Qqi abbr -a gt git log --oneline --graph --decorate --all alias imgcat="wezterm imgcat" alias dots="git --git-dir=$HOME/.dots --work-tree=$HOME" # alias sudo="doas" alias ls="ls --color=auto" alias grep="grep -P --color=always" alias wget="wget --hsts-file=$XDG_DATA_HOME/wget-hsts" alias stylua="stylua -s" alias cd="z" alias n="nvim ." function y set tmp (mktemp -t "yazi-cwd.XXXXXX") yazi $argv --cwd-file="$tmp" if set cwd (command cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ] builtin cd -- "$cwd" end rm -f -- "$tmp" end function ssh export TERM=xterm-color /usr/bin/ssh $argv export TERM=xterm-256color end function flac_preview nsxiv (ffmpeg -i $argv[1] -v 8 -t 30 -lavfi showspectrumpic=s=hd720 -f image2 pipe: | psub) # nsxiv (ffmpeg -i $argv[1] -v 8 -t 30 -lavfi showspectrumpic=s=2k -f image2 pipe: | psub) end function multicd echo (string repeat -n (math (string length -- $argv[1]) - 1) ../) end abbr -a dotdot --regex '^\.\.+$' --position anywhere --function multicd function last_history_item echo $history[1] end function post_exec_line --on-event fish_postexec if not string match -qr "^clear" $argv[1] echo "" end end abbr -a !! --position anywhere --function last_history_item # shell init fish_ssh_agent starship init fish | source zoxide init fish | source direnv hook fish | source function dl yt-dlp -v --download-archive "archive.txt" \ --write-info-json --write-thumbnail --embed-subs --embed-thumbnail --embed-metadata \ --merge-output-format "mkv" -f "bestvideo[height<=1080][width<=1920]+bestaudio" \ --abort-on-error -o "files/%(extractor_key)s%(id)s/item.%(ext)s" \ --extractor-args "youtube:player-client=default,mweb" $argv end function archive_website wget \ # Download the whole site. --recursive \ # Get all assets/elements (CSS/JS/images). --page-requisites \ # Save files with .html on the end. --adjust-extension \ # Include necessary assets from offsite as well. --span-hosts \ # Update links to still work in the static version. --convert-links \ # Modify filenames to work in Windows as well. --restrict-file-names=windows \ # Do not follow links outside this domain. --domains yoursite.com \ # Don't follow links outside the directory you pass in. --no-parent \ $argv # The URL to download end