diff --git a/lsp/lua_ls.lua b/lsp/lua_ls.lua index 159465c..55b8021 100644 --- a/lsp/lua_ls.lua +++ b/lsp/lua_ls.lua @@ -24,6 +24,17 @@ return { ['missing-fields'] = 'Hint', }, }, + + -- Load types from Neovim runtime and installed plugins + workspace = { + library = { + vim.env.VIMRUNTIME, + "${3rd}/luv/library", + -- Add lazy.nvim plugin directories + vim.fn.stdpath('data') .. '/lazy', + }, + checkThirdParty = false, + }, }, }, } diff --git a/lua/plugins/claudecode.lua b/lua/plugins/claudecode.lua new file mode 100644 index 0000000..88d22da --- /dev/null +++ b/lua/plugins/claudecode.lua @@ -0,0 +1,33 @@ +--- @type LazySpec | LazySpec[] +return { + 'coder/claudecode.nvim', + dependencies = { 'folke/snacks.nvim' }, + lazy = false, + --- @type PartialClaudeCodeConfig + opts = { + -- Server Configuration + auto_start = true, + log_level = 'info', -- "trace", "debug", "info", "warn", "error" + + -- Send/Focus Behavior + -- When true, successful sends will focus the Claude terminal if already connected + focus_after_send = false, + + -- Selection Tracking + track_selection = true, + visual_demotion_delay_ms = 50, + + -- Diff Integration + ---@class ClaudeDiffOpts : ClaudeCodeDiffOptions + diff_opts = { + auto_close_on_accept = true, + vertical_split = true, + open_in_current_tab = true, + keep_terminal_focus = false, -- If true, moves focus back to terminal after diff opens (including floating terminals) + }, + }, + keys = { + -- Your keymaps here + { 'cs', 'ClaudeCodeSend', mode = 'v', desc = 'Send to [C]laude' }, + }, +} diff --git a/lua/plugins/nvim-cmp.lua b/lua/plugins/nvim-cmp.lua index 74a3f4d..cafeab5 100644 --- a/lua/plugins/nvim-cmp.lua +++ b/lua/plugins/nvim-cmp.lua @@ -1,7 +1,8 @@ --- @type LazySpec | LazySpec[] return { -- Autocompletion 'hrsh7th/nvim-cmp', - event = 'InsertEnter', + -- Lazy load or InsertEnter + event = { 'InsertEnter', 'VeryLazy' }, dependencies = { -- Snippet Engine & its associated nvim-cmp source {