

HOW TO GET WORD COUNT IN WORD FOR PARAGRAPHS WINDOWS
Unxutils or Cygwin will be of interest to Windows users needing utilities taken for granted by *nix users, including wc.Īn example mapping to F3 is given below. If you are using Windows, use a tool like detex to strip the markup away, leaving the actual text, before piping to wc. If you use LaTeX and you need a printed word count (for a journal paper, etc.), wc's output isn't directly useful, since its count includes all markup and other non-printed parts of the file. For example, people using Vim to edit raw HTML pages may want to tweak the definition so only words actually displayed by a web browser are counted as words, but none of the formatting tags count as a word.Ĭounting number of printed words in a LaTeX document Vim allows you to customize your definition of what counts as a "word". Set statusline +=\ w:%, set laststatus = 2 " show the statusline

You can edit your vimrc file so the word count is always visible in the status line. To get a live word count to show up in the vim status bar is a little tricky, The above writes the current buffer to the standard input of the external wc program. An alternative (which does not require saving the buffer to a file), is to use the command: The initial :w writes the current file so that the external program can read it. For example, in Unix you could do the following to get the word count of the entire file: If you prefer, you can call an external program using the "%" file name expansion. Selected 6 of 358 Lines 37 of 2281 Words 186 of 13426 Bytes

To count the number of words in a block, select the block (for example, type V5j to select 6 lines) and again press g then Ctrl-g. To count the number of words in the current buffer, press g then Ctrl-g. 3 Counting number of printed words in a LaTeX document.
