vim

For discussion on all things (neo)vim.
futuro 2020-02-07T16:53:47.054300Z

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

dominicm 2020-02-07T17:08:14.054800Z

I don't think there's anything quite so semantically aware

futuro 2020-02-07T17:38:44.055Z

Dang

futuro 2020-02-07T17:38:50.055300Z

Thank you, regardless :)

dave 2020-02-07T17:45:31.056300Z

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

dave 2020-02-07T17:47:21.057500Z

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

dominicm 2020-02-07T17:47:37.058Z

Cljfmt has a pr to do this

dominicm 2020-02-07T17:47:49.058400Z

Then gw will work

dave 2020-02-07T17:48:36.058700Z

ah yes, that's right. i remember seeing that now

dave 2020-02-07T17:49:47.059200Z

it's funny how a feature that feels so simple on the surface is actually so complex underneath 🙂

borkdude 2020-02-07T18:19:22.059400Z

what's gw?

defndaines 2020-02-07T18:23:58.060Z

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.

2020-02-07T21:41:17.060700Z

@borkdude may be this explains gw and gq? https://vi.stackexchange.com/a/511

borkdude 2020-02-07T21:45:25.060900Z

thanks!

🙂 2
dominicm 2020-02-07T22:24:02.061600Z

I think I meant gq anyway :)

dominicm 2020-02-07T22:24:23.062200Z

gw is great for comments, as those don't seem to do so well with gq