Skip to content
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

FR new option to add alias for less commands #447

Closed
backtabber opened this issue Oct 26, 2023 · 3 comments
Closed

FR new option to add alias for less commands #447

backtabber opened this issue Oct 26, 2023 · 3 comments

Comments

@backtabber
Copy link

backtabber commented Oct 26, 2023

Working on a non-latin keyboard, it becomes tedious to have to switch to English just to be able to quit via the q key. Perhaps it would be possible to map commands to other keys via an alias option, for example,

less --alias q 0 filename

which would allow one to quit using the zero key.

@gwsw
Copy link
Owner

gwsw commented Oct 26, 2023

Does the lesskey feature do what you want? Or are you asking for something different? See the "KEY BINDINGS" section in the less man page, and the lesskey man page for details.

@backtabber
Copy link
Author

In fact, the lesskey feature does a whole lot more than I was asking for. Thanks.
However, it requires setting up a separate lesskey file, which may not always be convenient or even permissible in certain situations. Rather, I'm looking for a more portable solution, so that one may invoke a key binding from the command line itself.

@gwsw
Copy link
Owner

gwsw commented Nov 5, 2023

As of less-645, you can define command aliases using either the --lesskey-content command line parameter or the LESSKEY_CONTENT environment variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants