Skip to content

Commit d96ffee

Browse files
committed
feat: optimise, lazy load
1 parent 9d2c505 commit d96ffee

28 files changed

+1647
-3115
lines changed

β€ŽREADME.mdβ€Ž

Lines changed: 107 additions & 143 deletions
Original file line numberDiff line numberDiff line change
@@ -1,206 +1,170 @@
11
# codeme.nvim
22

3-
> Beautiful coding activity dashboard for Neovim
3+
> Beautiful coding dashboard for Neovim
4+
5+
Zero config. 100% private. Auto-adapts to your colorscheme.
6+
7+
![Overview](./docs/img/overview.png)
48

59
## Features
610

7-
- 100% private and local - all data stored in SQLite on your machine
8-
- Tab-based dashboard with 6 interactive views
9-
- GitHub-style contribution heatmap (12 weeks)
10-
- Language and project breakdowns with visual bar graphs
11-
- Daily goals with progress tracking
12-
- Streak tracking with flame visualization
13-
- Achievements and gamification
14-
- Session tracking for focused coding periods
15-
- Trend comparisons (today vs yesterday, this week vs last)
16-
- Peak productivity insights
17-
- Auto-tracking on file save
18-
- Zero config - works out of the box
19-
- **Adaptive colorscheme** - automatically adapts to ANY Neovim colorscheme (Catppuccin, Gruvbox, Tokyo Night, Nord, etc.)
20-
- Smooth colorscheme transitions - updates instantly when you change themes
11+
- Local-only, privacy-first SQLite storage
12+
- Heatmaps, streaks, achievements, and daily goals
13+
- Automatic session tracking with idle detection and theme support
14+
15+
## Prerequisites
2116

22-
## Privacy
17+
codeme.nvim requires the **codeme binary** (the backend) to be installed on your system.
18+
The plugin does not install it automatically, you need to set it up once before first use.
2319

24-
Your coding data never leaves your machine:
20+
**Easiest way β€” download a prebuilt binary** (no Go or compiler needed):
2521

26-
- SQLite database stored locally at `~/.local/share/codeme/`
27-
- No accounts, no cloud sync, no telemetry
28-
- You own your data
22+
β†’ [GitHub Releases](https://github.com/tduyng/codeme/releases/latest)
2923

30-
## Installation
24+
Pick the one for your platform, extract it, and put it somewhere on your `PATH`.
3125

32-
### Prerequisites
26+
**Or install with Go** (requires [Go 1.25+](https://go.dev/dl/) and a C compiler):
27+
28+
```bash
29+
go install github.com/tduyng/codeme@latest
30+
```
31+
32+
> See the [codeme backend repo](https://github.com/tduyng/codeme) for full install options and details.
33+
34+
After install, verify it works:
35+
36+
```bash
37+
codeme stats
38+
```
3339

34-
- Neovim >= 0.11
35-
- [Codeme binary](https://github.com/tduyng/codeme) - auto-installed on first use
40+
## Install
3641

37-
### Using lazy.nvim
42+
### lazy.nvim
3843

3944
```lua
4045
{
4146
"tduyng/codeme.nvim",
47+
cmd = { "CodeMe", "CodeMeToggle" },
4248
config = function()
43-
require("codeme").setup({
44-
-- Optional configuration
45-
auto_install = true, -- Auto-install binary if not found (default: true)
46-
auto_track = true, -- Auto track on save (default: true)
47-
})
49+
require("codeme").setup()
4850
end,
49-
cmd = { "CodeMe", "CodeMeToggle", "CodeMeInstall" },
5051
}
5152
```
5253

53-
### Using native vim.pack (Neovim 0.12+)
54+
### vim.pack (Neovim 0.12+)
5455

5556
```lua
56-
vim.pack.add({
57-
"https://github.com/tduyng/codeme.nvim",
58-
})
59-
57+
vim.pack.add("https://github.com/tduyng/codeme.nvim")
6058
require("codeme").setup()
6159
```
6260

63-
### Binary Installation
64-
65-
The codeme binary will be **automatically installed** on first use. If you prefer manual installation:
66-
67-
```bash
68-
# Download from GitHub releases
69-
# Go to https://github.com/tduyng/codeme/releases
70-
# Download for your platform (macOS arm64 or x86_64)
71-
72-
# Or use the Neovim command
73-
:CodeMeInstall
74-
```
75-
7661
## Usage
7762

78-
### Commands
79-
80-
| Command | Description |
81-
| ----------------- | ---------------------------------------- |
82-
| `:CodeMe` | Open the beautiful dashboard |
83-
| `:CodeMeToggle` | Toggle dashboard visibility |
84-
| `:CodeMeToday` | Show today's stats notification |
85-
| `:CodeMeProjects` | Show project breakdown |
86-
| `:CodeMeInstall` | Install/update codeme binary from GitHub |
87-
| `:CodeMeVersion` | Show installed codeme version |
63+
```vim
64+
:CodeMe " Open dashboard
65+
:CodeMeToggle " Toggle visibility
66+
:CodeMeToday " Today's stats notification
67+
```
8868

89-
### Dashboard
69+
**Keybinding example:**
9070

91-
**Navigation**
71+
```lua
72+
vim.keymap.set("n", "<leader>cm", "<cmd>CodeMe<cr>")
73+
```
9274

93-
- `<Tab>` or `L` - Next tab
94-
- `<S-Tab>` or `H` - Previous tab
95-
- `1-6` - Jump to specific tab
96-
- `q` or `<Esc>` - Close dashboard
75+
## Dashboard
9776

98-
**Tabs**
77+
**Navigate:**
9978

100-
1. **β˜€οΈ Today** - Today's coding session with time, lines, files, languages, top files, sessions, hourly activity, and daily goal progress
101-
2. **πŸ“… Weekly** - Week summary with comparison to last week and GitHub-style contribution heatmap
102-
3. **πŸ“Š Overview** - Overall stats with streak flames, coding trends, and totals
103-
4. **πŸ’‘ Insights** - Peak productivity times, comparisons, and achievements
104-
5. **πŸ’» Languages** - Top languages breakdown with time and lines
105-
6. **πŸ”₯ Projects** - Active projects breakdown
79+
- `Tab` / `L` β†’ Next tab
80+
- `Shift-Tab` / `H` β†’ Previous tab
81+
- `1-5` β†’ Jump to tab
82+
- `q` / `Esc` β†’ Close
10683

107-
#### Today
84+
**Tabs:**
10885

109-
![today](./docs/img/today.png)
86+
| Tab | Content |
87+
| ---------------- | ---------------------------------------- |
88+
| πŸ“Š **Dashboard** | Goals, streaks, performance overview |
89+
| ⏰ **Activity** | Today's sessions, languages, files |
90+
| πŸ“… **Weekly** | Daily breakdown, weekly trends |
91+
| πŸ“ **Work** | Projects and languages breakdown |
92+
| πŸ† **Records** | Personal bests, achievements, milestones |
11093

111-
#### Overview
94+
![Today](./docs/img/today.png)
11295

113-
![overview](./docs/img/overview.png)
96+
![Languages](./docs/img/languages.png)
11497

115-
#### Languages
98+
![Projects](./docs/img/projects.png)
11699

117-
![languages](./docs/img/languages.png)
100+
## Achievements
118101

119-
#### Projects
102+
Unlock achievements as you code:
120103

121-
![projects](./docs/img/projects.png)
104+
| Icon | Name | Unlock |
105+
| ---- | ----------------- | ------------------- |
106+
| πŸ”₯ | 5-Day Fire | 5-day streak |
107+
| 🧨 | 30-Day Streak | 30-day streak |
108+
| πŸ’₯ | 90-Day Inferno | 90-day streak |
109+
| πŸŒ‹ | 180-Day Blaze | 180-day streak |
110+
| 🌞 | Eternal Flame | 365-day streak |
111+
| 🌧️ | 1K Line Wave | 1,000 lines |
112+
| ⚑ | 10K Line Surge | 10,000 lines |
113+
| β›ˆοΈ | 50K Line Flood | 50,000 lines |
114+
| 🌊 | 100K Line Ocean | 100,000 lines |
115+
| ⚑ | 50h Spark | 50 hours total |
116+
| 🌩️ | 1K h Lightning | 1,000 hours |
117+
| β›ˆοΈ | 5K h Thunder | 5,000 hours |
118+
| πŸŒ€ | 10K h Mastery | 10,000 hours |
119+
| πŸ’‘ | 20K h Grandmaster | 20,000 hours |
120+
| πŸš€ | Bilingual | 2 languages |
121+
| 🌍 | Polyglot | 5 languages |
122+
| 🧠 | Polyglot Master | 10 languages |
123+
| πŸŽ“ | Code Polymath | 15 languages |
124+
| πŸŒ… | Dawn Coder | Code before 6 AM |
125+
| 🌌 | Night Coder | Code after midnight |
126+
| β˜• | 2h Warm Up | 2+ hour session |
127+
| 🎯 | 4h Focus | 4+ hour session |
128+
| 🌊 | 6h Flow State | 6+ hour session |
129+
| 🧠 | 8h Deep Work | 8+ hour session |
130+
| πŸ§˜β€β™‚οΈ | 10h Monk Mode | 10+ hour session |
131+
| πŸ‘‘ | 12h Legendary | 12+ hour session |
122132

123133
## Configuration
124134

135+
Here are the default configs:
136+
125137
```lua
126138
require("codeme").setup({
127-
-- Binary settings
128-
codeme_bin = "codeme", -- Binary name (auto-detected if installed)
129-
auto_install = true, -- Auto-install binary if not found
130-
131-
-- Tracking settings
132-
auto_track = true, -- Track files on save
133-
track_on_idle = false, -- Track on cursor idle (not implemented)
139+
-- Binary
140+
codeme_bin = "codeme", -- Auto-detected
134141

135-
-- UI settings
136-
verbose = false, -- Show tracking notifications
142+
-- Tracking
143+
auto_track = true, -- Track on save
144+
verbose = false, -- Show notifications
137145

138-
-- Daily goals (set to 0 to disable)
146+
-- Goals (0 to disable)
139147
goals = {
140-
daily_hours = 4, -- Daily goal in hours
141-
daily_lines = 500, -- Daily goal in lines
148+
daily_hours = 4, -- Hours per day
149+
daily_lines = 500, -- Lines per day
142150
},
143151
})
144152
```
145153

146-
### Custom Keybinding
147-
148-
```lua
149-
vim.keymap.set("n", "<leader>cm", "<cmd>CodeMe<cr>", { desc = "Open CodeMe Dashboard" })
150-
vim.keymap.set("n", "<leader>ct", "<cmd>CodeMeToggle<cr>", { desc = "Toggle CodeMe" })
151-
```
152-
153-
## Colorscheme Support
154-
155-
CodeMe automatically adapts to **ANY** Neovim colorscheme! It intelligently extracts colors from your active theme's highlight groups, ensuring the dashboard always looks beautiful and cohesive.
156-
157-
### How it works
154+
### Binary lookup order
158155

159-
- **Automatic color extraction** - Colors are pulled from standard highlight groups (String, Function, Error, etc.)
160-
- **Instant updates** - Dashboard colors update automatically when you change colorschemes
161-
- **Universal compatibility** - Works with ALL colorschemes: Catppuccin, Gruvbox, Tokyo Night, Nord, Everforest, Kanagawa, and more
162-
- **Graceful fallbacks** - If a color isn't found, it intelligently falls back to ensure nothing breaks
156+
The plugin searches for the `codeme` binary in this order:
163157

164-
### Example
165-
166-
```lua
167-
-- Switch colorscheme anytime - CodeMe adapts instantly!
168-
vim.cmd.colorscheme("catppuccin")
169-
vim.cmd("CodeMe")
170-
171-
-- Change to Gruvbox - dashboard colors update automatically
172-
vim.cmd.colorscheme("gruvbox")
173-
vim.cmd("CodeMe")
174-
175-
-- Try Tokyo Night - perfect color harmony maintained
176-
vim.cmd.colorscheme("tokyonight")
177-
vim.cmd("CodeMe")
178-
```
179-
180-
No configuration needed - it just works! The dashboard will always match your editor's aesthetic.
181-
182-
## Achievements
183-
184-
Unlock achievements as you code:
158+
1. `CODEME_BIN` environment variable
159+
2. System `PATH` (i.e. the default `codeme` command)
160+
3. `~/.local/share/nvim/codeme/codeme` (local data directory)
185161

186-
| Achievement | Description |
187-
| ---------------------- | -------------------------------- |
188-
| 🎯 First Steps | Track your first coding activity |
189-
| πŸ”₯ Getting Started | Maintain a 3-day coding streak |
190-
| ⚑ Weekly Warrior | Maintain a 7-day coding streak |
191-
| πŸ‘‘ Monthly Master | Maintain a 30-day coding streak |
192-
| πŸ’» Code Machine | Write 1,000 lines of code |
193-
| πŸš€ Prolific Programmer | Write 10,000 lines of code |
194-
| ⏰ Dedicated Developer | Code for 10 hours total |
195-
| πŸ† Century Coder | Code for 100 hours total |
196-
| 🌍 Polyglot | Code in 5 different languages |
197-
| πŸŒ… Early Bird | Code before 7 AM |
198-
| πŸ¦‰ Night Owl | Code after midnight |
162+
If none is found, the plugin will show an error when you open the dashboard. Install the backend using the instructions in [Prerequisites](#prerequisites).
199163

200164
## License
201165

202166
MIT
203167

204168
---
205169

206-
Made with ❀️ for the Neovim community
170+
Made with ❀️ for Neovim

0 commit comments

Comments
Β (0)