VSpaceCode / VSpaceCode

Spacemacs like keybindings for Visual Studio Code

Home Page:https://vspacecode.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

lprior-repo opened this issue · comments

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.

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?

I'd go with u or b or similar.

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?

That's perfect! Back to go back!

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"
    },

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?

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

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.