6
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

viで空行を消すもうひとつの方法

Last updated at Posted at 2015-11-17

正規表現が使えないエディタではどうやるのかさっぱりわかりませんが簡単にできます。そうviならね。

その簡単な手順はこちら

空行の削除
http://qiita.com/YamasakiKenta/items/ea8d63f7c572b656ba43

そこをあえて正規表現的に書いてみるとこんな感じ。

:[range]s/^\s*$\n//

全体なら

:%s/^\s*$\n//

ビジュアルモードで選択している範囲なら

:'<,'>s/^\s*$\n//

a,bでマークしている範囲なら

:'a,'bs/^\s*$\n//

正規表現とマークがあればあと10年は戦える!

6
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?