vim :g

https://stackoverflow.com/questions/1946738/vim-how-to-delete-every-second-row

An elegant (and efficient) way to accomplish the task is to issue the :+delete command removing the line next to the current one, on every line using the :global command.

:g/^/+d


http://vim.wikia.com/wiki/Power_of_g
posted @ 2018-07-29 00:08  zxyblog  阅读(154)  评论(1编辑  收藏  举报