view dot_config/private_fish/functions/fish_right_prompt.fish @ 1045:7db5c9c8016f

feat: Add fzf cd history picker
author Zeger Van de Vannet <zeger@vandevan.net>
date Sat, 04 May 2024 11:47:05 +0200
parents 6ab26ddbf78d
children
line wrap: on
line source

function fish_right_prompt
    if not command -sq hg
        return 1
    end

    set -l root (fish_print_hg_root)
    or return 1

    # In stead of running this command, cat the branch and topic name from the .hg folder
    # echo (set_color yellow)(HGPLAIN= HGRCPATH= hg --config extensions.topic= log -r 'wdir()' --template='{fqbn}' 2>/dev/null) (set_color normal)
    set -l branch (cat $root/branch 2>/dev/null; or echo default)
    if set -l topic (cat $root/topic 2>/dev/null)
        set branch "$branch//$topic"
    end
    # TODO: add topic namespace when available

    echo (set_color green)"$branch "(set_color normal)
end