Delete matching parentheses, brackets, or braces
See original GitHub issue- VSCode Version: Code 1.16.1 (27492b6bf3acb0775d82d2f87b25a93490673c6d, 2017-09-14T16:38:23.027Z)
- OS Version: Windows_NT x64 6.3.9600
- Extensions: Extensions are disabled
Steps to Reproduce:
- Create a new file.
- Paste the following code:
var foo = (1 + bar) + baz;
. - Position the cursor before the first
(
. It and its matching parenthesis should highlight. - Hit the delete key.
- Only the first parenthesis is deleted.
It would be useful if the corresponding parenthesis, brace, or bracket were deleted when the targeted one was.
I see two ways to accomplish this:
- Add a shortcut for both backspace and delete that does the operation on the matching character.
- Automatically do the deletion. This could be an extension of the already-existing “editor.autoClosingBrackets” setting or (more likely) a new setting that governs this behavior.
Reproduces without extensions: Yes
Issue Analytics
- State:
- Created 6 years ago
- Reactions:76
- Comments:9
Top Results From Across the Web
How to quickly remove a pair of parentheses, brackets, or ...
I would do xf] , but it doesn't do paren-matching. Or, first do a manual paren-matching by % , then x followed by...
Read more >delete matching parentheses : r/vim - Reddit
i`m talking about parentheses, brackets, braces etc. when i type in vim something like <( )>, and then i want to erase them, ......
Read more >How to delete surrounding brackets? - Emacs Stack Exchange
Use up-list or backward-up-list to move forward or backward to the first enclosing bracket, then forward-list or backward-list to locate the ...
Read more >Auto-delete closing brackets after deleting opening brackets.
Currently we can select all between matching braces (Ctrl+Alt+B) and I think it wouldn't be too much of a leap to think that...
Read more >AHK Studio: Adding, Deleting Matching Braces, Brackets ...
In this review of AHK Studio I demonstrate how to easily Add, delete, manipualate matching braces in AHK StudioSee more tutorials on AHK ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This feature could be useful, but it could also be confusing and annoying, especially when editing code which already starts out with mismatched brackets. So it should absolutely be optional and off by default, or initially mapped to something other than plain Delete or Backspace.
Further, whether this new feature is active should be independent of whether editor.autoClosingBrackets is active.
@jkyeung Or it could be done like Atom Editor does it.
Bksp
for regular bahaviourC-Bksp
for matching parens behaviour