8
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 2013-10-02

viで文字数カウント

テキストエディタとしても大活躍のviなんだけども、
文字数カウントできないのは不便だなーとか思ったので投下。

viで文字数カウント
:%s/./&/g

上記のコマンドで「○○箇所置換しました」的なメッセージが出てくると思います。
出てきた数字が文字数。

コメントから抜粋

外部コマンドも使えるとのコメントを頂きましたので追記します。

Linuxの外部コマンドが使える場合
:!wc {ファイル名}
or
:!wc %
8
7
6

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
8
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?