Disable closing parenthesis closing?

If you have a cursor before ], )or }, and you enter this character, instead of pasting it, vscode simply moves past that character, creating ]*cursor here*instead ]*cursor here*]. Dwell on this, every time I really need to insert a closing bracket, I need to move to the end ))))to type it, instead of just typing it directly. So, is there a way to disable this behavior (without disabling automatic parentheses completion)?

Here is the same question, but for a sublime text and this guy mentions this as a side effect of auto-closing brackets.

+4
source share
2 answers

I got a solution from github vscode project.
It works for me. Change yours keybindings.json, add the text below:

{
"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": ")"
}
}

Note: "Shift + 0" for the keyboard (, edit it to layout the keyboard.

+4
source

This is really a side effect of installing the autoClosingBrackets editor.

If you go to File > Settings > Settings to open the JSON file settings, you can search for "editor" or "autoClosing" and copy the entry to your user settings if you want to change / disable it (it is turned on by default) or just copy it to disable it:

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

VS, : https://code.visualstudio.com/docs/getstarted/settings

:

  • , .
  • () "".
  • .
  • , /. , , .
+1

Source: https://habr.com/ru/post/1686974/


All Articles