On Jul 23, 2011, at 1:45 PM, Eric Weir wrote:


On Jul 23, 2011, at 11:54 AM, Arthur Lee wrote:

Aha! I found a better way to fulfill your requirement.

" Format the statusline
set statusline+=[wc:%{WordCount()}]

function! WordCount()
  let s:old_status = v:statusmsg
  exe "silent normal g\<c-g>"
  let s:word_count = str2nr(split(v:statusmsg)[11])
  let v:statusmsg = s:old_status
  return s:word_count
endfunction

Am I to take it that this is an alternative to wc.vim and WordCount? And what do the errors Tony got with it indicate about it
s usability?

------------------------------------------------------------------------------------------
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


I found the problem:

there was a space between the ...v:statusmsg) and [11])

it works, but I will keep what I have (WordCount()) and use wc.vim when I need accuracy.

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

Reply via email to