I'm new at vim, started to play with macroses, and founded not obvious override behaviour for jump/change lists. The main question - are there any stable ways to jump by changes/moves inside same line (except marking each point), cause this lists remember only last change on the same line (if changes are consequtive withing on line).
Example for jumplist. Cursor position at '(', '{' - marked as m.
( smth ) { }
%`m%
I jumped firt to ')', next by mark at the same line and next to last bracket I'm able to do only one ^o - last jump at first line. But expected to jump 2 times more.
Same situation with changes list and g;
't1 t2 t3' -> 't2 t3 t4', I can't move between all 3 t
At least I wanted to jump by same points as stored at undo history. All modern editors like VSCode, Sublime, e.t.c. have this stable option "Alt -" / "Alt +" to jump all prev. cursor positions. What is Vim way?
Founded this when tried to make macro, which swaps any 2 pair of brackets.
{ smth } (
)
Let's mark first pair of brackets with 'mm', to remember whith whom should we swap. let's mark '{' as main bracket and go to '(', starting macro 'qq'. I'm marking current pair of brackets as 'mc' and swapping later between main and current.
@q=mc%x`m%Plx^O^Op`mx`cPlx`mP
( smth ) {
}
moving cursor to { and running '@q' - we get initial text, double swapping brackets
Problems started, case second pair brackets marked as mm, and cursor located at first pair of brackets. '(' - mm, '{' - start position
{ smth } (
)
only first ^o would work, and then macro will jump outside of this block