Vscode-markdown: Need add link shotcut

Created on 23 Jul 2018  ·  7Comments  ·  Source: yzhang-gh/vscode-markdown

I can't find add link shotcut key in readme.md, Thank you!

Question

Most helpful comment

Because of a limitation of vscode extension, we cannot register such a keybinding for you. You need to press ctrl/cmd?+shift+p and execute command Preference: Open Keyboard Shortcuts File. And then copy this

{
    "command": "editor.action.insertSnippet",
    "args": {
        "snippet": "[$TM_SELECTED_TEXT]($0)"
    },
    "key": "ctrl+l", // or "cmd+l" on Mac
    "when": "editorTextFocus && editorLangId == 'markdown'"
}

into the file keybindings.json in the right side.

Then it will work.

All 7 comments

Please see more information at #20.

My environment is VS Code 1.23.1,Mac 10.13.6, I either try 'Command + L' or 'Control + L',it dosn't work. Is this feature dosn't support Mac? Could you add a whole key-shotcut list for mac and windows in readme.md?

Because of a limitation of vscode extension, we cannot register such a keybinding for you. You need to press ctrl/cmd?+shift+p and execute command Preference: Open Keyboard Shortcuts File. And then copy this

{
    "command": "editor.action.insertSnippet",
    "args": {
        "snippet": "[$TM_SELECTED_TEXT]($0)"
    },
    "key": "ctrl+l", // or "cmd+l" on Mac
    "when": "editorTextFocus && editorLangId == 'markdown'"
}

into the file keybindings.json in the right side.

Then it will work.

Thank you!Got it!👍

This was super helpful, thanks! I'll suggest one change a friend recommended to me (@dwells). If you have a link copied to the clipboard first then this version will paste the link in, saving a little more time:

{
   "command": "editor.action.insertSnippet",
   "args": {
       "snippet": "[$TM_SELECTED_TEXT]($CLIPBOARD)"
   },
   "key": "ctrl+l", // or "cmd+l" on Mac
   "when": "editorTextFocus && editorLangId == 'markdown'"
}

Only change $0 to $CLIPBOARD. Thanks again.

Thanks for the information. Actually, it is now a built-in feature since v2.1.0.

paste

Excellent, thanks!

Was this page helpful?
0 / 5 - 0 ratings