I've added the following to my .vimrc in order to test how <count>
works in a user defined command because I was noticing odd behaviour:
:command! -count=1 CountTest :exe "echo " . <count> . "'"
noremap <space> :CountTest<cr>
Now, when I type :3CountTest
I get what I would expect, i.e., the number 3 is echoed into the prompt. However, when I try using my custom mapping to <space>
(i.e. typing 3<space>
) I get 3 + the current line number.
I'm sure it's just a problem with the way I've assigned my custom mapping. Any ideas?