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

Please provide a keybinding for whichkey.undoKey for when people set up VSpaceCode on intro screen #329

Open
lprior-repo opened this issue Jul 20, 2023 · 8 comments
Labels
enhancement New feature or request

Comments

@lprior-repo
Copy link

Problem

Please provide a keybinding for whichkey.undoKey for when people set up VSpaceCode on intro screen

Solution

Update keybinding file on the first setup for whichkey.undoKey.

Alternatives

Checking documentation looking for a back key
Checking tooling using ? to look for back or undo
Digging into VspaceCode website looking for keybinding

This will make it easier to look around without redo hit esc, ... or other various implementations.

or have to do ? search for command.

Both options work but don't provide an easy way to poke around for newer users of the ecosystem the tool is providing (spacemacs for example).

Additional context

If a user doesn't know what to search for it makes it easier to poke around the various key binds in VS Code and then go back.

Thank you for the awesome tool also! Makes it very easy to use overall keybindings and figure out needed keyboard-driven commands outside of VIM within VS Code. Also you all are killing it on the documentation front as well.

@lprior-repo lprior-repo added the enhancement New feature or request label Jul 20, 2023
@stevenguh
Copy link
Member

The back button on the top menu bar would work, but I agree it is not keyboard friendly. Do you any suggestion on which key we should bind to?

@lprior-repo
Copy link
Author

I'd go with u or b or similar.

@MarcoIeni
Copy link
Member

So this issue is about going back in the menu.
E.g. I press spc f, the I do "undo" and I'm back at the msin menu (spc).

b and u can conflict with other keys, right?

What about backspace?

@lprior-repo
Copy link
Author

That's perfect! Back to go back!

@stevenguh
Copy link
Member

b and u can conflict with other keys, right?

That's correct.

What about backspace?

One can bind this backspace with https://vspacecode.github.io/docs/whichkey/extra#use-non-character-keys. Then a user effective can't use this key.


In spacemacs, one can undo key via C-h u or ? u. I think we may able to something similar, but we likely need some UI to help when the user entered C-h or ?.

The UI part is the difficult part, which is why this command undoKey wasn't bound to any key.

For now, the workaround is bind that key manually using keybindings.json something like

    {
        "key": "backspace",
        "command": "whichkey.undoKey",
        "when": "whichkeyActive"
    },

@lprior-repo
Copy link
Author

What do you mean by the UI part is the hard part? Getting the menu update and go to previous screen on a 'ctrl +h' like hitting the GUI back arrow?

@stevenguh
Copy link
Member

When I say UI, I meant to emulate the help-char of emacs-which-key (https://github.com/justbur/emacs-which-key#method-1-default-using-c-h-or-help-char).

image

When a press C-h or ? only when those key are not bound, the green text appears as available options.

  • undo-key -> u or C-u key
  • help (= SPC ?) -> ?

There are however some idiosyncratic behaviors to this

  • C-h or ? only works when there isn't any key bound to them already
  • Once the green text appears, any other keys will exit this green text thing

Option 1: Keep it simple

  • Bind C-u to undoKey

Option 2: emulate C-h green text thing

  • This is where I think it is not too easy to emulate emacs-which-key behavior

@lprior-repo
Copy link
Author

I like option 1. Keep it simple and ctrl u works well. I'm not tied to any specific implementation if that is a factor or not.

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

No branches or pull requests

3 participants