开发者

VIM how to suround each element in a list with quote and comma

say I have a list

1M 3M 5D 3Y 9Y

I want to quickly turn this list into "1M", "3M", "5D", "3Y", "9Y" using vim -- so far I was开发者_如何学运维 doing it manually. thanks


:%s/[^ ]\+/"&",/gc replaces tokens by "token",. c is for confirmation.


You can use surround plugin with macros.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜