I'm trying to understand the U command in Vim. My understanding is that it undoes all changes that affect only the most recently changed line. However, if I start with the following file:
abc
def
ghi
jxx navigates down and deletes two characters:
abc
f
ghi
kgU2j sets the entire document to uppercase:
ABC
F
GHI
Now, U gives this result:
ABC
def
GHI
If I had used kd2j to delete the entire document instead of changing its case, U would have no effect. I'm wondering why d is treated as a command that affects multiple lines, but gU is seemingly ignored.
Is there an intuitive way to understand this behavior, or is this just an odd edge case of Vim?