skip to Main Content

I have a file "cheatcheet.md" in my documents directory. I would like to open it with a single keyboard shortcut (something unused like Ctrl+i n), instead of going into Menu > File > Open File… and navigate to file.

I have tried few suggestions in keybindings.json suggested by SO, but they either error out or do nothing.

2

Answers


  1. You can use the extension I wrote: HTML Related Links

    It has a command: htmlRelatedLinks.openFile

      {
        "key": "ctrl+i n",
        "command": "htmlRelatedLinks.openFile",
        "args": {
          "file": "${workspaceFolder}/cheatcheet.md",
          "method": "vscode.open"
        },
        "when": "editorTextFocus"
      }
    
    Login or Signup to reply.
  2. You can simply use this keybinding for vscode.open:

    {
      "key": "ctrl+i n",
      "command": "vscode.open",
      "args": "file:///C:/Program Files/Git/etc/bash.bashrc"
    }
    

    Note: use forward slashes.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search