Vimscript - 在shell中显示字符串值

时间:2013-10-26 14:14:54

标签: vim

考虑功能,

function! Test()
    :let aString = "I'm a string!"
    :!echo aString
endfunction

现在输入:call Test()将以下内容传递给BASH:

aString

Press ENTER or type command to continue

我如何:!echo aString的价值?

谢谢!

1 个答案:

答案 0 :(得分:1)

好的,最后让它工作了:

function! Test() 
   :!clear
   :let aString = 'I\''m a string\!'
   :execute "!echo " . aString
endfunction