I have @@ mapped to Space. This can be really convenient.Sometimes I want to combine a macro with another. So maybe I need to record q as @:/jump to run my last regex substitution and move to the next place I probably want to run it. Then @q and press Space until I'm happy.Unfortunately if you run @q, during the macro the @@ repeat will be set to @:. Is there a way to run @: without setting it to @@ while recording the macro for q?In this toy example, instead of combining macros I could copy the substitution into a register and paste it during the q recording, but that requires more foresight, and a bit of fiddling.Edit:I guess as far as combining @: goes, I can always use :%s/\v//gc... There are situations I've wanted to combine macros that have nothing to do with regex though. Only option I can think of so far to do what I want is remap Space to always be @q, instead of the last macro, which might be okay since that's 80% of the time what I mean.
Run a macro without having it set as last macro (@@)
macro
Is there a way to run @: without setting it to @@ while recording the macro for q?Yes:For normal 'character' registers::call feedkeys(@a): needs special handling::call feedkeys(':' . @: . \<CR>)If you use this often, you may want to map it: for @::noremap @- :<C-u>call feedkeys(':' . @: . <Bslash><lt>CR>)<CR> for normal char registers:noremap @_ :<C-u>call feedkeys(@)<Left> more complex version of the latter, improved to not need a final <CR>noremap @_ :<C-u>call FeedReg()<CR>function! FeedReg()  echo 'Enter register name character:'  let reg=nr2char(getchar())  call feedkeys(getreg(reg))endfunction