美文网首页
2018-10-13 how to call vim comma

2018-10-13 how to call vim comma

作者: 五大RobertWu伍洋 | 来源:发表于2018-10-13 19:41 被阅读5次

So it's really as simple as:

vim -c ':%s/e//g' -c ':wq' file.txt

There's no need to use "ex mode". You can if you want:

vim -e -c ':%s/e//g' -c ':wq' file.txt

It has the advantage of not messing with your terminal so much, but other than that there's little difference.

It seems using -es is more performant, I have noticed a small "blink" without it as Vim started up and quit

-s should make it silently.

below is what I used :

vim -es -c ":%s/restwechat/restci/g" -c ":%s/restwe/restjs/g" -c ":wq" testvim

vim use -c to allow commands and -es make it more performant,without -es there is a small "blink" when Vim started up and quit.
the order of above ":s" command could make a difference.

相关文章

网友评论

      本文标题:2018-10-13 how to call vim comma

      本文链接:https://www.haomeiwen.com/subject/duqaaftx.html