Assuming I have a line such as the following one:
XXXXXXXXXXXXXABCXXXXXXXXXXXXXXXXXABCXXXXXXXXX
mark a
is at the first instance of ABC, mark b
on the second one.
Now I run a macro on it, breaking the line twice, and inserting something around that position:
XXXXXXXXXXXXX
YYYABCYYY
XXXXXXXXXXXXXXXXXABCXXXXXXXXX
After this, I want to go back to mark b
, but it is now located at the very end of the first line, instead of at the second occurrence of ABC. In fact, both the marks are there now. I assume this is because vim uses the x and y coordinates in the file to remember the marks. I believe it can deal with some changes to the file one edits, keeping the markers in the proper position in respect to the surrounding text, but not here. But maybe that assumption is mistaken.
My real world files look much more complex, and probably my example is not the best, but it does show the sticking of both marks to the end of the first line after the insertion. I reality, both instances of ABC may or may not be the same, although they will definitely be similar. Many times they differ from each other enough to make jumping between the two based on a search for that pattern, while not impossible, but apparently impossible to automate. Anyway, I was just going to ask if I missed anything about marks that could help me use them in this context, and get the expected behavior.