Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
視覚選択の空白なしで文字を数えたい。直感的に、私は次のことを試しました
:'<,'>w !tr -d [:blank:] | wc -m
しかし、vimはそれが好きではありません。
vim で視覚的な選択範囲内の非空白文字をカウントするには、次のようにします。
:'<,'>s/\S/&/g
\S次に、Vim は空白以外の文字 ( ) をそれ自体 ( )に置き換えた回数&を、実際にバッファーを変更せずに通知します。
\S
&