Giter Club home page Giter Club logo

Comments (7)

jaidetree avatar jaidetree commented on June 24, 2024

and must contain whichKeyVisible which limits this shortcut to be only applicable when the which-key menu is visible

I think I missed that caveat. That said is there a way to trigger a submenu without which-key already visible?

from vscode-which-key.

jaidetree avatar jaidetree commented on June 24, 2024

Found one solution:

{
  "key": "shift+2",
  "command": "extension.multiCommand.execute",
  "args": {
    "sequence": [
      "vspacecode.space",
      { "command": "whichkey.triggerKey", "args": "@" },
    ],
  },
  "when": "!whichKeyVisible && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/"
},

It works! But downside is requires the multiCommand extension. If there's a cleaner way, I'd love to see a better solution

from vscode-which-key.

stevenguh avatar stevenguh commented on June 24, 2024

Let me make sure I understand the problem. You are trying to have @ to open the which-key menu that's equal to SPC w when the current editor is magit editor.

Your workaround is probably the best bet currently. I thought about adding keys sequence to the show API which is used by vspacecode.space so I user can bind a command to do exactly what you are trying to do.

from vscode-which-key.

stevenguh avatar stevenguh commented on June 24, 2024

Also, per buffer remapping in vim was mentioned on VSCodeVim/Vim#4765 (comment)

from vscode-which-key.

jaidetree avatar jaidetree commented on June 24, 2024

Let me make sure I understand the problem. You are trying to have @ to open the which-key menu that's equal to SPC w when the current editor is magit editor.

That’s correct.

Your workaround is probably the best bet currently. I thought about adding keys sequence to the show API which is used by vspacecode.space so I user can bind a command to do exactly what you are trying to do.

I’m willing to give a PR for that a shot if you’re open to it.

Will try the per-buffer remapping approach as well

from vscode-which-key.

stevenguh avatar stevenguh commented on June 24, 2024

I’m willing to give a PR for that a shot if you’re open to it.

Sure :) Let me know if you have any questions.

Will try the per-buffer remapping approach as well

Unfortunately, that's just a thread mentioning that functionality doesn't exist today.

from vscode-which-key.

jaidetree avatar jaidetree commented on June 24, 2024

I’m willing to give a PR for that a shot if you’re open to it.

Sure :) Let me know if you have any questions.

Great will do!

Will try the per-buffer remapping approach as well

Unfortunately, that's just a thread mentioning that functionality doesn't exist today.

Oh my mistake, I misunderstood there but your reply probably just saved me a good chunk of time 😅

from vscode-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.