I regularly press
q to exit the
-- more -- prompt in Vim.
I often mistakenly use this same key to exit the
hit-enter prompt, which then starts recording a macro after a subsequent key is typed.
I'd like to map
<cr> when the
hit-enter prompt is shown.
I unsuccessfully tried the following mapping:
noremap <expr> q mode() ==# 'r' ? "\<cr>" : 'q'
mode() cannot be used in this context to check for the
hit-enter prompt. As mentioned in the documentation, in most uses outside of
mode() "always returns c or n."