Replies: 1 comment
-
The dot-repreat of the action over Visual selection is in general something that is not supported by Neovim and Vim. You can check it, for example, by:
The best 'mini.align' could do is to support dot-repeat after initially aligning some visual selection. Pressing dot would then align the same relative region but at the new cursor position. This is supported by 'mini.comment' since 'mini.nvim' 0.13.0, but not sure if it is worth extra hassle to add for 'mini.align'. As this is rarely useful and can usually be replicated with operator+motion in cases when it is. As per any way to make repeating easier... The 'mini.align' in particular is designed to be interactive and doesn't seem to work well with macros. So I don't think there is an easier way (beside what you already mentioned with trying to use operator+motion). |
Beta Was this translation helpful? Give feedback.
-
For example, if I have multiple sections of code and I want to align the comments at the end of the lines for each section.
I would select the section where there are comments and do
ga
s%-%-
<CR>
to have all comments aligned.Now if I have multiple sections where I want to align the comments I have to do this over and over again. Is there a way to repeat this automatically?
I know that normal mode operations ca be dot-repeated, so that if all the comments were in one paragraph I could do
gaip
s%-%-
<CR>
and then dot-repeat for all other sections, but I would like to repeat the align action inside a paragraph for arbitrary lengths of code.I tried doing the visual mode selection and then recording a macro of the alignment process but replaying it with a different selection did not work.
Is there another way in which repeating a "visual selection align" is possible, or is this simply not possible in the current state?
Beta Was this translation helpful? Give feedback.
All reactions