Live Word Count
A lightweight VS Code extension that displays real-time word and character count in the status bar for the currently active text editor.
Features
- Real-time counting: Updates automatically as you type or move the cursor
- Selection support: Shows counts for selected text when you highlight content
- Multiple file types: Supports plaintext, Markdown, JavaScript, TypeScript, Python, HTML, CSS, and JSON
- Status bar integration: Clean, unobtrusive display in the VS Code status bar
- Toggle functionality: Easy enable/disable via Command Palette
- Lightweight: Minimal performance impact on your editor
Usage
Automatic Counting
- Open any supported file type (see supported languages below)
- The word and character count will automatically appear in the status bar
- Counts update in real-time as you type or navigate
Selection Counting
- Select any text in the editor
- The status bar will show counts for the selection with "(selection)" indicator
- Deselect text to return to full document counting
Toggle On/Off
- Open Command Palette (
Ctrl+Shift+P or Cmd+Shift+P )
- Type "Toggle Live Word Count"
- Press Enter to enable/disable
- Or click the word count in the status bar to toggle
Supported Languages
- Plain Text
- Markdown
- JavaScript
- TypeScript
- Python
- HTML
- CSS
- JSON
Status Bar Display
The extension shows information in this format:
📝 42 words, 234 chars
When text is selected:
📝 15 words, 89 chars (selection)
Configuration
You can configure the extension in VS Code settings:
liveWordCount.enabled : Enable/disable live word counting (default: true)
Installation
- Install from VS Code Marketplace
- Or build from source:
npm install
npm run compile
vsce package
code --install-extension live-word-count-1.0.0.vsix
Requirements
How It Works
- Word Count: Splits text by whitespace and counts non-empty segments
- Character Count: Counts all characters excluding spaces and whitespace
- Performance: Only processes visible text and uses efficient counting algorithms
- Selection Priority: When text is selected, shows selection stats instead of document stats
Development
Setup
npm install
npm run compile
Testing
npm run watch # For development with auto-compilation
Publishing
vsce package
vsce publish
Changelog
1.0.0
- Initial release
- Real-time word and character counting
- Selection support
- Status bar integration
- Toggle functionality
- Support for multiple file types
License
MIT License - see LICENSE file for details.
Contributing
Feel free to submit issues and enhancement requests!
| |