File tree Expand file tree Collapse file tree 2 files changed +25
-37
lines changed Expand file tree Collapse file tree 2 files changed +25
-37
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ -- ccusage.nvim plugin entry point
2+ -- This file defines user commands for interacting with the plugin
3+
4+ local cli = require (" ccusage.cli" )
5+
6+ --- Display current Claude Code usage status
7+ --- @return nil
8+ local function status_cmd ()
9+ local blocks_data = cli .ccusage_blocks ()
10+ if blocks_data and blocks_data .blocks and # blocks_data .blocks > 0 then
11+ vim .print (" Current Claude Code usage blocks:" )
12+ vim .print (vim .inspect (blocks_data ))
13+ else
14+ vim .print (" No Claude Code usage data found" )
15+ end
16+ end
17+
18+ -- TODO: change the command behavior to notify with usage stats
19+ vim .api .nvim_create_user_command (" CCUsage" , status_cmd , {
20+ desc = " Show Claude Code usage status" ,
21+ })
22+
23+ -- RESOURCES:
24+ -- - :help lua-guide-commands-create
25+ -- - https://github.com/nvim-neorocks/nvim-best-practices?tab=readme-ov-file#speaking_head-user-commands
You can’t perform that action at this time.
0 commit comments