Skip to content

Commit 5e513e5

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

29 files changed

+1716
-3420
lines changed

β€ŽREADME.mdβ€Ž

Lines changed: 96 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -1,206 +1,164 @@
11
# codeme.nvim
22

3-
> Beautiful coding activity dashboard for Neovim
3+
> Beautiful coding dashboard for Neovim
44
5-
## Features
6-
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
21-
22-
## Privacy
5+
Zero config. 100% private. Auto-adapts to your colorscheme.
236

24-
Your coding data never leaves your machine:
7+
![Overview](./docs/img/overview.png)
258

26-
- SQLite database stored locally at `~/.local/share/codeme/`
27-
- No accounts, no cloud sync, no telemetry
28-
- You own your data
9+
## Install
2910

30-
## Installation
31-
32-
### Prerequisites
33-
34-
- Neovim >= 0.11
35-
- [Codeme binary](https://github.com/tduyng/codeme) - auto-installed on first use
36-
37-
### Using lazy.nvim
11+
### lazy.nvim
3812

3913
```lua
4014
{
4115
"tduyng/codeme.nvim",
16+
cmd = { "CodeMe", "CodeMeToggle" },
4217
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-
})
18+
require("codeme").setup()
4819
end,
49-
cmd = { "CodeMe", "CodeMeToggle", "CodeMeInstall" },
5020
}
5121
```
5222

53-
### Using native vim.pack (Neovim 0.12+)
23+
### vim.pack (Neovim 0.12+)
5424

5525
```lua
56-
vim.pack.add({
57-
"https://github.com/tduyng/codeme.nvim",
58-
})
59-
26+
vim.pack.add("https://github.com/tduyng/codeme.nvim")
6027
require("codeme").setup()
6128
```
6229

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-
```
30+
The [codeme binary](https://github.com/tduyng/codeme) auto-installs on first use.
7531

7632
## Usage
7733

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 |
34+
```vim
35+
:CodeMe " Open dashboard
36+
:CodeMeToggle " Toggle visibility
37+
:CodeMeToday " Today's stats notification
38+
```
8839

89-
### Dashboard
40+
**Keybinding example:**
9041

91-
**Navigation**
42+
```lua
43+
vim.keymap.set("n", "<leader>cm", "<cmd>CodeMe<cr>")
44+
```
9245

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
46+
## Dashboard
9747

98-
**Tabs**
48+
**Navigate:**
9949

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
50+
- `Tab` / `L` β†’ Next tab
51+
- `Shift-Tab` / `H` β†’ Previous tab
52+
- `1-5` β†’ Jump to tab
53+
- `q` / `Esc` β†’ Close
10654

107-
#### Today
55+
**Tabs:**
10856

109-
![today](./docs/img/today.png)
57+
| Tab | Content |
58+
| --------------- | ----------------------------------- |
59+
| πŸ“Š **Overview** | Streaks, achievements, totals |
60+
| ⏰ **Activity** | Today's sessions, languages, files |
61+
| πŸ“… **Weekly** | GitHub-style heatmap, weekly trends |
62+
| πŸ“ **Work** | Projects and languages breakdown |
63+
| πŸ† **Records** | Personal bests and milestones |
11064

111-
#### Overview
65+
![Today](./docs/img/today.png)
66+
![Languages](./docs/img/languages.png)
67+
![Projects](./docs/img/projects.png)
11268

113-
![overview](./docs/img/overview.png)
69+
## Features
11470

115-
#### Languages
71+
✨ Auto-tracking - Saves trigger tracking automatically
72+
πŸ”’ Private - SQLite database at `~/.local/share/codeme/`
73+
🎨 Adaptive - Matches ANY colorscheme instantly
74+
πŸ“Š 12-week heatmap - GitHub-style contribution graph
75+
πŸ”₯ Streaks - Track your coding momentum
76+
πŸ† Achievements - Unlock as you code
77+
πŸ“ˆ Goals - Daily time and lines targets
78+
⚑ Sessions - 15min idle timeout grouping
11679

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

119-
#### Projects
82+
Unlock achievements as you code:
12083

121-
![projects](./docs/img/projects.png)
84+
| Icon | Name | Unlock |
85+
| ---- | ----------------- | ------------------- |
86+
| πŸ”₯ | 5-Day Fire | 5-day streak |
87+
| 🧨 | 30-Day Streak | 30-day streak |
88+
| πŸ’₯ | 90-Day Inferno | 90-day streak |
89+
| πŸŒ‹ | 180-Day Blaze | 180-day streak |
90+
| 🌞 | Eternal Flame | 365-day streak |
91+
| 🌧️ | 1K Line Wave | 1,000 lines |
92+
| ⚑ | 10K Line Surge | 10,000 lines |
93+
| β›ˆοΈ | 50K Line Flood | 50,000 lines |
94+
| 🌊 | 100K Line Ocean | 100,000 lines |
95+
| ⚑ | 50h Spark | 50 hours total |
96+
| 🌩️ | 1K h Lightning | 1,000 hours |
97+
| β›ˆοΈ | 5K h Thunder | 5,000 hours |
98+
| πŸŒ€ | 10K h Mastery | 10,000 hours |
99+
| πŸ’‘ | 20K h Grandmaster | 20,000 hours |
100+
| πŸš€ | Bilingual | 2 languages |
101+
| 🌍 | Polyglot | 5 languages |
102+
| 🧠 | Polyglot Master | 10 languages |
103+
| πŸŽ“ | Code Polymath | 15 languages |
104+
| πŸŒ… | Dawn Coder | Code before 6 AM |
105+
| 🌌 | Night Coder | Code after midnight |
106+
| β˜• | 2h Warm Up | 2+ hour session |
107+
| 🎯 | 4h Focus | 4+ hour session |
108+
| 🌊 | 6h Flow State | 6+ hour session |
109+
| 🧠 | 8h Deep Work | 8+ hour session |
110+
| πŸ§˜β€β™‚οΈ | 10h Monk Mode | 10+ hour session |
111+
| πŸ‘‘ | 12h Legendary | 12+ hour session |
122112

123113
## Configuration
124114

125115
```lua
126116
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
117+
-- Binary
118+
codeme_bin = "codeme", -- Auto-detected
119+
auto_install = true, -- Install if missing
130120

131-
-- Tracking settings
132-
auto_track = true, -- Track files on save
133-
track_on_idle = false, -- Track on cursor idle (not implemented)
121+
-- Tracking
122+
auto_track = true, -- Track on save
123+
verbose = false, -- Show notifications
134124

135-
-- UI settings
136-
verbose = false, -- Show tracking notifications
137-
138-
-- Daily goals (set to 0 to disable)
125+
-- Goals (0 to disable)
139126
goals = {
140-
daily_hours = 4, -- Daily goal in hours
141-
daily_lines = 500, -- Daily goal in lines
127+
daily_hours = 4, -- Hours per day
128+
daily_lines = 500, -- Lines per day
142129
},
143130
})
144131
```
145132

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-
```
133+
## Colorscheme Magic
152134

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
158-
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
163-
164-
### Example
135+
Works with **every** colorscheme automatically:
165136

166137
```lua
167-
-- Switch colorscheme anytime - CodeMe adapts instantly!
168138
vim.cmd.colorscheme("catppuccin")
169-
vim.cmd("CodeMe")
139+
vim.cmd("CodeMe") -- Perfect Catppuccin colors
170140

171-
-- Change to Gruvbox - dashboard colors update automatically
172141
vim.cmd.colorscheme("gruvbox")
173-
vim.cmd("CodeMe")
142+
vim.cmd("CodeMe") -- Now perfectly Gruvbox
174143

175-
-- Try Tokyo Night - perfect color harmony maintained
176144
vim.cmd.colorscheme("tokyonight")
177-
vim.cmd("CodeMe")
145+
vim.cmd("CodeMe") -- Instantly Tokyo Night themed
178146
```
179147

180-
No configuration needed - it just works! The dashboard will always match your editor's aesthetic.
148+
No config needed. It extracts colors from your active theme and updates instantly when you change colorschemes.
181149

182-
## Achievements
150+
## Privacy
183151

184-
Unlock achievements as you code:
152+
Your data never leaves your machine:
185153

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 |
154+
- SQLite at `~/.local/share/codeme/codeme.db`
155+
- No accounts, no cloud, no telemetry
156+
- You own everything
199157

200158
## License
201159

202160
MIT
203161

204162
---
205163

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

0 commit comments

Comments
Β (0)