Does anyone know of a way to align clojure map k/v pairs? I’ve used Tabularize for aligning other types of files, but I was hoping for something like clojure-align
in emacs’ clojure-mode
I don't think there's anything quite so semantically aware
Dang
Thank you, regardless :)
i just had a shower thought that https://github.com/borkdude/edamame could potentially be used to find the last column of every key in the map, determine what column every value should start on, and adjust the values accordingly
i guess you would also need to figure out what selection of text to send through edamame, or otherwise maybe parse the entire file and then somehow find where your cursor is in the output
Cljfmt has a pr to do this
Then gw will work
ah yes, that's right. i remember seeing that now
it's funny how a feature that feels so simple on the surface is actually so complex underneath 🙂
what's gw?
I’ve always used gq
, but:
gw{motion} Format the lines that {motion} moves over. Similar to
gq but puts the cursor back at the same position in
the text. However, 'formatprg' and 'formatexpr' are
not used.
@borkdude may be this explains gw
and gq
? https://vi.stackexchange.com/a/511
thanks!
I think I meant gq anyway :)
gw is great for comments, as those don't seem to do so well with gq