Monday, July 20, 2020

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

Hi,

Graham Lawrence schrieb am 19.07.2020 um 22:07:
> :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>...
> |
>
did you really leave out the left-hand-side of the mapping in your .vimrc or is this just a typo in your mail?

> 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 ...?

Regards,
Jürgen

--
--
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/e18c4134-695a-1d51-1094-926d11ae7481%40googlemail.com.

No comments:

Post a Comment