Vim: delete empty lines around cursor
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Suppose I'm editing the following document (* = cursor): Lions Tigers Kittens Puppies * Humans What sequence can I use to delete the surrounding white space so that I'm left with: Lions Tigers Kittens Puppies * Humans Note: I'm looking for an answer that handles any number of empty lines, not just this exact case. EDIT 1: Line numbers are unknown and I only want to effect the span my cursor is in. EDIT 2: Edited example to show I need to preserve leading whitespace on edges Thanks 回答1: Easy. In normal mode, dipO<Esc> should do it.