How to modify vim's command to add the ; symbol and complete the line break at the same time?
某草草
某草草 2017-05-16 16:34:35
0
2
736

Change this

flip   翻转[左右变成右左] fork   叉子\分岔\岔口\复刻
Convert

to

flip   ;翻转[左右变成右左] fork   ;叉子\分岔\岔口\复刻

I use

:%s/^\([ a-zA-Z]\+\)\([\U4E00-\U9FFF ]\+.\+\)\([ a-zA-Z]\+\)\([\U4E00-\U9FFF ]\+.\+\)$/; ;/g

Now I want

flip   翻转[左右变成右左] fork   叉子\分岔\岔口\复刻

become

flip   ;翻转[左右变成右左] 
fork   ;叉子\分岔\岔口\复刻

How to modify the vim command to complete the line break while adding the ; symbol?

某草草
某草草

reply all(2)
曾经蜡笔没有小新
:s/^\([ a-zA-Z]\+\)\(\([\U4E00-\U9FA5]\+[^ ]*\)\+\)\([ a-zA-Z]\+\)\(\([\U4E00-\U9FA5]\+[^ ]*\)\+\)$/;\r;/g

There are two more brackets
PS: For Chinese matching, there is a method using [^ -x]1 on the Internet. The test found that it works, but I don’t know the principle.
If there are no English or spaces in the Chinese explanation, you can write it more simply

\(\([\U4E00-\U9FA5]\+[^ ]*\)\+\)
#可以修改为:
\([^ a-zA-Z]\+\)\+

  1. https://www.oschina.net/quest... ↩
世界只因有你

You can add a map to map ; to ;<CR>

For example: inoremap ; ;<CR>

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!