覆盖语言设置



我发现了这个特定的文件,它可以定义特定语言中括号等的行为: https://code.visualstudio.com/api/language-extensions/language-configuration-guide

我想简单地配置在 LaTeX 文档中所选文本之前和之后添加"$",例如使用"alt+$"键绑定。

到目前为止,我不清楚如何做到这一点,即使我偶然发现了文档页面。 (例如 https://code.visualstudio.com/api/references/contribution-points#contributeslanguages(。

我认为你可以简单地在keybindings.json中做到这一点,但似乎你不能(或者我不知道怎么做(。 知道吗?

如果我理解正确,请尝试以下代码片段:

{ 
"key": "shift+alt+4",
"command":  "editor.action.insertSnippet",
"args": {
"snippet": "$${TM_SELECTED_TEXT}$"
},
"editorLangId == latex"
},

有关放置该代码段的位置,请参阅 https://code.visualstudio.com/docs/editor/userdefinedsnippets#_create-your-own-snippets

似乎你不能直接使用alt+$shift+alt+4但这是一回事。

最新更新