On 2015-02-23 15:47, Paolo Bolzoni wrote:
> It is possible to change the meaning of . so it repeats the last
> command, whatever it was a normal command or a ex command? I find
> confusing that I can type dw..., but not :cNext<cr>..
As others have mentioned, there's no way to expand the behavior of
the "." command to include things other than normal-mode changes. But
as you've found, using "@:" re-executes the last Ex command. However,
since it's a macro, subsequent executions can be performed with "@@"
which I find MUCH easier to type. And, as you detail, I do it
frequently with ":cn"ext to browse the quick-fix results. On rare
occasions where I'm doing a lot of them, I'll do a temporary
(non-.vimrc) mapping, something like
:nnoremap <space> :cn<cr>
which lets me just hit the space-bar to jump to the next result.
Also, just in case you need it, "g&" is an obscure "across all lines
in the file, repeat the last substitution with the same flags"
command, even if it's several items back in your command-line history.
:help g&
:help @@
-tim