/ .config / fish / config.fish
config.fish
  1  if [ $TERM = linux ] && type -q yaft
  2  	exec yaft
  3  end
  4  if status is-login
  5  	if functions -q bass
  6  		bass source /etc/profile
  7  	else
  8  		echo "Bass isn't installed - you might have a hard time with the /etc/profile"
  9  	end
 10  end
 11  set -x GOPATH $HOME/.config/go
 12  fish_add_path -a $HOME/.cargo/bin
 13  fish_add_path -a $HOME/.radicle/bin
 14  fish_add_path -a $HOME/.luarocks/bin
 15  fish_add_path -a $HOME/.bin
 16  fish_add_path -a $GOPATH/bin
 17  function update_nvim -d "Update all nvim packages"
 18  	# https://github.com/RubixDev/mason-update-all#updating-from-cli
 19  	echo Update lazy.nvim plugins
 20  	nvim --headless "+Lazy! sync" +qa
 21  	echo
 22  	echo Update Mason packages
 23  	nvim --headless -c 'autocmd User MasonUpdateAllComplete quitall' -c 'MasonUpdateAll'
 24  end
 25  function make_eww_abbrs
 26  	abbr -ag ewd eww daemon
 27  	abbr -ag ewdd eww daemon --debug
 28  	abbr -ag ewl eww logs abbr -ag ewld eww logs --debug abbr -ag ewk eww kill
 29  	abbr -ag ewkd eww kill --debug
 30  	abbr -ag ewot eww open taskbar
 31  	abbr -ag ewotd eww open taskbar --debug
 32  	abbr -ag ewr eww reload
 33  	abbr -ag ewrd eww reload --debug
 34  end
 35  # Array indices in fish and lua start at one
 36  function workon -d "Open up an editor on the given project"
 37  	nvim ~/projects/$argv[1]
 38  end
 39  function workonc -d "Open up an editor on the given configuration dir"
 40  	nvim ~/.config/$argv[1]
 41  end
 42  function workons -d "Open up an editor on the given class"
 43  	nvim ~/Documents/school/Fall 2025/$argv[1]
 44  end
 45  alias ip "ip -color=auto"
 46  alias dotfiles "/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME"
 47  if status is-interactive
 48  	if type -q nvimpager
 49  		alias less nvimpager
 50  		if set -q NVIM || set -q VIM
 51  			# TODO: request a -R flag
 52  			set -x PAGER nvimpager -c
 53  			# set -x PAGER nvimpager -p -- -c '"syn off"'
 54  		else
 55  			set -x PAGER nvimpager
 56  		end
 57  	end
 58  	alias more less
 59  	alias vim nvim
 60  	alias pnpx 'pnpm dlx'
 61  	if type -q lsd
 62  		alias ls lsd
 63  		alias tree 'lsd --tree'
 64  	end
 65  	alias cls clear
 66  	abbr --add nivm nvim
 67  	abbr --add vnim nvim
 68  	abbr --add wo workon
 69  	abbr --add woc workonc
 70  	abbr --add wos workons
 71  	abbr --add dotf dotfiles
 72  	abbr --add dof dotfiles
 73  end
 74  function fish_greeting
 75  	if type -q fastfetch
 76  		fastfetch
 77  	end
 78  	set --local todofile ~/.todo
 79  	set --local lines (wc -l < $todofile)
 80  	set --local items (grep "^[^[:blank:]]" -c $todofile)
 81  	echo TODO: "($lines lines, $items items)"
 82  	head $todofile
 83  	echo -e \n$fish_greeting
 84  end
 85  
 86  set -gx WASMTIME_HOME "$HOME/.wasmtime"
 87  
 88  string match -r ".wasmtime" "$PATH" > /dev/null; or set -gx PATH "$WASMTIME_HOME/bin" $PATH
 89  if type -q nvim
 90  	set -x VISUAL nvim # Full screen editor
 91  	#set -x EDITOR "nvim -e" # Non-visual editor
 92  	set -x EDITOR $VISUAL # nvim will behave properly if it must be non-visual, afaik. lots of apps just use this variable to find the editor.
 93  	set -x GIT_EDITOR $VISUAL # Git uses vim otherwise.
 94  	if type -q git
 95  		git config --global merge.tool nvimdiff3
 96  		git config --global merge.conflictstyle diff3
 97  		git config --global mergetool.prompt false
 98  	end
 99  end
100  # Rustup seems to keep disapearing for months at a time....
101  if type -q rustup
102  	rustup completions fish > ~/.config/fish/completions/rustup.fish
103  end
104  if type -q starship
105  	starship completions fish > ~/.config/fish/completions/starship.fish
106  	starship init fish | source
107  end
108  if type -q pnpm
109  	set -gx PNPM_HOME "$HOME/.local/share/pnpm"
110  	set -gx PATH "$PNPM_HOME" $PATH
111  end
112  if type -q poetry
113  	poetry completions fish > ~/.config/fish/completions/poetry.fish
114  end