Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想%在 call 中将当前文件名作为 shell 脚本的参数传递system():
%
system()
let rev=system("~/script %")
我怎样才能真正做到这一点?
尝试使用exec:
exec
exec 'call system("~/script " . expand("%"))'
根据您想要做什么,您可能根本不需要exec(如:h system()建议):
:h system()
let foo = system("~/script " . expand("%"))
玩弄expand()(感谢kongo2002):
expand()
let script="~/script " . expand("%") let rev=system(script)
用作魅力=)