Vim如何从用户定义的命令自动返回
我定义了以下命令,将文件选择导出到Vim如何从用户定义的命令自动返回,vim,Vim,我定义了以下命令,将文件选择导出到html文件中,然后使用googlechrome打开它进行打印 command! -range WebPrint <line1>,<line2>call Print() function! Print() :'<,'>TOhtml :wq :!/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome %:p.html endfuncti
html
文件中,然后使用googlechrome
打开它进行打印
command! -range WebPrint <line1>,<line2>call Print()
function! Print()
:'<,'>TOhtml
:wq
:!/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome %:p.html
endfunction
命令-范围网络打印,调用打印()
功能!打印()
:“来自:帮助呼叫
:
When a range is given and the function doesn't handle it
itself, the function is executed for each line in the range,
您的Print
函数是在没有range
的情况下定义的,因此它会被多次调用,对于所选范围内的每一行调用一次
如果这不是您想要的,请删除,
另请参见:帮助功能范围示例
我明白了,谢谢!现在,每次调用函数后,vim会话都会被转移到bash会话,并说按ENTER键或键入command继续
。有没有办法自动返回vim会话?请使用silent/应用程序/…
。可能还需要重新绘制。请参见:help下的最后两段!cmd
。