← back to marketplace
W

Word Count

Displays a live word and character count for the active file in the status bar.

versionv1.0.0
authortomlin7
installs0
tags
statusbarwritingutility
install
ted ext install word-count

or copy to ~/.ted/extensions/word-count/

readme

word count

a ted extension that shows a live word and character count for the active file in the status bar.

features

  • adds a w: / c: status bar item (right-aligned)
  • updates live on fileOpened, fileSaved, and contentChanged events
  • resets cleanly when the file is closed

installation

ted ext install word-count

or manually copy this folder to ~/.ted/extensions/word-count/.

usage

once installed and activated the status bar will show something like:

W: 342  C: 1 895

no commands needed — it works automatically.

extension api used

apiusage
api.statusbar.addItemadds the counter item on activation
api.statusbar.updateItemrefreshes the count on each event
api.fs.readFilereads file content to count on open/save
api.onEventsubscribes to fileOpened, fileSaved, contentChanged, fileClose

how it works

api.onEvent("contentChanged", (data) => {
  const words = data.content.trim().split(/\s+/).length;
  const chars = data.content.length;
  api.statusbar.updateItem("word-count.statusbar", `W: ${words}  C: ${chars}`);
});