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

How to map <leader>t to CMD+P (mac) #2552

Closed
nerdpad opened this issue Apr 19, 2018 · 5 comments

Comments

Projects
None yet
5 participants
@nerdpad
Copy link

commented Apr 19, 2018

I want to open the file picker when I hit <leader>t.

Leader is mapped:
"vim.leader": ","

VS Code default mapping for the command in question:
{
"key": "cmd+p",
"command": "workbench.action.quickOpenNavigateNextInFilePicker",
"when": "inFilesPicker && inQuickOpen"
}

What should be my config?

I have tried the following and few other combination and I can't get it to work.

  "vim.otherModesKeyBindings": [
    // file picker
    {
      "before": ["<leader>", "t"],
      "after": ["cmd+p"]
    }
  ]

Please let me know if this is even possible.

@dagadbm

This comment has been minimized.

Copy link

commented Apr 19, 2018

it is. don't map to vscode keybindinga but to commands. there is some examples of this in the readme

@nerdpad

This comment has been minimized.

Copy link
Author

commented Apr 25, 2018

I have tried that also, and it doesn't work for me.

    // file picker
    {
      "before": ["<leader>", "t"],
      "after": [],
      "commands": [
        {
          "command": "workbench.action.quickOpenNavigateNextInFilePicker"
        }
      ]
    }
@hmps

This comment has been minimized.

Copy link

commented Apr 25, 2018

This works for me:

        {
            "before": [
                "<leader>",
                "t"
            ],
            "after": [],
            "commands": [
                {
                    "command": "workbench.action.quickOpen",
                    "args": []
                }
            ]
        }

As far as I understand, the workbench.action.quickOpenNavigateNextInFilePicker is used to navigate to the next entry once the quick open pane is opened. The workbench.action.quickOpen can be used to open it.

@rbriank

This comment has been minimized.

Copy link

commented Jun 4, 2018

👍 This worked for me too. FYI, I had to restart vsc to get it to pick up the change.

@nerdpad

This comment has been minimized.

Copy link
Author

commented Jun 7, 2018

This works for me as well. Thank you for the suggestions. I just wish these shortcuts also worked without having to open a file (global in vscode).

@nerdpad nerdpad closed this Jun 7, 2018

@jpoon jpoon added the kind/question label Jul 15, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.