Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim - count lines in selected range

Tags:

vim

I want to count lines in a range, not matter what range, but let it be, say, a visual block. What is the shortest way to do it. All that comes to my mind is something like: '<,'>s/.//n but I don't believe it is the shortest way.

So, can somebody give me a hint? Thanks in advance.

like image 682
shabunc Avatar asked Aug 31 '11 19:08

shabunc


1 Answers

In visual mode, press gC-g

Typical output:

Selected 7 of 22 Lines; 8 of 32 Words; 201 of 491 Chars; 201 of 497 Bytes-- VISUAL LINE --


Source: :he count-items (discoverable as: :heTabTab...)

like image 59
sehe Avatar answered Sep 25 '22 20:09

sehe