@@ -36,12 +36,22 @@ local M = {}
3636-- @field window_navigation boolean Enable window navigation keymaps
3737-- @field scrolling boolean Enable scrolling keymaps
3838
39+ --- ClaudeCodeCommandVariants class for command variant configuration
40+ -- @table ClaudeCodeCommandVariants
41+ -- Conversation management:
42+ -- @field continue string|boolean Resume the most recent conversation
43+ -- @field resume string|boolean Display an interactive conversation picker
44+ -- Output options:
45+ -- @field verbose string|boolean Enable verbose logging with full turn-by-turn output
46+ -- Additional options can be added as needed
47+
3948--- ClaudeCodeConfig class for main configuration
4049-- @table ClaudeCodeConfig
4150-- @field window ClaudeCodeWindow Terminal window settings
4251-- @field refresh ClaudeCodeRefresh File refresh settings
4352-- @field git ClaudeCodeGit Git integration settings
4453-- @field command string Command used to launch Claude Code
54+ -- @field command_variants ClaudeCodeCommandVariants Command variants configuration
4555-- @field keymaps ClaudeCodeKeymaps Keymaps configuration
4656
4757--- Default configuration options
@@ -69,11 +79,24 @@ M.default_config = {
6979 },
7080 -- Command settings
7181 command = ' claude' , -- Command used to launch Claude Code
82+ -- Command variants
83+ command_variants = {
84+ -- Conversation management
85+ continue = ' --continue' , -- Resume the most recent conversation
86+ resume = ' --resume' , -- Display an interactive conversation picker
87+
88+ -- Output options
89+ verbose = ' --verbose' , -- Enable verbose logging with full turn-by-turn output
90+ },
7291 -- Keymaps
7392 keymaps = {
7493 toggle = {
7594 normal = ' <C-,>' , -- Normal mode keymap for toggling Claude Code
7695 terminal = ' <C-,>' , -- Terminal mode keymap for toggling Claude Code
96+ variants = {
97+ continue = ' <leader>cC' , -- Normal mode keymap for Claude Code with continue flag
98+ verbose = ' <leader>cV' , -- Normal mode keymap for Claude Code with verbose flag
99+ },
77100 },
78101 window_navigation = true , -- Enable window navigation keymaps (<C-h/j/k/l>)
79102 scrolling = true , -- Enable scrolling keymaps (<C-f/b>) for page up/down
@@ -149,6 +172,18 @@ local function validate_config(config)
149172 return false , ' command must be a string'
150173 end
151174
175+ -- Validate command variants settings
176+ if type (config .command_variants ) ~= ' table' then
177+ return false , ' command_variants config must be a table'
178+ end
179+
180+ -- Check each command variant
181+ for variant_name , variant_args in pairs (config .command_variants ) do
182+ if not (variant_args == false or type (variant_args ) == ' string' ) then
183+ return false , ' command_variants.' .. variant_name .. ' must be a string or false'
184+ end
185+ end
186+
152187 -- Validate keymaps settings
153188 if type (config .keymaps ) ~= ' table' then
154189 return false , ' keymaps config must be a table'
@@ -172,6 +207,25 @@ local function validate_config(config)
172207 return false , ' keymaps.toggle.terminal must be a string or false'
173208 end
174209
210+ -- Validate variant keymaps if they exist
211+ if config .keymaps .toggle .variants then
212+ if type (config .keymaps .toggle .variants ) ~= ' table' then
213+ return false , ' keymaps.toggle.variants must be a table'
214+ end
215+
216+ -- Check each variant keymap
217+ for variant_name , keymap in pairs (config .keymaps .toggle .variants ) do
218+ if not (keymap == false or type (keymap ) == ' string' ) then
219+ return false , ' keymaps.toggle.variants.' .. variant_name .. ' must be a string or false'
220+ end
221+ -- Ensure variant exists in command_variants
222+ if keymap ~= false and not config .command_variants [variant_name ] then
223+ return false ,
224+ ' keymaps.toggle.variants.' .. variant_name .. ' has no corresponding command variant'
225+ end
226+ end
227+ end
228+
175229 if type (config .keymaps .window_navigation ) ~= ' boolean' then
176230 return false , ' keymaps.window_navigation must be a boolean'
177231 end
0 commit comments