Fork me on GitHub
Garrett Hopper01:07:34

@arrdem Ha, I'll add it to my list. 😉

Garrett Hopper01:07:53

The benefit of alter-meta! is that if others are using the spec, it will work for them too. Does anything like cljfmt use this spec?


Not at present. There's a years old ticket to make cljfmt support CIDER's indent specs or otherwise get some commonality.

Garrett Hopper02:07:37

Oh nice, it appears there's been some progress recently:

Garrett Hopper02:07:25

Depending on how that ends up getting the metadata, it may be best not to have a custom set variable in Emacs.


I'm extremely not holding my breath for that. Static analysis of Clojure is more effort than it's worth. Especially for something like symbol metadata.


@arrdem this metadata tends to be placed inline, which means that this might actually work.


I still think this is one of the most reasonable approaches to be specifying indentation. And I’m still optimistic that more editor are going to support this.


@dominicm Does vim support this?


Support what exactly?


Indenting code based on indentation metadata.


I guess it’s just a matter of generating indentation rules on the fly as we do in Emacs. Based on your reaction I guess the answer currently is “no”. 🙂


I'm waiting for the format code op in cider to support it. It's not currently supported though, no. I'd need to make some breaking changes to vim things, and I'm not sure I can. Haven't looked hard though.


Honestly if we asked Colin if he would be open to support this we would have 85% of clojure editors it seems. At that point it doesn't matter what anyone on the clojure side says


Yeah, that’s probably true. @U0567Q30W What do you think about this?


@dominicm So, I guess you need then. Isn’t it possible to extend the indentation rules for vim on the fly as we do for Emacs?


I think I can do that, I'm just lazy.


Cursive doesn’t support this right now, but it’s something I’ve been meaning to look at. I suspect it should be possible (and hopefully relatively easy) but there are always tricky edges around things like comments and metadata.


I’m assuming most people would just put those directly in the definitions, so probably you’d be able to get them easily with whatever parser you’re using for the static analysis in Cursive. What are problems you refer to with the comments?


That they can appear anywhere, and have to be treated specially. Metadata is similar, it can appear anywhere, and has its own alignment rules as well as affecting alignment of the form it’s attached to.