Home > database >  Is there a simple way to remove brackets etc from a selection?
Is there a simple way to remove brackets etc from a selection?

Time:09-02

In PyCharm I love how smart-keys means I can select an element and then type "[" to surround the selection in brackets (and also parentheses, quotes, braces).

Is there an a way to do the opposite - i.e highlight an element and then remove surrounding brackets etc?

I have already searched Google and Stack Overflow, as well as the PyCharm settings for smartkeys etc for solutions and I see some very old questions about it, but can't find an answer that doesn't boil down to regex or macros...

I'd like to remove surrounding brackets etc from a selection in PyCharm, and I have looked in the product's own settings and searched online.

CodePudding user response:

You're out of luck, by default PyCharm doesn't have the feature of removing brackets from around a code block or line segment. You can check the Smart Keys functionalities in the documentation or in the IDE by going to Settings/Preferences > Editor > General > Smart Keys but the functionality you want just isn't there.

but can't find an answer that doesn't boil down to regex or macros...

And you're not going to find one because the IDE doesn't provide the functionality. You would have to implement it using the live template variables or as an external tool.

I searched the JetBrains marketplace for the expectable keywords but aside of a couple of plugins that come close there isn't one that does what you want.

  • Related