Vim:使计数功能只运行一次

Vim:使计数功能只运行一次,vim,Vim,我有这个功能: function Test() echom "call " . v:count endfunction nnoremap a :call Test()<cr> 功能测试() 呼应“呼叫”。v:计数 端功能 nnoremap a:调用测试() 如果我输入,比如说4a,它会打印出来 呼叫4 呼叫4 呼叫4 呼叫4 但是,当我使用计数时,我希望它只执行一次。如何实现这一点?在调用函数之前,您需要 function Test() echom "call "

我有这个功能:

function Test()
    echom "call " . v:count
endfunction
nnoremap a :call Test()<cr>
功能测试()
呼应“呼叫”。v:计数
端功能
nnoremap a:调用测试()
如果我输入,比如说
4a
,它会打印出来

呼叫4
呼叫4
呼叫4
呼叫4

但是,当我使用计数时,我希望它只执行一次。如何实现这一点?

在调用函数之前,您需要

function Test()
   echom "call " . v:count
endfunction
nnoremap a :<C-U>call Test()<cr>
功能测试()
呼应“呼叫”。v:计数
端功能
nnoremap a:调用测试()
删除命令行上光标前的所有字符。从帮助:

                                                        c_CTRL-U
CTRL-U          Remove all characters between the cursor position and
                the beginning of the line.  Previous versions of vim
                deleted all characters on the line.  If that is the
                preferred behavior, add the following to your .vimrc:
                        :cnoremap <C-U> <C-E><C-U> 
c_CTRL-U
CTRL-U删除光标位置和之间的所有字符
这一行的开头。vim的早期版本
删除了行中的所有字符。如果是这样的话
首选行为,将以下内容添加到.vimrc中:
:cnoremap
调用函数之前需要

function Test()
   echom "call " . v:count
endfunction
nnoremap a :<C-U>call Test()<cr>
功能测试()
呼应“呼叫”。v:计数
端功能
nnoremap a:调用测试()
删除命令行上光标前的所有字符。从帮助:

                                                        c_CTRL-U
CTRL-U          Remove all characters between the cursor position and
                the beginning of the line.  Previous versions of vim
                deleted all characters on the line.  If that is the
                preferred behavior, add the following to your .vimrc:
                        :cnoremap <C-U> <C-E><C-U> 
c_CTRL-U
CTRL-U删除光标位置和之间的所有字符
这一行的开头。vim的早期版本
删除了行中的所有字符。如果是这样的话
首选行为,将以下内容添加到.vimrc中:
:cnoremap

您应该阅读-当有人回答我的问题时,我应该怎么做?你应该阅读-当有人回答我的问题时,我应该怎么做?