Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ranges? #9

Open
bhurlow opened this issue Feb 11, 2015 · 12 comments
Open

ranges? #9

bhurlow opened this issue Feb 11, 2015 · 12 comments

Comments

@bhurlow
Copy link

bhurlow commented Feb 11, 2015

possible to add support to only format a selected range?

@venantius
Copy link
Owner

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?

@bhurlow
Copy link
Author

bhurlow commented Feb 11, 2015

I would want to map Cljfmt to = to be able to format only a specific closure. Just a thought!

@bhurlow
Copy link
Author

bhurlow commented Feb 11, 2015

seems like this is more per file which is fine

@rbxbx
Copy link

rbxbx commented Feb 17, 2015

@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!

@venantius
Copy link
Owner

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 🐻

@rbxbx
Copy link

rbxbx commented Feb 24, 2015

@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!

@venantius
Copy link
Owner

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 ;)

@Deraen
Copy link

Deraen commented May 17, 2015

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

@rbxbx
Copy link

rbxbx commented May 18, 2015

@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 :)

@venantius
Copy link
Owner

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 😄

@sushovannits
Copy link

Is there gonna be a release with ranges support

@venantius
Copy link
Owner

Is all we're waiting for a formal release? I haven't been writing a lot of code lately :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants