Giter VIP home page Giter VIP logo

Comments (11)

bmag avatar bmag commented on May 26, 2024

I don't have any new features in mind, but I there are some fixes and refinements that should be done, as you can see in the new issues I have opened.

As for how to show more keybindings, both the text scaling and the paging are valid options. In case of text scaling, it would probably require changes in calculating the dimensions of the window. Those changes could be non-trivial, but I'm willing to try it once we improve and fix some other issues. In case of the paging, we would need a user-friendly method of changing pages - a timer with a reasonable delay, a special key, or something else. Anyway, I think maybe we should let the code mature a bit before tackling this particular issue.

As for performance, I didn't notice any slowdown with guide-key, though it could be that I had slowdowns but didn't know the cause was guide-key. A problem I did have with guide-key, and some others as well, is that guide-key sometimes doesn't show all of the available keys. Currently, which-key also suffers a similar problem

from emacs-which-key.

justbur avatar justbur commented on May 26, 2024

Coming up with a reasonable way of showing all the keys is on my wish list too, but I think you're right about getting the code to a state where one page can be shown reliably first.

from emacs-which-key.

syl20bnr avatar syl20bnr commented on May 26, 2024

For the paging navigation I like the idea of having a list of key pairs containing:

  • < and >
  • left and right
  • up and down
  • n and p
  • [ and ]
  • etc...

Then we choose the first available pair given the current set of key bindings (available means that none of the keys in the pair belongs to the set), if we don't find anything then we have a fallback on the less intrusive solution (ie. the last pair in the list, the first being the most natural pair to navigate). Since the pair may change given the current set, we have to explicitly display a docstring somewhere showing the active keys for page navigation.

In the case where we need to override keys belonging to the set we'll have to do some black magic to intercept the pressed key and continue the key sequence. But I think that in a first implementation we can avoid this case by having enough pair diversity to handle a large number of different sets.

from emacs-which-key.

justbur avatar justbur commented on May 26, 2024

There should never really be more than a handful of pages. I was just thinking about binding one key like an f key to cycle through. I'm not sure I like that the key binding is dependent on the keys in the buffer which is dependent on the mode and the state in evil at least.

from emacs-which-key.

syl20bnr avatar syl20bnr commented on May 26, 2024

If only f is used then SPC f cannot be entered. The key to navigate the pages should not prevent any combination from working.

from emacs-which-key.

justbur avatar justbur commented on May 26, 2024

Sorry I meant a function key like f6. I understand the need to avoid
existing bindings
On Fri, Jul 10, 2015 at 7:39 PM Sylvain Benner [email protected]
wrote:

If only f is used then SPC f cannot be entered. The key to navigate the
pages should not prevent any combination from working.


Reply to this email directly or view it on GitHub
#14 (comment)
.

from emacs-which-key.

justbur avatar justbur commented on May 26, 2024

Although I guess the only difference with a regular binding is that it
would apply to every sub binding (or whatever the right way to say that is)
kind of like C-g
On Fri, Jul 10, 2015 at 7:49 PM Justin Burkett [email protected] wrote:

Sorry I meant a function key like f6. I understand the need to avoid
existing bindings
On Fri, Jul 10, 2015 at 7:39 PM Sylvain Benner [email protected]
wrote:

If only f is used then SPC f cannot be entered. The key to navigate the
pages should not prevent any combination from working.


Reply to this email directly or view it on GitHub
#14 (comment)
.

from emacs-which-key.

justbur avatar justbur commented on May 26, 2024

I think something like C-TAB might work. Sorry for the sequence of emails.
I tend to get ideas after I press send.
On Fri, Jul 10, 2015 at 7:55 PM Justin Burkett [email protected] wrote:

Although I guess the only difference with a regular binding is that it
would apply to every sub binding (or whatever the right way to say that is)
kind of like C-g
On Fri, Jul 10, 2015 at 7:49 PM Justin Burkett [email protected] wrote:

Sorry I meant a function key like f6. I understand the need to avoid
existing bindings
On Fri, Jul 10, 2015 at 7:39 PM Sylvain Benner [email protected]
wrote:

If only f is used then SPC f cannot be entered. The key to navigate the
pages should not prevent any combination from working.


Reply to this email directly or view it on GitHub
#14 (comment)
.

from emacs-which-key.

kaushalmodi avatar kaushalmodi commented on May 26, 2024

Would it be possible to use dynamic key bindings to navigate the pages?

which-key should be able to use any of the keys from F1 to F12. But based on the availability of that binding in the keymap that which-key is currently showing, the first key available of that 12 keys is used automatically. So that the use is not confused, which-key can display the exact key to be pressed to change the pages.

Let's say I have C-x <f1> bound to something but C-x <f2> is not bound to anything. Then when which-key displays the map for C-x, it displays something like Press f2 to change page..

On the other hand, let's say I do not have C-c <f1> bound to anything. Then when which-key displays the map for C-c, it displays something like Press f1 to change page..

Just an idea.. I do not know how to implement this.

from emacs-which-key.

justbur avatar justbur commented on May 26, 2024

I played around with this sort of thing a few days ago. It seems tricky though (even for a set change page key), because right now the code is just listening to the key sequences and not interacting with them. I think to add key bindings I would need to intercept incomplete key sequences, execute a command to change the page, then restore the old incomplete key sequence by faking it (or something to that effect). One of the issues was I wasn't able to change the keymap on the fly in a way that affects the current key-sequence (it wasn't picking up the change).

I could try to add a keybinding to every keymap ahead of time, but that's tricky too because I'd have to worry about keymaps being introduced and changed.

from emacs-which-key.

justbur avatar justbur commented on May 26, 2024

Closed in favor of starting newer focus threads

from emacs-which-key.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.