开发者

How do I escape the %-character in a vimrc-file?

How could I escape the % in this example?

func! my_func()
  exec "!pri开发者_如何学编程ntf '=%.0s' {1..100}"
endfunc


Use shellescape for any string that is a single argument (not a list of space-separated arguments) and may contains special characters (including space itself):

let suspicious_string='=%.0s'
exec "!printf ".shellescape(suspicious_string, 1)." {1..100}"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜