|
1 | 1 | # codeme.nvim |
2 | 2 |
|
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 | + |
4 | 8 |
|
5 | 9 | ## Features |
6 | 10 |
|
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 |
21 | 16 |
|
22 | | -## Privacy |
| 17 | +codeme.nvim requires the [codeme binary](https://github.com/tduyng/codeme) (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. |
23 | 19 |
|
24 | | -Your coding data never leaves your machine: |
| 20 | +**Easiest way β download a prebuilt binary** (no Go or compiler needed): |
25 | 21 |
|
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) |
29 | 23 |
|
30 | | -## Installation |
| 24 | +Pick the one for your platform, extract it, and put it somewhere on your `PATH`. |
31 | 25 |
|
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 | +``` |
33 | 39 |
|
34 | | -- Neovim >= 0.11 |
35 | | -- [Codeme binary](https://github.com/tduyng/codeme) - auto-installed on first use |
| 40 | +## Install |
36 | 41 |
|
37 | | -### Using lazy.nvim |
| 42 | +### lazy.nvim |
38 | 43 |
|
39 | 44 | ```lua |
40 | 45 | { |
41 | 46 | "tduyng/codeme.nvim", |
| 47 | + cmd = { "CodeMe", "CodeMeToggle" }, |
42 | 48 | 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() |
48 | 50 | end, |
49 | | - cmd = { "CodeMe", "CodeMeToggle", "CodeMeInstall" }, |
50 | 51 | } |
51 | 52 | ``` |
52 | 53 |
|
53 | | -### Using native vim.pack (Neovim 0.12+) |
| 54 | +### vim.pack (Neovim 0.12+) |
54 | 55 |
|
55 | 56 | ```lua |
56 | | -vim.pack.add({ |
57 | | - "https://github.com/tduyng/codeme.nvim", |
58 | | -}) |
59 | | - |
| 57 | +vim.pack.add("https://github.com/tduyng/codeme.nvim") |
60 | 58 | require("codeme").setup() |
61 | 59 | ``` |
62 | 60 |
|
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 | | - |
76 | 61 | ## Usage |
77 | 62 |
|
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 | +``` |
88 | 68 |
|
89 | | -### Dashboard |
| 69 | +**Keybinding example:** |
90 | 70 |
|
91 | | -**Navigation** |
| 71 | +```lua |
| 72 | +vim.keymap.set("n", "<leader>cm", "<cmd>CodeMe<cr>") |
| 73 | +``` |
92 | 74 |
|
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 |
97 | 76 |
|
98 | | -**Tabs** |
| 77 | +**Navigate:** |
99 | 78 |
|
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 |
106 | 83 |
|
107 | | -#### Today |
| 84 | +**Tabs:** |
108 | 85 |
|
109 | | - |
| 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 | |
110 | 93 |
|
111 | | -#### Overview |
| 94 | + |
112 | 95 |
|
113 | | - |
| 96 | + |
114 | 97 |
|
115 | | -#### Languages |
| 98 | + |
116 | 99 |
|
117 | | - |
| 100 | +## Achievements |
118 | 101 |
|
119 | | -#### Projects |
| 102 | +Unlock achievements as you code: |
120 | 103 |
|
121 | | - |
| 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 | |
122 | 132 |
|
123 | 133 | ## Configuration |
124 | 134 |
|
| 135 | +Here are the default configs: |
| 136 | + |
125 | 137 | ```lua |
126 | 138 | 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 |
134 | 141 |
|
135 | | - -- UI settings |
136 | | - verbose = false, -- Show tracking notifications |
| 142 | + -- Tracking |
| 143 | + auto_track = true, -- Track on save |
| 144 | + verbose = false, -- Show notifications |
137 | 145 |
|
138 | | - -- Daily goals (set to 0 to disable) |
| 146 | + -- Goals (0 to disable) |
139 | 147 | 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 |
142 | 150 | }, |
143 | 151 | }) |
144 | 152 | ``` |
145 | 153 |
|
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 |
158 | 155 |
|
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: |
163 | 157 |
|
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) |
185 | 161 |
|
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). |
199 | 163 |
|
200 | 164 | ## License |
201 | 165 |
|
202 | 166 | MIT |
203 | 167 |
|
204 | 168 | --- |
205 | 169 |
|
206 | | -Made with β€οΈ for the Neovim community |
| 170 | +Made with β€οΈ for Neovim |
0 commit comments