Word Counting in Org Mode

If you do your writing in Org mode and like to maintain a running word count—especially useful for professional writers and students assigned an \(n\) word paper—Angelo Basile has a nice tip on how to install a word count function to your org buffers.

I temporally installed and enabled wc-mode for this post to see how it works and it seems like an excellent solution if you’re looking for something to keep track of your word count. The exact format of the display is customizable (of course) but the default seems reasonable. Here’s the defcustom from wc-mode.el:

(defcustom wc-modeline-format "WC[%W%w/%tw]"
  "The format string for the modeline.
The detailed information for this minor mode can be shown in many
ways in the modeline. The formatting strings recognized in this
format are as follows.

  %W  Original word count (before changes)
  %L  Original line count
  %C  Original character count
  %w  Change in words
  %l  Change in lines
  %c  Change in characters
  %gc Character change goal
  %gl Line change goal
  %gw Word change goal
  %tw Total words in buffer
  %tl Total lines in buffer
  %tc Total characters in buffer

The default modeline, WC[%W%w/%tw], will display the original number
of words followed by the change in words (delta), followed by the total
number of words in the buffer.
It will looks something like WC[742+360/1100] in the modeline.
"

As you can see, the display is very flexible and can display just about any word-count-type information you want. If you don’t want the word count in every Org buffer, don’t include the add-hook in your configuration and just call wc-mode when you to turn it on.

UPDATE [2017-05-03 Wed 12:21]: Fixed link.

This entry was posted in General and tagged , . Bookmark the permalink.