Vim Tips Wiki
Advertisement

Question:

Is it possible to change the fold line counter above to a word counter instead. I write novels using vim and fold my chapters. Having a word rather than a line counter would be much more useful.

Tgrignon (talk) 21:01, October 19, 2014 (UTC)

Sure! There are a few methods for getting a Word count in Vim. Just use one of those inside a function to get a word count between two lines, and use that function in your foldtext expression, passing in v:foldstart and v:foldend. --Fritzophrenic (talk) 16:33, October 20, 2014 (UTC)
Advertisement