Using 2 marks to operate on the text between those lines is the 'vi'-compatible way of the more modern and (literally) visual way of operating in Vim (and probably why visual mode was invented in the 1st place): visually select a range with whatever means (motion, text-object), then start your ex command, which operates line-wise: when you hit :
, you will see those two quick marks automatically inserted before the :
(the start and the end marks of the visual selection).
Quick access to "the last two quick-marks" in this case would translate to "restoring the last visual selection", which can be accomplished with gv
.
And now for the funny part: if you really want it, you can explicitly set those two marks (<
and >
), manually, using m<
and m>
, as with any letter-based mark. I.e. you don't need to go to visual mode for that; then, either use gv
to restore that selection and start your ex command, or manually insert :'<,'>some-ex-command-here
to (similarly) operate on that line range. In another words, visual marks can operate exactly as in your request (quick or temporary marks that can be set - a pair of them), with the advantage of also allowing a more visual way of assignation.
So, maybe this mapping, to ex
ecute on a selection:
noremap g: gv: