-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
One of the most satisfying things, in my opinion, when using vim is the ease of doing xp or ddp to move a character to the right or a line down. The reason this works (using a single key p for pasting) is that vim keeps track of what was yanked. In particular vim keeps track if the yank was charwise, linewise or blockwise, in order to determine how the content of the register should be pasted. Now, wouldn't it be amazing if this notion could be generalised to more complex patterns, such as words (daw), paragraphs (dap) or functions and classes (daf, dac from e.g. nvim-treesitter-textobjects). This is exactly what anywise-reg does, namely extending the registers to not only have a notion of charwise, linewise and blockwise but any pattern. anywise-reg keeps track of what text-object was used for yanking (deleting, changing etc) the text (and into what register) in order to determine how to paste it. Before pasting, the cursor is simply moved to the end of the same text-object, currently under the cursor. In this way there is no hard-coded behaviour, rather the text-objects behaviour is reused and therefore any text-object could be used. This also means that it is all up to the text-object to do the correct thing. All the registers " and [0-9][a-z] are supported and anywise-reg updates for example the numbered registers when deleting text.
One of the most satisfying things, in my opinion, when using vim is the ease of doing xp or ddp to move a character to the right or a line down. The reason this works (using a single key p for pasting) is that vim keeps track of what was yanked. In particular vim keeps track if the yank was charwise, linewise or blockwise, in order to determine how the content of the register should be pasted. Now, wouldn't it be amazing if this notion could be generalised to more complex patterns, such as words (daw), paragraphs (dap) or functions and classes (daf, dac from e.g. nvim-treesitter-textobjects). This is exactly what anywise-reg does, namely extending the registers to not only have a notion of charwise, linewise and blockwise but any pattern. anywise-reg keeps track of what text-object was used for yanking (deleting, changing etc) the text (and into what register) in order to determine how to paste it. Before pasting, the cursor is simply moved to the end of the same text-object, currently under the cursor. In this way there is no hard-coded behaviour, rather the text-objects behaviour is reused and therefore any text-object could be used. This also means that it is all up to the text-object to do the correct thing. All the registers " and [0-9][a-z] are supported and anywise-reg updates for example the numbered registers when deleting text.
Theoretically, it's already supported by nvim-treesitter-textobjects module. The problem is though, nvim-treesitter-refactor which is responsible for the highlighting does not sync with the text-object part. There's an issue I opened some months ago: https://github.com/nvim-treesitter/nvim-treesitter/issues/1258. I think it should give more context, if you are interested