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

Allow multipage navigation #7

Open
lidorshimoni opened this issue May 18, 2022 · 1 comment
Open

Allow multipage navigation #7

lidorshimoni opened this issue May 18, 2022 · 1 comment

Comments

@lidorshimoni
Copy link

what if I want a page for bash commands and another for docker and another for git?
I already implemented this, I added right and left arrows to switch between cheatsheets. also added page-down, page-up, end and home keys support. also made the search smarter.
ill probably make a merge request soon.

@plainas
Copy link
Owner

plainas commented May 18, 2022

Hi @lidorshimoni. Interesting you mentioned this as it something I thought about as a potential improvement the day I wrote icl.

A possible solution would be to allow the user to place an arbitrary number of text files on ~/.config/icl and accept the filename as a command line argument when launching icl. Of course, this flies a bit in the face of the snappiness of just using keybindings. Which is the core idea behind this tool: reducing the amount of key presses to the bare minimum, and do away with as much manual text input as possible.

Perhaps am option such as -a/--all would load all the files with commands, while the first non dashed command line argument would be used to specify a specific file. The user could organize their library in files such as docker.txt, 'git.txt', etc.
Or maybe a predefined default file, commands.txt for example, should load by default. This should probably be controlled via the provided shell scripts for each shell, so a user can easily customize the default behavior without touching the python program.

Anyways, I think your idea of browsing through other sections with arrow keys makes most sense. I certainly would use it. We can latter add some visual feedback indicating which page we are at. Perhaps just displaying the name on the bottom left with distinct colors. A popup menu to pick the page from a list would also provide intuitiveness and discoverability. But this probably is for a next iteration. I'll open a ticket to gather thoughts about it.

You are welcome to submit pull requests. The keybindings you mentioned can probably be merged right away. Changes on the search could be their own discussion. So please submit separate pull requests.

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

No branches or pull requests

2 participants