Markdown链接的VSCode中的键盘快捷键? [英] Keyboard shortcut in VSCode for Markdown links?

查看:59
本文介绍了Markdown链接的VSCode中的键盘快捷键?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我习惯于使用其他文本编辑器添加Markdown链接

  1. 选择我要链接的词,
  2. 按下Mac/iPad Pro键盘上的cmd-K,将方括号放在标记的单词周围,并在其后面加上一对普通括号(),然后将光标直接放在这两个括号之间的小括号中,这样我就可以
  3. 只需按cmd-V将剪贴板中的URL粘贴到正确的位置即可.

因此,选择-> cmd-K-> cmd-V是在Markdown文档中添加链接的不错而简短的序列,而cmd-K已成为在多个书写应用程序中添加链接的某种伪标准.

但是,在VSCode中是不可能的.但我很乐意使其成为可能.有任何想法吗?cmd-K绑定了(硬接线?)以监听下一次按键.但这不必是cmd-K.我可以学习另一个按键.但是我需要能够将附加文本(方括号和圆括号)放入文本并将光标移动到正确的位置.怎么样了?

非常感谢!

解决方案

该扩展名

只需选择您的链接并按 Ctrl+V 即可创建链接并插入剪贴板链接.

如果出于某种原因您不想使用此扩展名,则可以很容易地创建一个代码片段来完成您想要的操作.

from other text editors I'm used to adding Markdown links by

  1. selecting the word I want to be linked,
  2. pressing cmd-K on my Mac's / iPad Pro's keyboard, which puts square brackets around the marked word, appends a pair of normal parenthesis () and places the cursor right in beetween those two parenthesis so that I can
  3. just paste the URL I have in my clipboard into the right place by pressing cmd-V.

So, select -> cmd-K -> cmd-V is a nice and short sequence for adding links in a Markdown document and cmd-K has become some kind of pseudo standard for adding links in several writing apps.

However, in VSCode that's not possible. But I'd love to make it possible. Any ideas? cmd-K is (hard-wired?) bound to listen for a next key press. But it doesn't have to be cmd-K. I can learn another keystroke. But I need to be able to put additional text (square brackets and parenthesis) into the text and move the cursor to the right position. How's that done?

Thanks so much!

解决方案

This extension Markdown All In One looks like it does what you want in one step.

Paste link on selected text

Just select your link and hit Ctrl+V and it creates the link and inserts the clipboard link.

If for some reason you don't want to use this extension, it would be pretty easy to create a snippet to do what you want.

这篇关于Markdown链接的VSCode中的键盘快捷键?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆