zop-to-char
zop-to-char copied to clipboard
Binding to toggle between 'to-char' and 'up-to-char' behavior
It would be convenient to have a binding from the zop-to-char
input loop to toggle between zapping the target character and only zapping up to the target character. This would allow for both zop-to-char
and zop-up-to-char
behavior with a single global binding.
For example, bind C-SPC
to a new zop-toggle-include-target-char
command. Then I could always start with M-z <char>
and hit C-SPC
if I decide to keep the target char as is.
I'm not sure it would be convenient. People usually use only zap-to-char
or zap-up-to-char
and it becomes part of their mental model what this "zap" command does. The thing you propose would require more mental energy to operate it with little benefit. IMHO.
I could be an edge case, then. Personally I often find myself wanting both variants. I think the interactive-with-feedback approach of zop would make it more intuitive than having two separate bindings (e.g. having to remember which variant I bound with a 'z' vs. 'Z', or whatever).
@glucas have you implement it yourself? I don't know-how could do that, if so, please share, or else until someday I implement it would post that code here.
snowman [email protected] writes:
@glucas have you implement it yourself? I don't know-how could do that, if so, please share, or else until someday I implement it would pose the code here.
- Create a var with a key as value
- When user hit this key (compare input with var value) do (setq zop-to-char--delete-up-to-char (not zop-to-char--delete-up-to-char))
-- Thierry