-
Notifications
You must be signed in to change notification settings - Fork 354
Ruler
Joe Lim edited this page Oct 21, 2025
·
1 revision
The ruler (statusbar) at the bottom can be customized using the ruler config file. The file is a Go template and follows its syntax. More details about the syntax can be found in the documentation.
Important
This feature is currently experimental, and must be enabled using set rulerfile true.
{{with .Message -}}
{{. -}}
{{else with .Stat -}}
{{.Permissions | printf "\033[36m%s\033[0m" -}}
{{with .LinkCount}} {{.}}{{end -}}
{{with .User}} {{.}}{{end -}}
{{with .Group}} {{.}}{{end -}}
{{.Size | humanize | printf " %5s" -}}
{{.ModTime | printf " %s" -}}
{{with .Target}} -> {{.}}{{end -}}
{{end -}}
{{.SPACER -}}
{{with .Keys}} {{.}}{{end -}}
{{with .Progress}} {{join . " "}}{{end -}}
{{with .Copy}} {{len . | printf "%s %d \033[0m" $.Options.copyfmt}}{{end -}}
{{with .Cut}} {{len . | printf "%s %d \033[0m" $.Options.cutfmt}}{{end -}}
{{with .Select}} {{len . | printf "%s %d \033[0m" $.Options.selectfmt}}{{end -}}
{{with .Visual}} {{len . | printf "%s %d \033[0m" $.Options.visualfmt}}{{end -}}
{{with .Filter}} {{join . " " | printf "\033[7;34m %s \033[0m"}}{{end -}}
{{printf " %d/%d" .Index .Total}}hidden={{.Options.hidden}}Note
Add set user_foo bar to the lfrc file.
foo={{.UserOptions.foo}}LF_LEVEL={{env "LF_LEVEL"}}left{{.SPACER}}middle{{.SPACER}}right{{printf "[%-8s][%8s]" "left" "right"}}{{printf "\033[4;31m%s\033[0m" "hello world"}}{{with .Stat -}}
{{.Path}}{{if .Target}} -> {{.Target}}{{end}}
{{else -}}
empty directory
{{end -}}{{$color := 32 -}}
{{if eq .Mode "VISUAL" -}}
{{$color = 34 -}}
{{end -}}
{{printf "\033[7;%dm %s \033[0m" $color .Mode}}{{with .Stat -}}
{{printf "\033[34m%s" (substr .Permissions 0 1) -}}
{{printf "\033[33m%s" (substr .Permissions 1 1) -}}
{{printf "\033[31m%s" (substr .Permissions 2 1) -}}
{{printf "\033[32m%s" (substr .Permissions 3 1) -}}
{{printf "\033[33m%s" (substr .Permissions 4 1) -}}
{{printf "\033[31m%s" (substr .Permissions 5 1) -}}
{{printf "\033[32m%s" (substr .Permissions 6 1) -}}
{{printf "\033[33m%s" (substr .Permissions 7 1) -}}
{{printf "\033[31m%s" (substr .Permissions 8 1) -}}
{{printf "\033[32m%s" (substr .Permissions 9 1) -}}
{{printf "\033[0m"}}
{{end -}}{{/* this is a comment */ -}}
this will be shown