Fork me on GitHub
#vim
<
2021-12-14
>
sheluchin14:12:15

Any idea how to use vim's https://vimhelp.org/syntax.txt.html#conceal with Clojure's discard macro (`#_`) to shorten the presentation of discarded forms? Something along the lines of:

#_ (prn 1 2 3 4 5) => #_ (prn ...)
#_ [1 2 3 4 5] => #_ [1 2 ...]
#_ {:x 1 :y 2 :z 3} => #_ {:x ...}

noisesmith18:12:18

is the current vim mode smart enough to recognize #_ followed by any form as a single syntactic unit?

noisesmith18:12:52

I might be out of date but it doesn't look like it here

sheluchin19:12:40

I don't know how all the https://github.com/nvim-treesitter/playground stuff works. I played around with it a bit and couldn't quite get the desired result, but my guess is that it's possible. I think it can be done with just plain regex/match groups too. Not sure if such an implementation would be too rough around the edges.. I'm sure a language-aware option would be better.

noisesmith19:12:26

my understanding is that conceal is tied to the syntax parsing, so in order to use it you'd need to modify the syntax definition, the hard part would be adding #_ properly to the syntax if it isn't there yet (the current font locking leads me to believe it isn't)

noisesmith19:12:39

I don't think tree sitter is relevant to this tree-sitter is a parser, so it could help, but I suspect it isn't a straightforward solution

walterl22:12:06

IIRC, since enabling tree-sitter syntax highlighting #_-forms (in their entirety) are automatically hightlighted as comments. Maybe you can hook that into conceal? 🤷

Braden Shepherdson22:12:22

kaocha prints nice colourized diffs to my terminal, but :Eval (kaocha.repl/run) with fireplace.vim prints in monochrome with lots of ugly escapes in. is there a way to get nicely colorized eval output in vim? (test results in a split window or something is acceptable)

dave22:12:45

I've tried a variety of plug-ins that interpret the ANSI escape codes into colored/bold/etc. text. The best one I've found is a recent one: https://github.com/m00qek/baleia.nvim

💯 1
dave22:12:08

Requires Neovim

rwstauner22:12:56

in my experience that happens with neovim where it does not happen with vim

rwstauner22:12:04

never looked into it, but would love to fix it