Reputation: 24774
in vim, with strlen
, I can count the number of characters in a line.
Example: count the characters in last line
strlen(getline('$'))
how I can count the characters in the buffer ?
Upvotes: 2
Views: 805
Reputation: 11585
You can use g CTRL-G
to display stats of the current buffer, including char count.
line2byte(line('$') + 1)
works in scripts.
Upvotes: 6