Custom path style integrations #1730
-
Beta Was this translation helpful? Give feedback.
Answered by
CatsDeservePets
Jul 16, 2025
Replies: 1 comment
-
|
Hello @psi4j!
using the following configuration inside your # 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 to `lf` using remote command
lf -remote "send $id : set promptfmt \"$prompt\""
}}
# also update it on launch
cmd on-init :{{
on-cd
}} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
CatsDeservePets
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Hello @psi4j!
promptfmtis the variable controlling the looks of the path bar on the top. There is no need for anyGohere,lfis designed to be expandable using shell scripts. You can archive something that looks like thisusing the following configuration inside your
lfrcfile: