Skip to content
Discussion options

You must be logged in to vote

Hello @psi4j!

promptfmt is the variable controlling the looks of the path bar on the top. There is no need for any Go here, lf is designed to be expandable using shell scripts. You can archive something that looks like this

using the following configuration inside your lfrc file:

# update `promptfmt` when switching directories
cmd on-cd &{{
    dir="$PWD"
    if [[ $dir == "/" ]]; then
        prefix="\033[90m/"
        rest=""
    elif [[ $dir == "$HOME"* ]]; then
        prefix="\033[37m~"
        rest="\033[90m${dir#$HOME}/"
    else
        prefix="\033[90m${dir}/"
        rest=""
    fi
    prompt=$(printf '\033[31m \033[90m  \033[0m%s%s\033[0m%%f' "$prefix" "$rest")
    # connect…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by CatsDeservePets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants