function removepath if test (count $argv) -lt 1 echo "Usage: removepath " return 1 end if set -l index (contains -i $argv[1] $PATH) set --erase --universal fish_user_paths[$index] echo "Removed '$argv[1]' from PATH." else echo "'$argv[1]' not found in PATH." end end