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

猜你喜欢

转载自www.cnblogs.com/itzxy/p/9383963.html
Vim