README file from
GithubWord Counter Session
An Obsidian plugin that tracks newly added words during your writing session with optional timer support.
https://github.com/user-attachments/assets/3000a541-e7a2-4b1c-809d-311198694736
Features
- Word Count Tracking: Track words added or removed in current writing session
- Timer Support: Optional timer to measure your writing time
- Smart Word Counting: Consistent with Obsidian's built-in word counter
- Filters out Markdown syntax (links, images, URLs, etc.)
- Supports CJK characters (Chinese, Japanese, Korean) - each character counts as 1 word
- Treats alphanumeric sequences as words
- Status Bar Display: Shows word count difference and elapsed time in status bar
- Sleep Mode: Automatically pauses tracking when switching to another file
- Auto-Stop: Option to automatically stop tracking after a period of inactivity
How to Use
Starting a Session
- Open any Markdown file in Obsidian
- Click the clock icon in the status bar or use the command
Toggle word counter session - The plugin will start tracking word count changes from that point
- A positive number (e.g.,
+42) shows words added; negative shows words removed
Timer
- If enabled, the timer displays elapsed time next to the word count
- Click the timer to pause/resume it
- Timer automatically pauses when switching files (if "Pause timer on file switch" is enabled)
Stopping a Session
Click the word count display in the status bar or use the command Toggle word counter session again.
Settings
Access settings via Settings > Community Plugins > Word Counter Session Settings:
- Enable timer: Display elapsed time alongside word count (default: enabled)
- Pause timer on file switch: Pause timer when switching to another file or closing the editor (default: enabled)
- Enable auto-stop: Automatically stop tracking after a period of inactivity (default: disabled)
- Auto-stop timeout (minutes): Stop tracking after this many minutes of no word count changes (default: 5)
Commands
Toggle word counter session: Start or stop tracking of current filePause/resume timer: Pause or resume the timer (only available when tracking)
Word Counting Algorithm
The plugin counts words consistently with Obsidian's built-in counter:
- Removes Markdown syntax:
- Images:
 - Links:
[text](url)- only countstext - WikiLinks:
[[link|alias]]- only countsalias - Embeds:
![[link]] - URLs:
https://example.com
- Images:
- Counts CJK characters as words (each character = 1 word)
- Matches continuous alphanumeric sequences as words
Examples:
this_is_a_test→ 4 wordsAsyncGenerator[int]→ 2 wordsfile.txt→ 2 wordsdon't→ 2 words (don,t)
Installation
Automatic Installation (from Community Plugins)
Once this plugin is published to the Obsidian community plugin list:
- Go to Settings > Community Plugins
- Search for "Word Counter Session"
- Click Install
- Enable the plugin
Manual Installation
- Download the latest release from GitHub Releases
- Extract the downloaded files
- Copy
manifest.json,main.js, andstyles.cssto your vault's.obsidian/plugins/word-counter-session/folder - Reload Obsidian and enable the plugin in Settings > Community Plugins
Development
# Install dependencies
npm install
# Development build with watch mode
npm run dev
# Production build
npm run build
Contributing
Contributions are welcome! Please feel free to open an issue or submit a pull request.
License
MIT License - see LICENSE for details.
Credits
Created by MingMing