Open qtyra opened 1 month ago
Hi!
Thanks for this feedback.
There is already something like a pre_paste_hook
, it's called wrappers
(it's something like "middlewares").
I never took the time to document this but this is what I use to create Special put mappings.
You can see here how to register mappings with wrapper and here how to create a wrapper.
Let me know if this feature allows you to create your hook ;)
I couldn't find a better place to suggest this since this plugin aims to replace the default bindings, creating a separate plugin would be a hassle. Consider this simple file ('*' represents the cursor position):
AFAIK, there's no easy way to move the last paragraph to the top or vice versa with the correct position of empty lines. Here are some solutions I've considered:
dapggP
: leaves empty line at the top and no empty line between the pasted paragraph and the following one.dipggP
: leaves an empty line at the bottom and no empty line between the pasted paragraph and the following one.Please note:
So i thought this plugin could implement one or both of these solutions:
Handle these special cases without changing any register content and include options to enable or disable this behavior. The algorithm seems straightforward to me, a similar procedure would apply for words, just replacing lines by spaces:
Add a simple
pre_paste_hook
option, customizable with a function that receives the text to be pasted and the type of pasting as input.Let me know what you think!