syntax highlight

Tuesday 20 April 2010

Vim tip: Word count

Trying to count words is a common task. Whenever you're writting a report for class, that is. There are some legitimate reasons but they don't matter now: it's a great chance to show off how great Vim is.

First method: Type ggVgY"*p to copy the whole text. Then paste it into word and use word count.

Second method: Type %!wc -w, which executes wc on each line.
Third method: Type g^g (g, CTRL+g) and watch the bottom of your screen.

As ussual, Vim rocks.

No comments:

Post a Comment