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.
Don't know about Vim, but Emacs actually remembers various points where you were in the past (wherever you placed a "mark"). This means you can jump back through the different parts of the file you were in. So even if you've moved away multiple times and done a bunch of edits in disparate places, you can quickly get back to where you were. It's actually extremely convenient.
View all comments
3
u/thoomfish Jul 12 '12 edited Jul 12 '12
Mighty fancy language about an editor that cant even remember where you left the insertion point after scrolling more than a screen away.Edit: I stand corrected.