mNo edit summary |
(fixed "¦" and some formatting) |
||
Line 1: | Line 1: | ||
− | |||
{{review}} |
{{review}} |
||
{{Tip |
{{Tip |
||
Line 10: | Line 9: | ||
|rating=-10/10 |
|rating=-10/10 |
||
|text= |
|text= |
||
− | the `|' concatenate servals ex-command in one line. |
+ | the `<nowiki>|</nowiki>' concatenate servals ex-command in one line. |
It's the key to translate // style comments to /* */ style |
It's the key to translate // style comments to /* */ style |
||
− | :g#^s{-}//#s##/*# | s#$#*/# |
+ | :g#^s{-}//#s##/*# <nowiki>|</nowiki> s#$#*/# |
− | the `|' keep the current line matchs ^s{-}// to perform s#$#*/ |
+ | the `<nowiki>|</nowiki>' keep the current line matchs ^s{-}// to perform s#$#*/ |
− | |||
− | |||
/* ... */ ---> //style |
/* ... */ ---> //style |
||
− | :g#/*(.{-})*/#//1# |
+ | :g#/*(.{-})*/#//1# |
⚫ | |||
− | |||
⚫ | |||
− | |||
− | + | ..... |
|
⚫ | |||
− | |||
⚫ | |||
− | |||
⚫ | |||
− | |||
⚫ | |||
=====> |
=====> |
||
− | //...... |
+ | //...... |
⚫ | |||
− | |||
− | //...... |
+ | //...... |
− | |||
⚫ | |||
style: |
style: |
Revision as of 09:20, 19 June 2007
Tip: #35 - Translate between single line and block comments
Created: March 7, 2001 6:25 Complexity: intermediate Author: slimzhao--AT--21cn.com Version: 5.7 Karma: -10/10 Imported from: Tip#35
the `|' concatenate servals ex-command in one line.
It's the key to translate // style comments to /* */ style
:g#^s{-}//#s##/*# | s#$#*/#
the `|' keep the current line matchs ^s{-}// to perform s#$#*/
/* ... */ ---> //style
:g#/*(.{-})*/#//1#
/* .... .... ..... */
=====>
//...... //...... //......
style:
? Anyone implement it?
Comments
wanted to, doesn't appear to work?
perhaps I'm no using it properly
leinfidel--AT--netscape.net , August 31, 2003 14:29