Open bhurlow opened 9 years ago
Hmm, interesting request. It's definitely possible but it's not a use case I had particularly considered before. How do you see the interface for this looking?
I would want to map Cljfmt to =
to be able to format only a specific closure. Just a thought!
seems like this is more per file which is fine
@venantius in agreement here – most plugins of this nature will allow you to select a range and then apply the transformation ie: :'<,'>Cljfmt
I think you'd be able to do this in terms of :[range]substitute
CurrentBufferContents would have to grab this range, and then line 69 where the actual substitution changes would have to run over that range as well.
You can also make it default to the whole file pretty easily as well, so it wouldn't break current behavior.
see http://stackoverflow.com/a/16164585 for more info. I might try to cook up a PR, but VimL isn't exactly my forte.
Cheers!
I'm fairly new to vimL myself, so if you wanted to take a stab at a PR I'd certainly welcome it ;D
Otherwise I do think this'd be a neat feature, but it's going to be a secondary consideration until I get rid of all of the bugs first :bear:
@venantius fair enough. I suspected a similar response :p
May take a stab at it one of these days. Until then, my code shall remain ugly // to my personal preferences.
Thanks for getting back!
It's starting to percolate up to the shortlist; I've been doing a lot of bug fixing over the last few weeks. Don't write it off yet ;)
Sorry to advertise my own project, but I just created alternative plugin which implements this: https://github.com/Deraen/vim-cider Edit: It doesn't support ranges but it supports motions
@Deraen neat – I'll take a look at this :)
Realize movements/selections aren't huge for everyone, but they're pretty integral to my workflow.
Cheers!
ps: don't worry @venantius, still lots of love for ultra :)
Haha, thanks @rbxbx !
If either you or @Deraen felt like submitting a PR here to add motions (which I'm sad to say I'm not familiar with), I'd love it :smile:
Is there gonna be a release with ranges support
Is all we're waiting for a formal release? I haven't been writing a lot of code lately :(
possible to add support to only format a selected range?