Skip to content

Instantly share code, notes, and snippets.

@incompletude
incompletude / fish_title.fish
Last active October 19, 2024 02:08
Fish Shell Title: display full path until a git root, then path relative to git root
function fish_title
set git_root (command git rev-parse --show-toplevel 2>/dev/null)
if test -n "$git_root"
set relative_path (string replace -- "$git_root" "" (pwd))
echo (basename $git_root)$relative_path
else
echo (pwd)
end
end