counting the words in vi editor.
how to count the number of words in vi editor?? i am finding the words using / but these seems to be highlighted from there i count the words but it's very difficult to count for the big files. i am looking for the command in the vi editor not in the shell prompt using any sed,awk,or tr commands.
|
Enter the vi command mode, Press Esc then :
Save your file :w filename then do !wc -w filename Code:
:w testfile |
In vim it's "g ctrl-g".
|
From within vim, type:
:help statusline Towards the end of the statusline help section, there are examples of how to enable the status line so that it always shows number of characters, modified, etc. [ edit: I should clarify, this comment ammends Su-Shee's comment re: Ctrl-G. This is a way to see the status line at all times, but has no word count functionality. While such could be implemented, it would be very expensive to perform ] |
vim word count
So many people have been working to expand Vim that I didn't try to read the documentation to find the count words plugin.
I created a Vim file and saved it. Opened gedit -> edit menu -> preferences -> plugins -> enable Document Statistics -> close. Open the file you want with gedit -> tools menu -> Document Statistics |
Excellent!
Now that you mention this Chairman, I do recall seeing that plug-in once, and I thought, why would I ever use that, and forgot all about it. Good call! |
Quote:
similarly i need command that search the words and count that word in the preticular file. |
All times are GMT -5. The time now is 08:58 AM. |