mini.cycle idea for next and previous operation #1466
Replies: 1 comment
-
Huge thanks for detailed suggestion! I haven't thought deeply about 'mini.cycle' yet, so this is valuable. My initial thoughts were something along these lines:
The second approach is cleaner but lacks the usability of "cycle at cursor" type of workflow when it automatches cycleable object at cursor. The idea in this suggestion is a bit more involved and closer resembles 'mini.surround' / 'mini.ai' in a sense of providing the interface for custom "cycleable" objects (with maybe a set of predefined ones). This is not necessarily a bad thing (as there are two modules with same workflow which can reuse some code), but I am not yet sure if I want to follow that path, as the code is quite complex.
|
Beta Was this translation helpful? Give feedback.
-
Current Workflow with dial.nvim
I currently use dial.nvim for my advanced needs.
I myself like to think and group the patterns for cycling into group like alphabets, numbers, dates, time, words, logical etc.
and assign a letter for each and follow the general pattern of
<leader>+i+(character)
for incrementing<leader>+u+(character)
for decrementingShowcase
Feature request that are not present currently in dial.nvim
Operator for changing next or previous pattern
<c-a>
equivalent<leader>ia
increments this or closest next alpha (alphabet): y->z<leader>ila
increments last alpha : x->y<leader>ina
increments next alpha : z->asimilarly,
<leader>ua
decrements this or closest next alpha.Count Handling:
(c)<leader>i(n)na
increment the nth next pattern c times
example:
2<leader>i7nu
g<c-a>
equivalentHow count is handled for:
(c)g<leader>i(n)na
increments every pattern until nth next pattern c times
example:
g<leader>i7nu
2g<leader>i7nu
Operator for finding or selecting next or previous pattern
<leader>Inu
finds and selects next number pattern<leader>I2na
finds and selects 2nd next alphabet pattern<leader>Ill
finds and selects last logical pattern<leader>I3ld
finds and selects 3rd last date/day patternUse it as textobject
Additonally we can now treat these cycleable patterns as an textobject.
and combine them with operators like:
d<leader>Inu
to delete next number group patternd<leader>Iu
to delete current or next number group patternc<leader>Ilw
to delete next word group patternBeta Was this translation helpful? Give feedback.
All reactions