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

[FR] work in operator-pending mode #3

Open
huyz opened this issue Oct 27, 2022 · 7 comments
Open

[FR] work in operator-pending mode #3

huyz opened this issue Oct 27, 2022 · 7 comments

Comments

@huyz
Copy link

huyz commented Oct 27, 2022

Just like https://github.com/christoomey/vim-titlecase/, it would be nice if there were some functions that wait for an operator such as motion or iw

@zatchheems
Copy link
Contributor

@huyz I'm intrigued. what's the use case for operator-pending modes when the existing functions already operate on iw?

@huyz
Copy link
Author

huyz commented Jan 6, 2023

@zatchheems Consistency. When things are consistent, they become predictable. Otherwise, your finger memory will try it and it will fail. For example, maybe you want to apply the operation from the cursor position to the rest of the line.

@zatchheems
Copy link
Contributor

zatchheems commented Jan 6, 2023

hmm I see what you're saying, but there aren't currently any operators that work like that in this library. you can run camelsnek functions on blocks of text in visual mode though, like v$:Snek covers your last example.

are you asking for an implementation that adds operator mappings for specific keys for CamelB, Camel, Kebab, etc.?

@huyz
Copy link
Author

huyz commented Jan 6, 2023

I'm asking that there be functions like <Plug>Titlecase for each of the functions. Check out:
https://github.com/christoomey/vim-titlecase/blob/master/plugin/titlecase.vim

@zatchheems
Copy link
Contributor

ok, so that is what you're asking!

Consistency. When things are consistent, they become predictable. Otherwise, your finger memory will try it and it will fail.

are you proposing gz as a prefix for these new bindings?

I'm envisioning something like gzc for camel, gzb for camelback, gzs for snake, gzS for screaming snake, etc. because I could actually get a lot of use out of that. not sure if vim-titlecase eats up the initial gz though so both libraries might not be able to work together, and I'm not sure about keymapping etiquette WRT making sure libraries don't step on each-other's toes.

FWIW I have already implemented title and space case locally and am planning on contributing that to this library, just an interesting coincidence that you're showing this titlecase repo as an example. 🙂

@nicwest
Copy link
Owner

nicwest commented Aug 31, 2023

Sorry team, I totally missed this. is this still something that is of interest? This behaviour I believe is already available in tpope's vim-abolish: https://github.com/tpope/vim-abolish/blob/master/doc/abolish.txt#L146

@huyz
Copy link
Author

huyz commented Mar 4, 2024

vim-abolish only does a single word under the cursor; it doesn't allow for arbitrary operators You can't do something like: "snake-rest from here to the end of the line", for example.

I'm still interested. But it's not super important. So you're welcome to close it.

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

No branches or pull requests

3 participants