vim-camelsnek icon indicating copy to clipboard operation
vim-camelsnek copied to clipboard

[FR] work in operator-pending mode

Open huyz opened this issue 3 years ago • 7 comments

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

huyz avatar Oct 27 '22 11:10 huyz

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

zatchheems avatar Jan 05 '23 22:01 zatchheems

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

huyz avatar Jan 06 '23 05:01 huyz

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.?

zatchheems avatar Jan 06 '23 06:01 zatchheems

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

huyz avatar Jan 06 '23 13:01 huyz

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. 🙂

zatchheems avatar Jan 06 '23 16:01 zatchheems

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

nicwest avatar Aug 31 '23 12:08 nicwest

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.

huyz avatar Mar 04 '24 15:03 huyz