Wednesday, January 13, 2010

how to get the word count in vim



It's really simple, albeit a little difficult to remember:

In command mode, press g, then ctrl-g

This will actually give you a number of things.

It will give you:

- the current column
- the line number
- the word count
- the byte count

as such:

Col 22 of 88; Line 1 of 13; Word 4 of 119; Byte 22 of 813

So the word count of this buffer is 119. The other bit of information refers to where the cursor is when you issued the g / ctrl-g command.

No comments: