Closed rockyzhang24 closed 2 years ago
You should already be able to do this with the current filter, for example by
require('neoclip').setup({
...
filter = function(data)
return data.event.operator == 'y'
end,
...
})
I was testing this after I opened this issue. Lol. Thank you very much.
Is there a way to filter out 'x' presses and keep yanked text with 'd'? Since 'x' presses fall under 'd' category according to print(data.event.operator)
Ok, I solved the history of yanks cluttering problem by introducing this filter:
filter = function (_)
return vim.fn.strlen(vim.fn.getreg('"')) > vim.g.neoclip_min_length
end,
(NOTE: vim.g.neoclip_min_length
must be defined)
One can also strip the unnamed register content of whitespace chars, but for now, I decided to stick with this version
Nice @lukoshkin, you could also get the yanked content from data.event.regcontent
where data
is passed to the filter (untested, on my phone :))
Sometimes we only care about the contents yanked by parts of the operators. For example, I just want to record all the contents yanked by
y
, and ignore the contents yanked byd
,c
, etc. Is it possible to have a variable in the config to maintain the operator list likeoperator_filter = { 'y' }
.Thank you very much.