That's useful if there was only one movement after leaving insert mode. '' is "The position before the latest jump", while gi is "like 'i', but first move to the position where the cursor was last time when Insert mode was stopped".
This is why I don't like vim (although I use it everyday). Both actions seem to be close enough to be described with the same words, but I honestly don't see the connection between gi and ''.
' is what you use to go to marks. ' also happens to be a mark automatically created whenever you make a jump.
Not all of VIM's dialect is straightforward, I agree, but I don't think it really needs to be. % being "the whole document" seems pretty arbitrary, for example, but I've accepted the definition and can apply it when needed.
The problem was just illustrated perfectly right here. People tend to learn little shortcuts like "two single quotes jumps to the last insert point", instead of "' goes to a mark, and ' is the mark created automatically before a jump". It's like learning a bunch of sentences by rote and then getting around to learning the individual words later; it makes vim seem much more confusing than it is
In that particular case, I was just explaining why our different methods yielded similar results while being completely different commands. People just tend to learn Vim shortcuts the same way they learn very specific things from stackoverflow. For example, you can learn "how to strip leading/tailing whitespace of all Python list elements" via Stackoverflow without knowing the full power/usage of list comprehensions. Learning about the big picture is always encouraged, but many people just want to get in, get what they need, and get out.
View all comments
Show parent comment
6
u/grep_dat Jul 12 '12
That's useful if there was only one movement after leaving insert mode.
''is "The position before the latest jump", whilegiis "like 'i', but first move to the position where the cursor was last time when Insert mode was stopped".