Using rulerfmt
to style the ruler
#1358
joelim-work
started this conversation in
General
Replies: 1 comment 1 reply
-
@joelim-work In general, I like the idea of introducing After |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
I had an idea to take the existing design of
statfmt
and apply it to styling the ruler as well, because the currentruler
option doesn't have any real support for customizing colors.So I wrote up an implementation for a new
rulerfmt
option (roughly written with limited testing), which works like below:%a
is the pressed keys%p
is the progress of file operations%s
is the number of files that are selected or being designated for cut/copied%f
shows is a filter is currently being applied%i
is the position of the cursor%t
is the number of files in the current directory%d
is the amount of free disk space remaining%{lf_<name>}
for the value of options (e.g.%{lf_selmode}
)%{lf_user_<name>}
for the value of user-defined options (e.g.%{lf_user_foobar}
)|
to divide the ruler into sectionsImplementation
Copy the following code into the
ui.drawStatLine
function (some other boilerplate code for adding a new option is required but not shown here):Example
lfrc
configuration (adapted from #1347 (comment)):The value of
rulerfmt
can be a bit long, but it should be possible to build it in a${{ ... }}
shell block which callslf -remote
at the end to set the value.Conclusion
This idea opens up more opportunities for customizing the ruler, especially the ability to apply styling and colors. I am not sure whether this will end up being merged, perhaps not since there is already a
ruler
option.In any case, I didn't spend too long hacking this proof of concept up, as the main ideas were already implemented in the
statfmt
option, and the experience was fun anyway.Beta Was this translation helpful? Give feedback.
All reactions