Vim中交换奇偶行

在水木上看到了,记下来,以后可能会用到,嗯。答案来自vale@newsmth.org

  :g/^/+1m-1

g/^/:匹配所有行
+1:定位到下一行
m-1:移到上面去

This entry was posted in 善用佳软. Bookmark the permalink.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>