forked from coder/claudecode.nvim
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev-config.lua
More file actions
129 lines (115 loc) · 5.84 KB
/
Copy pathdev-config.lua
File metadata and controls
129 lines (115 loc) · 5.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
-- Development configuration for claudecode.nvim
-- This is Thomas's personal config for developing claudecode.nvim
-- Symlink this to your personal Neovim config:
-- ln -s ~/projects/claudecode.nvim/dev-config.lua ~/.config/nvim/lua/plugins/dev-claudecode.lua
return {
"coder/claudecode.nvim",
dev = true, -- Use local development version
-- `cmd` lets lazy.nvim create command stubs that load the plugin on first use,
-- so `:ClaudeCode` and friends work on a fresh start (a keys-only spec defers
-- loading until a <leader>a* mapping is pressed).
cmd = {
"ClaudeCode",
"ClaudeCodeFocus",
"ClaudeCodeSelectModel",
"ClaudeCodeAdd",
"ClaudeCodeSend",
"ClaudeCodeTreeAdd",
"ClaudeCodeStatus",
"ClaudeCodeStart",
"ClaudeCodeStop",
"ClaudeCodeOpen",
"ClaudeCodeClose",
"ClaudeCodeDiffAccept",
"ClaudeCodeDiffDeny",
"ClaudeCodeCloseAllDiffs",
},
keys = {
-- AI/Claude Code prefix
{ "<leader>a", nil, desc = "AI/Claude Code" },
-- Core Claude commands
{ "<leader>ac", "<cmd>ClaudeCode<cr>", desc = "Toggle Claude" },
{ "<leader>af", "<cmd>ClaudeCodeFocus<cr>", desc = "Focus Claude" },
{ "<leader>am", "<cmd>ClaudeCodeSelectModel<cr>", desc = "Select Claude model" },
-- Context sending
{ "<leader>ab", "<cmd>ClaudeCodeAdd %<cr>", mode = "n", desc = "Add current buffer" },
{ "<leader>as", "<cmd>ClaudeCodeSend<cr>", mode = "v", desc = "Send to Claude" },
{
"<leader>ab",
"<cmd>ClaudeCodeTreeAdd<cr>",
desc = "Add file from tree",
ft = { "NvimTree", "neo-tree", "oil", "minifiles", "netrw" },
},
-- Multi-session management
{ "<leader>an", "<cmd>ClaudeCodeSessionNew<cr>", desc = "New Claude session" },
{ "<leader>aN", "<cmd>ClaudeCodeSessionFor<cr>", desc = "New Claude session for profile" },
{ "<leader>a<Tab>", "<cmd>ClaudeCodeSessionSwitch<cr>", desc = "Switch Claude session" },
{ "<leader>ak", "<cmd>ClaudeCodeSessionKill<cr>", desc = "Kill active Claude session" },
-- Development helpers
{ "<leader>ao", "<cmd>ClaudeCodeOpen<cr>", desc = "Open Claude" },
{ "<leader>aq", "<cmd>ClaudeCodeClose<cr>", desc = "Close Claude" },
{ "<leader>ai", "<cmd>ClaudeCodeStatus<cr>", desc = "Claude Status" },
{ "<leader>aU", "<cmd>ClaudeCodeStats<cr>", desc = "Claude Usage Stats" },
{ "<leader>aS", "<cmd>ClaudeCodeStart<cr>", desc = "Start Claude Server" },
{ "<leader>aQ", "<cmd>ClaudeCodeStop<cr>", desc = "Stop Claude Server" },
-- Diff management (buffer-local, only active in diff buffers)
{ "<leader>aa", "<cmd>ClaudeCodeDiffAccept<cr>", desc = "Accept diff" },
{ "<leader>ad", "<cmd>ClaudeCodeDiffDeny<cr>", desc = "Deny diff" },
},
-- Development configuration - all options shown with defaults commented out
---@type PartialClaudeCodeConfig
opts = {
-- Server Configuration
-- port_range = { min = 10000, max = 65535 }, -- WebSocket server port range
-- auto_start = true, -- Auto-start server on Neovim startup
-- log_level = "info", -- "trace", "debug", "info", "warn", "error"
-- terminal_cmd = nil, -- Custom terminal command (default: "claude")
-- Send/Focus Behavior
focus_after_send = true, -- Focus Claude terminal after successful send while connected
-- Selection Tracking
-- track_selection = true, -- Enable real-time selection tracking
-- visual_demotion_delay_ms = 50, -- Delay before demoting visual selection (ms)
-- Connection Management
-- connection_wait_delay = 200, -- Wait time after connection before sending queued @ mentions (ms)
-- connection_timeout = 10000, -- Max time to wait for Claude Code connection (ms)
-- queue_timeout = 5000, -- Max time to keep @ mentions in queue (ms)
-- Diff Integration
-- diff_opts = {
-- layout = "horizontal", -- "vertical" or "horizontal" diff layout
-- open_in_new_tab = true, -- Open diff in a new tab (false = use current tab)
-- keep_terminal_focus = true, -- Keep focus in terminal after opening diff
-- hide_terminal_in_new_tab = true, -- Hide Claude terminal in the new diff tab for more review space
-- auto_resize_terminal = true, -- false = own terminal width via ClaudeCodeDiffOpened/Closed User autocmds
-- },
-- Terminal Configuration
-- terminal = {
-- split_side = "right", -- "left" or "right"
-- split_width_percentage = 0.30, -- Width as percentage (0.0 to 1.0)
-- diff_split_width_percentage = 0.20, -- Optional: terminal width while a diff is open (defaults to split_width_percentage)
-- provider = "auto", -- "auto", "snacks", or "native"
-- show_native_term_exit_tip = true, -- Show exit tip for native terminal
-- auto_close = true, -- Auto-close terminal after command completion
-- snacks_win_opts = {}, -- Opts to pass to `Snacks.terminal.open()`
-- group_by_profile = false, -- When true, session picker groups by profile instead of sorting by recency
-- },
-- Profile Configuration (multi-account / API key support)
-- profiles = {
-- work = {
-- claude_config_dir = "~/.claude-work",
-- account_email = "work@example.com", -- macOS: pins this profile to the exact Keychain entry
-- },
-- personal = {
-- claude_config_dir = "~/.claude",
-- account_email = "personal@gmail.com",
-- },
-- api_key = { env = { ANTHROPIC_API_KEY = "sk-ant-..." } }, -- API key profile (no usage bars in Status)
-- },
-- default_profile = "work", -- must be a key in profiles (nil = use system default ~/.claude)
-- Development overrides (uncomment as needed)
log_level = "debug",
-- terminal = {
-- provider = "native",
-- auto_close = false, -- Keep terminals open to see output
-- },
},
}