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
Uh oh!
There was an error while loading. Please reload this page.
-
Description
I had an idea to take the existing design of
statfmtand apply it to styling the ruler as well, because the currentruleroption doesn't have any real support for customizing colors.So I wrote up an implementation for a new
rulerfmtoption (roughly written with limited testing), which works like below:%ais the pressed keys%pis the progress of file operations%sis the number of files that are selected or being designated for cut/copied%fshows is a filter is currently being applied%iis the position of the cursor%tis the number of files in the current directory%dis 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.drawStatLinefunction (some other boilerplate code for adding a new option is required but not shown here):Example
lfrcconfiguration (adapted from #1347 (comment)):The value of
rulerfmtcan be a bit long, but it should be possible to build it in a${{ ... }}shell block which callslf -remoteat 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
ruleroption.In any case, I didn't spend too long hacking this proof of concept up, as the main ideas were already implemented in the
statfmtoption, and the experience was fun anyway.Beta Was this translation helpful? Give feedback.
All reactions