Skip to content

Commit 3b9d849

Browse files
committed
feat: add ccusage.nvim plugin file
1 parent 526afed commit 3b9d849

File tree

2 files changed

+25
-37
lines changed

2 files changed

+25
-37
lines changed

plugin/base.lua

Lines changed: 0 additions & 37 deletions
This file was deleted.

plugin/ccusage.lua

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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

0 commit comments

Comments
 (0)