Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/vim/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vim 如何输入';:标准';在功能上_Vim - Fatal编程技术网

Vim 如何输入';:标准';在功能上

Vim 如何输入';:标准';在功能上,vim,Vim,我想选择textobject linewise,然后我想在命令行中预先输入:norm,以等待我的进一步命令 function! s:SelectAndEnterNorm(...) " I am selecting textobject that was entered after ,. silent exe "normal! '[V']" " and now I want that the string ":norm " was entered " in command li

我想选择textobject linewise,然后我想在命令行中预先输入
:norm
,以等待我的进一步命令

function! s:SelectAndEnterNorm(...)
  " I am selecting textobject that was entered after ,.
  silent exe "normal! '[V']"

  " and now I want that the string ":norm " was entered 
  " in command line as if I entered it
  " I have tried this but it doesnt work, without errors
  silent exe "normal! :norm"
endfunction

nmap <silent> <leader>. :set opfunc=<SID>SelectAndEnterNorm<CR>g@

" same with visual mode
vnoremap <leader>. :norm<space>
函数!s:SelectAndInternorm(…)
“我正在选择在之后输入的textobject,。
“正常!”[V']”
现在我想输入字符串“:norm”
“在命令行中,就像我输入了它一样
“我已经试过了,但它不起作用,没有错误
静默exe“正常!:正常”
端功能
nmap.:set opfunc=SelectAndEnterNormg@
“与视觉模式相同
vnoremap.:norm
谢谢Randy Morris

function! s:SelectAndEnterNorm(...)
  silent exe "normal! '[V']"
  call feedkeys(":norm ")
endfunction

vnoremap <leader>. :norm<space>
nmap <silent> <leader>. :set opfunc=<SID>SelectAndEnterNorm<CR>g@
函数!s:selectandinternorm(…)
“正常!”[V']”
调用feedkeys(“:norm”)
端功能
vnoremap.:norm
nmap.:set opfunc=SelectAndEnterNormg@

normal!:norm
你知道
norm
normal
的捷径吗?我猜你可以在这里使用
feedkeys
,但我现在不能测试。一般来说
feedkeys
不是你想要的长期方案,所以我肯定有更好的解决方案。哦,是的,feedkeys已经奏效了,你应该接受你自己的答案(一旦你能够),因为你已经解决了你的问题。