> > > > cut/paste this code to your .vimrc: > > let g:word_count="<???>" > function! WordCount() > return g:word_count > endfunction > > function! UpdateWordCount() > let s D system("wc -w ".expand("%p")) > let parts = split(s, ' ') > if len(parts) > 1 > let g:word_count = parts[0] > endif > endfunction > > augroup WordCounter > au! CursorHold * call UpdateWordCount() > au! CursorHoldI * call UpdateWordCount() > augroup END > > ADD THIS to your statusline setting: > > set statusline+=[wc:%{WordCount}] > > OR > > nmap <leader>wc :echo 'wc:'WordCount() > > then :so .vimrc<CR> -- this will reload .vimrc so the code will work. > > It said: E121: Undefined variable: WordCount -- Arthur Lee Sent with Sparrow (http://www.sparrowmailapp.com/?sig)
-- 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