vscode提示快捷鍵與輸入法沖突解決辦法


vscode提示快捷鍵是Ctrl + space(空格 ),但是Ctrl + space是系統輸入法切換快捷鍵,這樣就會有沖突
在vscode中按Ctrl + Shift + P 輸入key命令keyboard將以下JSON復制進入

// Place your key bindings in this file to override the defaultsauto[]
[
    {
        "key": "alt+oem_2",
        "command": "editor.action.triggerSuggest",
        "when": "editorHasCompletionItemProvider && textInputFocus && !editorReadonly"
    },
    {
        "key": "ctrl+space",
        "command": "-editor.action.triggerSuggest",
        "when": "editorHasCompletionItemProvider && textInputFocus && !editorReadonly"
    }
]

將快捷鍵重新設置后可以使用Alt + /Ctrl + I代碼提示建議

用戶代碼片段 設置-用戶代碼片段-vue.json中設置如下
vue3

{
  "vue3 setup": {
    "prefix": "vvs",
    "body": [
      "<script setup lang=\"ts\">",
      "import { ref, onMounted } from \"vue\";",
      "$1",
      "</script>",
      "<template>",
      "$2",
      "</template>",
      "<style lang=\"less\" scoped></style>"
    ],
    "description": "vue setup"
  },
  "vue3 base": {
    "prefix": "vv3",
    "body": [
      "<script lang=\"ts\">",
      "import { defineComponent } from \"vue\";",
      "export default defineComponent({",
      "  name: \"ComponentName\",",
      "  setup() {},",
      "});",
      "</script>",
      "<template>",
      "$1",
      "</template>",
      "<style lang=\"less\" scoped></style>"
    ],
    "description": "vue template"
  }
}


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM