代码之家  ›  专栏  ›  技术社区  ›  alvitawa

禁用闭合支架吞咽?[副本]

  •  8
  • alvitawa  · 技术社区  · 8 年前

    ] , ) } 你输入那个字符,而不是插入它vscode只是经过那个字符,产生 ]*cursor here* ]*cursor here*] . 因此,每次我实际需要插入结束括号时,我都需要移动到 ))))

    Here 是同一个问题,但对于崇高的文本,和 this 盖伊提到这是自动闭合支架的副作用。

    3 回复  |  直到 8 年前
        1
  •  9
  •   CL. Wang    8 年前

    我从vscode项目的github收到了一个解决方案。
    keybindings.json 添加以下文本:

    {
    "key": "]",
    "command": "editor.action.insertSnippet",
    "when": "editorTextFocus",
    "args": {
        "snippet": "]"
    }
    },
    {
    "key": "Shift+]",
    "command": "editor.action.insertSnippet",
    "when": "editorTextFocus",
    "args": {
        "snippet": "}"
    }
    },
    {
    "key": "Shift+0",
    "command": "editor.action.insertSnippet",
    "when": "editorTextFocus",
    "args": {
        "snippet": ")"
    }
    }
    

    注意:对于en键盘:“Shift+0” ( ,根据键盘布局进行编辑。

        2
  •  4
  •   z0ppa    8 年前

    自动关闭支架 编辑器的设置。

    如果你去 &燃气轮机; 偏好 设置 编辑 自动关闭 “如果您想更改/禁用条目,请将其复制到您的用户设置中(默认情况下已启用),或者只需复制此项即可将其禁用:

    // Controls if the editor should automatically close brackets after opening them
    "editor.autoClosingBrackets": false,
    

    有关VS代码设置的更多信息以及默认设置的列表可以在此处找到: https://code.visualstudio.com/docs/getstarted/settings

    • 你必须键入每个右括号或自己引用。
    • 通过选择所选文本并只键入一个括号/引号,您将无法自动用括号或引号将其括起来。禁用此选项后,所选文本将替换为您键入的任何文本。
        3
  •  0
  •   niryo    7 年前

    我问了同样的问题 here .

    repo