Cannot remove brackets in IntelliJ / Cursive

I am using IntelliJ / Cursive to write Clojure. I learned that the only way to erase the brackets is to completely erase the contents inside them, and only after that the brackets can be removed. For example, suppose I have the following code:

(list) 

and I want to remove only the opening bracket. As soon as I am in the backspace in the opening bracket, the IDE ignores this action. Only when I erase the word β€œlist” can the bracket be removed.

Does anyone know how to solve this?

+9
intellij-idea clojure cursive
source share
4 answers

From the docs :

Structural editing is enabled for Clojure code by default. If you do not like this, you can disable it in the menu "Settings" β†’ "Editor" β†’ "General" β†’ "Smart Keys" β†’ "Use structural editing". If you want to quickly turn it on and off, you can use the widget in the status bar at the bottom of the screen or use the action "Edit" β†’ "Structural editing" β†’ "Switch the style of structural editing." If you find yourself doing this a lot, you can even assign a keyboard shortcut to an action.

+14
source share

There is another way to remove braces using the "Splice Sexp" structure editing command. You can also use slurping and barfing to manipulate the bracket in the order you want.

+2
source share

You can remove parentheses while remaining in structural editing mode by first selecting / highlighting it with the cursor or the Shift + arrow. Then you will also need to manually remove the corresponding closing brackets.

+1
source share

He has recently been moved to Edit> Structural Editing> Switch Structural Editing Style.

0
source share

All Articles