xlzyxxn

vscode 如何自动完成语句并插入分号

  •  
  •   xlzyxxn · Jun 5, 2024 · 2055 views
    This topic created in 912 days ago, the information mentioned may be changed or developed.

    最近想用用 vscode ,之前一直用的 jetbrains 系列,所以有几个快捷键想问问各位大佬

    1 、在 jetbrains 系列中是 crtl + shift + 回车,会自动补全花括号或分号,vscode 中的快捷键是啥?

    2 、vscode 怎么像 jetbrains 中那样.if 回车

    3 replies  •  2024-06-06 09:45:54 +08:00
    xlzyxxn
    xlzyxxn
    OP
    Jun 5, 2024
    1
    大家都是用的啥 IDE 啊,没有用 vscode 的大佬吗
    jazzg62
    jazzg62
    Jun 5, 2024
    2
    1. 花括号和括号这种成对的符号,输入的时候就是自动补全的。不是每个语言都是需要以分号结尾的,如果你配置了格式化的规则,或者用了这个语言的插件,那用格式化命令 ctrl+shift+f 应该能自动补全分号

    2. 没深入用过 jetbrains ,.if 是什么呢,是代码片段那种吗
    xlzyxxn
    xlzyxxn
    OP
    Jun 6, 2024
    3
    @jazzg62 就是有时候可以不需要自己打空格、括号、花括号、分号、换行这些
    举个例子:
    ```js
    if (condition) {
    //do something
    }
    ```
    jetbrains 中可以直接敲`condition.if `然后回车或者 tab

    ```js
    if (condition1...conditionN) {
    //do something
    }
    ```

    jetbrains 中可以敲完`if (condition1...conditionN)`后 crtl + shift + 回车,就会自动补全花括号并换行
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1985 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 01:08 · PVG 09:08 · LAX 17:08 · JFK 20:08
    ♥ Do have faith in what you're doing.