This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-02-11
Channels
Very new to emacs/spacemacs.
(cursor indicated by |
in below samples)
I often find myself doing this:
1. I have a expr :
(defn example [val]
(do "something")
|(do "something else"))
2. press SPC k d x
to delete the second expr :
(defn example [val]
(do "something")
|)
Is there a way to auto-fix (format) the entire expression afterwards?
Right now what I do is d d
at this point. It's not that troublesome, just wondering.I use d d
myself which automatically updates the formatting (assuming https://practical.li/spacemacs/structural-editing/cleverparens/)
Otherwise I would save the file to update formatting (clojure-lsp format on save) or explicitly use the format menu, , =
to format the file or a selected region.
Or for this specific example,in normal mode k J
to go up a line and join the next line to the current.
The SPC k
smartparens menu is very powerful, although many of its commands can also be done with vim-style normal mode commands if that edit g style is more familiar