A lightweight VS Code extension that displays live word and character counts for your document or selection, right in the status bar.
- Multi-language i18n support: English, Spanish, Portuguese (Brazil/Portugal), French, German, Italian, Dutch, Polish, Czech, Turkish, Russian, Ukrainian, Bulgarian, Greek.
- Comprehensive automated tests for all supported languages and pluralization.
- Telemetry API proposal error fixed (no more test failures on push).
- Live count of words and characters for the entire document or the selected text.
- Status bar display with readable formatting and tooltip.
- Internationalization (i18n) for 14+ major languages (see below).
- Works with any text-based language (Markdown, JavaScript, TypeScript, Python, plaintext, etc.).
Status bar (bottom right) shows: 12 words, 80 characters (example)
You can install the extension in two main ways:
- Install from VSIX (local file):
## After you run `npx @vscode/vsce package`, the VSIX will be created in the project root
code --install-extension ./word-and-character-count-0.0.1.vsix- Install from the Marketplace: publish the extension and install it normally from the VS Code extensions view.
- Launch VS Code (or the Extension Development Host during development using F5).
- Open any text file.
- Look at the bottom-right status bar for the counts. If you select text, the status bar shows counts only for the selection.
The extension activates on file open or on common languages (plaintext, markdown, javascript, typescript, python, etc.).
The extension supports the following languages (auto-detected from your VS Code UI):
- English (
en) - Spanish (
es) - Portuguese (
pt,pt-br) - French (
fr) - German (
de) - Italian (
it) - Dutch (
nl) - Polish (
pl) - Czech (
cs) - Turkish (
tr) - Russian (
ru) - Ukrainian (
uk) - Bulgarian (
bg) - Greek (
el)
To add or improve a translation:
- Edit
src/i18n.tsand add/update the translation strings for your language. - Optionally add
package.nls.<lang>.jsonfor package metadata.
Notes:
- The status bar text uses pluralization ("1 word" vs "2 words") handled by the helper in
src/i18n.ts. - All i18n logic is covered by automated tests for every supported language.
This extension does not use VS Code telemetry. All tests and i18n logic are implemented without requiring the telemetry API proposal, so you will not see related errors when running or pushing.
Prerequisites:
- Node.js (recommended v18+)
- npm
Install dependencies and build:
npm install
npm run compile # run webpack once
npm run watch # run webpack in watch mode during developmentRun the extension in the Extension Development Host:
- Open the project in VS Code.
- Press
F5to launch a new Extension Development Host window with the extension loaded.
Lint and tests:
npm run lint
npm testCreate a VSIX package locally using the official packaging tool:
npx @vscode/vsce package --allow-star-activationThis will create a file like word-and-character-count-0.0.1.vsix in the project root. Install it locally with code --install-extension.
To publish to the Visual Studio Marketplace, follow the official publishing guide (you'll need a publisher, a Personal Access Token (PAT) and the vsce or @vscode/vsce tool). Example:
# login and publish (example)
npx @vscode/vsce login <publisher-name>
npx @vscode/vsce publishSee the VS Code extension publishing docs for a step-by-step guide.
Contributions are welcome. A suggested workflow:
- Fork the repository.
- Create a feature branch:
git checkout -b feat/my-feature. - Make changes, include tests where appropriate.
- Run the test suite and linting.
- Open a pull request describing the change.
Please follow the existing code style (TypeScript + ESLint) and keep changes small and focused.
This project is licensed under the MIT License — see the LICENSE file for details.
See CHANGELOG.md for release notes and version history.
- Generated initially with
yo code(VS Code Extension Generator).