How to find command by pressing keybinding in VSCode

前端 未结 2 985
囚心锁ツ
囚心锁ツ 2021-02-19 03:29

I\'m looking for a way for VS Code to tell me the command name for a keybinding.

In Emacs, this functionality is available under describe-key (C-h k

相关标签:
2条回答
  • 2021-02-19 03:56

    As of the September 2018 release, VSCode can do this from the keyboard shortcuts window.

    From the keyboard shortcuts window (cmd+k cmd+s), type cmd+option+k or click the keyboard icon on the right.

    Kudos to this comment linking to this approach as an answer to another question.

    0 讨论(0)
  • 2021-02-19 04:16

    You can find the command associated with a key binding by typing the keybinding into the Keyboard Shortcuts search box:

    Unfortunately, per the source code, the vim extension doesn't use this mechanism to bind the o key.

    Fortunately, it does let you rebind the keys in settings. First, open settings (F1 Preferences: Open Settings), then add (to bind i, for example):

    "vim.normalModeKeyBindingsNonRecursive": [
        "before": ["i"],
        "after": ["o"]
    ],
    

    If you have the new settings UI, you might need to search for vim.normalModeKeyBindingsNonRecursive first, and then click Edit in settings.json.

    0 讨论(0)
提交回复
热议问题