Re: Installing a word count plugin -- or recommendations of other plugins

2011-07-26 Thread ZyX
Reply to message «Re: Installing a word count plugin -- or recommendations of other plugins», sent 19:06:48 26 July 2011, Tuesday by Arthur Lee: > It seems the g command does not execute at all! > Any suggestion will be appreciate. Thanks.! Read :debug. I have no suggestions about what

Re: Installing a word count plugin -- or recommendations of other plugins

2011-07-26 Thread Arthur Lee
ZyX, Thanks for your post. But there still be some error pop up when reopen the macvim. > Error detected while processing function WordCount: > line 4: > E684: list index out of range: 11 > -- It seems the g command does not execute at all! Any suggestion will be appreciate. Thanks.! -- Ar

Re: Installing a word count plugin -- or recommendations of other plugins

2011-07-26 Thread ZyX
Reply to message «Re: Installing a word count plugin -- or recommendations of other plugins», sent 18:35:01 26 July 2011, Tuesday by Arthur Lee: You should not use :normal without a bang in a plugin (it may be the cause). And you don't need any script-local variables here: fun

Re: Installing a word count plugin -- or recommendations of other plugins

2011-07-26 Thread Arthur Lee
Still, I think the following function works great! function! WordCount() let s:old_status=v:statusmsg exe "silent normal g\" let s:word_count=str2nr(split(v:statusmsg)[11]) let v:statusmsg=s:old_status return s:word_count endfunction As for the errors when open the macvim, I think it may be ly

Re: Installing a word count plugin -- or recommendations of other plugins

2011-07-25 Thread ZyX
Reply to message «Re: Installing a word count plugin -- or recommendations of other plugins», sent 17:57:37 25 July 2011, Monday by Albie Janse van Rensburg: It also makes sense to use :%sm/... or :%s/\v<.{-}>//gn: both make you independent of 'magic' setting. Original mess

Re: Installing a word count plugin -- or recommendations of other plugins

2011-07-25 Thread Albie Janse van Rensburg
On Jul 25, 2011, at 9:18 AM, Albie Janse van Rensburg wrote: :%s/\<.\{-}\>//gn | set nohlsearch Correction, it should be :%s/\<.\{-}\>//gn | nohlsearch the "set" makes your hlsearch setting permanent. -- .--. |

Re: Installing a word count plugin -- or recommendations of other plugins

2011-07-25 Thread Eric Weir
On Jul 25, 2011, at 9:18 AM, Albie Janse van Rensburg wrote: > Just for reference, this following command will return a list of matches too > (the regex can probably be improved): > > :%s/\<.\{-}\>//gn | set nohlsearch > > ... a "search and replace" command that only counts all matches (and do

Re: Installing a word count plugin -- or recommendations of other plugins

2011-07-25 Thread Albie Janse van Rensburg
Eric Weir wrote on 22/07/2011 02:03 AM: On Jul 21, 2011, at 7:38 PM, Andy Wokula wrote: I'd assume that a word count is supposed to count words ("word" as in :h word), not WORDs. So here is a simple command you can put in the vimrc: Thanks, Andy. I'm assuming given the above that you cooked t

Re: Installing a word count plugin -- or recommendations of other plugins

2011-07-21 Thread Eric Weir
On Jul 21, 2011, at 7:38 PM, Andy Wokula wrote: > I'd assume that a word count is supposed to count words ("word" as in :h > word), not WORDs. So here is a simple command you can put in the vimrc: Thanks, Andy. I'm assuming given the above that you cooked that script up special order. If so, I

Re: Installing a word count plugin -- or recommendations of other plugins

2011-07-21 Thread Andy Wokula
Am 21.07.2011 16:20, schrieb Eric Weir: I would like to have a word count plugin to replace the g command. The results of the latter are displayed so briefly and amongst other details that it is hard to be certain what they are. I've found a "manuscript word count" plugin at vim.org. The creato

Re: Installing a word count plugin -- or recommendations of other plugins

2011-07-21 Thread Eric Weir
On Jul 21, 2011, at 12:42 PM, Xell Liu wrote: > Maybe this article could help: > > http://stackoverflow.com/questions/114431/fast-word-count-function-in-vim/120386 > > I used the code from the last comment, although nobody voted for it. Thanks, Xell. [Or should that be Liu?] I came across that

Re: Installing a word count plugin -- or recommendations of other plugins

2011-07-21 Thread Xell Liu
Maybe this article could help: http://stackoverflow.com/questions/114431/fast-word-count-function-in-vim/120386 I used the code from the last comment, although nobody voted for it. On Thu, Jul 21, 2011 at 10

Installing a word count plugin -- or recommendations of other plugins

2011-07-21 Thread Eric Weir
I would like to have a word count plugin to replace the g command. The results of the latter are displayed so briefly and amongst other details that it is hard to be certain what they are. I've found a "manuscript word count" plugin at vim.org. The creator explains that "Standard word count u