Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一堆需要添加属性的属性。
我想:对于以“”开头的每一行,在其正上方Public Property...插入该行。<DataMember()> _
Public Property...
<DataMember()> _
知道如何在 vi/vim 中执行此操作吗?
如何使用:g命令:
:g
:g/^Public Property/norm! O<DataMember()>
如果你喜欢你也可以使用:s:
:s
:%s/^Public Pr.../<Data...>\r&
这将起作用:
:%s/\(^Public Property.\+$\)/<DataMember()>\r\1/