A minimal word count tracking plugin for writers. Set a daily word count goal, track your progress across sessions, and view your writing streak on a calendar.
- Daily word count tracking - Counts net words written across all files while tracking is active
- Persistent goals - Set your target once, it applies every day until you change it
- Multiple stars - Earn multiple stars per day by hitting multiples of your target
- Calendar view - See your current month with stars for each day you hit your goal
- Streak tracking - Track consecutive days of hitting your target
- Session-based activation - Only counts words when you explicitly start tracking
mkdir -p ~/.vim/plugin
curl -o ~/.vim/plugin/wordtracker.vim [URL_TO_RAW_FILE]Plug 'yourusername/wordtracker.vim'Plugin 'yourusername/wordtracker.vim'use 'yourusername/wordtracker.vim'| Command | Description |
|---|---|
:WordTracker |
Start tracking words for this session |
:WordTrackerStop |
Stop tracking words |
:WordTarget N |
Set daily goal to N words (persists until changed) |
:WordStatus |
Show today's progress, stars earned, and words until next star |
:WordCalendar |
Open calendar view showing current month and streak |
-
Set your daily target (only need to do this once):
:WordTarget 500 -
Start tracking when you begin writing:
:WordTracker -
Write and save your work as normal. You'll see a notification each time you earn a star.
-
Check your progress anytime:
:WordStatus -
View your calendar and streak:
:WordCalendar
WordTracker Status:
Today: 750 words
Target: 500 words
Stars: 1 ★
Next star in: 250 words
Session: 750 words (tracking active)
WordTracker Calendar
====================
January 2025
Su Mo Tu We Th Fr Sa
----------------------------
★ ★ ★★ ★ 4
5 6 ★ ★ 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
----------------------------
Current streak: 4 days
Target: 500 words
(Press q to close)
- Uses Vim's built-in
wordcount()function - Tracks the net change in words (deletions reduce your count)
- Counts words across all buffers while tracking is active
- Only counts words in files you save
WordTracker stores data in ~/.vim/wordtracker.json:
{
"target": 500,
"days": [
{"date": "2025-01-06", "words": 523},
{"date": "2025-01-07", "words": 1050}
]
}If you write in multiple sessions throughout the day, your word counts accumulate. Morning session of 300 words plus evening session of 200 words equals 500 words for the day.
Stars are calculated as floor(words / target). With a 500-word target:
- 499 words = 0 stars
- 500 words = 1 star
- 999 words = 1 star
- 1000 words = 2 stars
You receive a notification each time you cross a new star threshold.
Your streak counts consecutive days where you earned at least one star. Missing a day resets the streak to zero. Today doesn't break your streak if you haven't hit your target yet—only completed days count against you.
WordTracker pairs well with distraction-free writing setups. Example integration with goyo.vim and vim-pencil:
function! s:WritingModeStart()
WordTracker
Goyo
SoftPencil
endfunction
function! s:WritingModeStop()
WordTrackerStop
Goyo!
NoPencil
endfunction
command! WriteOn call s:WritingModeStart()
command! WriteOff call s:WritingModeStop()Currently, WordTracker uses sensible defaults with no configuration options. The data file is stored at ~/.vim/wordtracker.json.
- Vim 8.0+ (for
json_encode/json_decode) - Unix-like system (Linux, macOS) for date calculations
MIT
Issues and pull requests welcome.