On Jul 22, 2011, at 7:52 AM, Eric Weir wrote:
On Jul 22, 2011, at 5:41 AM, Tony Berkopes wrote:
I also found/downloaded the wc.vim script which can easily be made
to update the statusline. It currently uses an 'echo' to output the
results. I would guess, as I'm not by any means a vim expert, change
it from 'echo' to 'return wc_count' then use the usual set statusline
+=\ [wc:%{wc}] should work. If I have time I will put the code from
wc.vim into the code I posted earlier so the word count will be
compliant with 'Strunk & White'(?).
Thanks, Tony. I'm not a programmer and am novice enough about Vim that
I wouldn't be able to follow your suggestion for getting the output of
wc.vim into the status line.
Curious why you would put the wc.vim code in your script. Again, in my
naiveté, I imagine that would be redundant. If they do do the same
thing, your's is so much simpler. [And therefor more elegant?]
Regards,
------------------------------------------------------------------------------------------
Eric Weir
Decatur, GA USA
eew...@bellsouth.net
--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Eric,
As the wc.vim script states it is 'Strunk & White' compliant as to the
EXACT number of words in a manuscript or other documents that must
have an exact count. There IS a difference to the word count between
the wc.vim and the other examples. I also have not determined which of
the 2 is faster. Any comments from other readers is WELCOME!!
If you have read the code in wc.vim, I commented out the part that
counts until a series of '--------' 8 dashes is found. I don't want/
need that and it probably slows it down for no reason.
Just copy/paste the example in a previous post into your .vimrc and
add the example to your status line. Make sure it says set statusline
+= (don't forget to use the '+=', just '=' will remove any previous
set statusline commands.
set statusline+=[wc:%{WordCount}] will display something like [wc:
1064] in your statusline.
OR, to use hot key and NOT in statusline
map <leader>F1 :echo 'wc:'WordCount()
I don't have the above code AND wc.vim loaded, as you have stated that
would be redundant.
Hope this helps, TonyB
--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php