Sunday, July 19, 2020

v:count in mapping gets E492: Not an editor command: count

:h v:count includes the following example
map _x :<C-U>echo "the count is " . v:count<CR>

which works as expected, but using
map :let @n=v:count1<cr> ...

produces E492 etc; and instead I must use
map ;; :<C-U>exe 'let @n=v:count1'<cr> ...

for it to work.

Now I have a number of mappings in alternate .vimrc files that use the 'let' form that now fails, which strongly implies that at one time that method of saving v:count did work.
So is this a recent development? Or have I unwittingly set something in .vimrc that invalidates 'let'? Or is it a vim error that is likely to be corrected by reverting to the old form? Or ...?

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/63e65a86-4f90-437d-a392-a423c0e8881eo%40googlegroups.com.

No comments:

Post a Comment