From 80880cb39dffeea39423c3986d905cae9ae06490 Mon Sep 17 00:00:00 2001 From: chaptersix Date: Sat, 22 Mar 2025 18:51:50 -0500 Subject: [PATCH] update some plugins --- init.lua | 24 ++++++++++++++++++------ lua/custom/plugins/avante.lua | 15 +++++++++++++-- lua/custom/plugins/venv.lua | 18 ++++++++++++++++++ lua/kickstart/plugins/neo-tree.lua | 25 +++++++++++++++++++++++++ 4 files changed, 74 insertions(+), 8 deletions(-) create mode 100644 lua/custom/plugins/venv.lua diff --git a/init.lua b/init.lua index 65b69bf6..7e8c2881 100644 --- a/init.lua +++ b/init.lua @@ -664,6 +664,18 @@ require('lazy').setup({ -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ local servers = { -- clangd = {}, + -- clangd = {}, + pyright = { + settings = { + python = { + analysis = { + autoSearchPaths = true, + useLibraryCodeForTypes = true, + diagnosticMode = 'workspace', + }, + }, + }, + }, gopls = { settings = { @@ -801,12 +813,12 @@ require('lazy').setup({ -- `friendly-snippets` contains a variety of premade snippets. -- See the README about individual language/framework/plugin snippets: -- https://github.com/rafamadriz/friendly-snippets - -- { - -- 'rafamadriz/friendly-snippets', - -- config = function() - -- require('luasnip.loaders.from_vscode').lazy_load() - -- end, - -- }, + { + 'rafamadriz/friendly-snippets', + config = function() + require('luasnip.loaders.from_vscode').lazy_load() + end, + }, }, }, 'saadparwaiz1/cmp_luasnip', diff --git a/lua/custom/plugins/avante.lua b/lua/custom/plugins/avante.lua index c06cdc00..3523dad5 100644 --- a/lua/custom/plugins/avante.lua +++ b/lua/custom/plugins/avante.lua @@ -9,12 +9,23 @@ return { provider = 'openai', openai = { endpoint = 'https://api.openai.com/v1', - model = 'gpt-4o', -- your desired model (or use gpt-4o, etc.) + model = 'o3-mini', -- your desired model (or use gpt-4o, etc.) timeout = 30000, -- timeout in milliseconds temperature = 0, -- adjust if needed - max_tokens = 4096, + max_tokens = claude, -- reasoning_effort = "high" -- only supported for reasoning models (o1, etc.) }, + claude = { + endpoint = 'https://api.anthropic.com', + model = 'claude-3-5-sonnet-20241022', + timeout = 30000, -- Timeout in milliseconds + temperature = 0, + --max_tokens = 20000, + disable_tools = true, -- disable tools! + }, + behaviour = { + enable_claude_text_editor_tool_mode = true, + }, }, -- if you want to build from source then do `make BUILD_FROM_SOURCE=true` build = 'make', diff --git a/lua/custom/plugins/venv.lua b/lua/custom/plugins/venv.lua new file mode 100644 index 00000000..e5daf025 --- /dev/null +++ b/lua/custom/plugins/venv.lua @@ -0,0 +1,18 @@ +return { -- Virtual Environment Selector + { + 'linux-cultist/venv-selector.nvim', + dependencies = { 'neovim/nvim-lspconfig', 'nvim-telescope/telescope.nvim', 'mfussenegger/nvim-dap-python' }, + opts = { + name = { + 'venv', + '.venv', + 'env', + '.env', + }, + }, + keys = { + -- Keymap to open venv selector + { 'vs', 'VenvSelect', desc = 'Select VirtualEnv' }, + }, + }, +} diff --git a/lua/kickstart/plugins/neo-tree.lua b/lua/kickstart/plugins/neo-tree.lua index c4297cbe..ff5c30d1 100644 --- a/lua/kickstart/plugins/neo-tree.lua +++ b/lua/kickstart/plugins/neo-tree.lua @@ -9,16 +9,41 @@ return { 'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended 'MunifTanjim/nui.nvim', }, + lazy = false, -- neo-tree will lazily load itself cmd = 'Neotree', keys = { { '\\', ':Neotree reveal', desc = 'NeoTree reveal', silent = true }, }, opts = { filesystem = { + commands = { + avante_add_files = function(state) + local node = state.tree:get_node() + local filepath = node:get_id() + local relative_path = require('avante.utils').relative_path(filepath) + + local sidebar = require('avante').get() + + local open = sidebar:is_open() + -- ensure avante sidebar is open + if not open then + require('avante.api').ask() + sidebar = require('avante').get() + end + + sidebar.file_selector:add_selected_file(relative_path) + + -- remove neo tree buffer + if not open then + sidebar.file_selector:remove_selected_file 'neo-tree filesystem [1]' + end + end, + }, hijack_netrw_behavior = 'open_default', window = { mappings = { ['\\'] = 'close_window', + ['oa'] = 'avante_add_files', }, }, },