-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When should I use the lesskey config file? #492
Comments
There's a certain amount of personal preference in choosing whether to define environment variables in your environment or in a lesskey file. It doesn't really matter, but I would make a couple of comments: If you need to support pre-582 versions then of course you need to run the lesskey program which can only be done outside the lesskey file, as you are doing. But it doesn't hurt to do it in later versions as well; running lesskey is not necessary in recent versions, but it is still supported. So you could remove the check for version < 582. For efficiency you might want to run lesskey only if the source file is newer than the binary file (using test -nt or something like that). You could set LESS_TERMCAP_vb unconditionally, in either your environment or in a lesskey file. If you use --no-vbell in less-615 or later, LESS_TERMCAP_vb is ignored so it doesn't matter whether it's set. So you could remove the check for version < 615 before setting it. I hope this helps. |
Thank you so much! These tips really clarify a lot for me, and I believe many others will benefit from seeing this issue 😄 |
Hi, thank you for your work and apologize if this is not a prope place for my question (but I really coudn't find an answer).
This is what I have for now. But it really looks redundant and I start having the question about the benefits of using lesskey config file compared to directly setting env vars (e.g.
LESS
) in my shell config file, especially when I want the backward compatibility and do tons of version check.In
.zshrc
:In
~/.config/less/lesskey
:Maybe I shouldn't use lesskey file at all if I don't want to remap anything? Any suggestions/explanations are appreciated!
The text was updated successfully, but these errors were encountered: