Evil Safe Structural Editingλ︎
The Clojure layer also includes evil-cleverparens which ensures Clojure code structure is respected.
Safe structural editing in Evil normal state respects structural editing too, meaning the standard evil commands can be used for cutting and deleting text without breaking Clojure or Lisp code structures.
Safe structural editing is provided by the package evil-cleverparens which is included in the Clojure layer. By default this mode is not activated.
||Enable evil safe structural editing for the current buffer|
When enabled the symbol
🆂 is displayed in the mode-line.
Enable for all Clojure buffers by adding the following function in
Or to enable evil safe structural editing for all supported major modes, use this function instead:
Manually managing structureλ︎
Although it is not structural editing, in Evil you can delete to a particular character. Clojure code inside of
() can be deleted without deleting the closing
- Enter normal mode
- Move to the starting point of the text you wish to delete
d t )- delete everything up to, but not including the closing parenthesis