From 7634d4c27b2a710c02030e68fd31841122e0ac60 Mon Sep 17 00:00:00 2001 From: betterhwu Date: Sat, 14 Mar 2026 14:44:37 -0400 Subject: [PATCH] update config remove avante, codecompanion, update color scheme, update snack. add opencode --- lua/custom/plugins/avante.lua | 54 ---------------------------- lua/custom/plugins/codecompanion.lua | 54 ---------------------------- lua/custom/plugins/init.lua | 42 +++++++++++----------- lua/custom/plugins/lspconfig.lua | 2 ++ lua/custom/plugins/mason.lua | 2 +- lua/custom/plugins/opencode.lua | 32 +++++++++++++++++ lua/custom/plugins/snacks.lua | 5 +++ lua/myconfigs.lua | 2 +- 8 files changed, 62 insertions(+), 131 deletions(-) delete mode 100644 lua/custom/plugins/avante.lua delete mode 100644 lua/custom/plugins/codecompanion.lua create mode 100644 lua/custom/plugins/opencode.lua diff --git a/lua/custom/plugins/avante.lua b/lua/custom/plugins/avante.lua deleted file mode 100644 index 4ca94f93..00000000 --- a/lua/custom/plugins/avante.lua +++ /dev/null @@ -1,54 +0,0 @@ -return {} --- return { --- { --- 'yetone/avante.nvim', --- -- if you want to build from source then do `make BUILD_FROM_SOURCE=true` --- -- ⚠️ must add this setting! ! ! --- build = vim.fn.has 'win32' ~= 0 and 'powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false' or 'make', --- event = 'VeryLazy', --- version = false, -- Never set this value to "*"! Never! --- opts = { --- -- add any opts here --- -- this file can contain specific instructions for your project --- instructions_file = 'avante.md', --- selection = { --- enabled = false, --- }, --- selector = { --- provider = 'snacks', --- }, --- input = { --- provider = 'snacks', --- provider_opts = { --- title = 'Avante Input', --- icon = ' ', --- }, --- }, --- -- for example --- provider = 'claude', --- providers = { --- claude = { --- endpoint = 'https://api.anthropic.com', --- model = 'claude-sonnet-4-20250514', --- timeout = 30000, -- Timeout in milliseconds --- extra_request_body = { --- temperature = 0.75, --- max_tokens = 20480, --- }, --- }, --- }, --- }, --- dependencies = { --- 'nvim-lua/plenary.nvim', --- 'MunifTanjim/nui.nvim', --- 'folke/snacks.nvim', --- { --- 'MeanderingProgrammer/render-markdown.nvim', --- opts = { --- file_types = { 'markdown', 'Avante' }, --- }, --- ft = { 'markdown', 'Avante' }, --- }, --- }, --- }, --- } diff --git a/lua/custom/plugins/codecompanion.lua b/lua/custom/plugins/codecompanion.lua deleted file mode 100644 index 85def706..00000000 --- a/lua/custom/plugins/codecompanion.lua +++ /dev/null @@ -1,54 +0,0 @@ -return { - -- { - -- 'olimorris/codecompanion.nvim', - -- dependencies = { - -- 'nvim-lua/plenary.nvim', - -- 'nvim-treesitter/nvim-treesitter', - -- }, - -- opts = { - -- adapters = { - -- http = { - -- anthropic = function() - -- return require('codecompanion.adapters').extend('anthropic', { - -- env = { - -- api_key = os.getenv 'ANTHROPIC_API_KEY', - -- model = 'claude-sonnet-4-20250514', - -- }, - -- }) - -- end, - -- }, - -- }, - -- strategies = { - -- chat = { adapter = 'anthropic' }, - -- inline = { adapter = 'anthropic' }, - -- agent = { adapter = 'anthropic' }, - -- }, - -- display = { - -- action_palette = { - -- provider = 'snacks', - -- opts = { - -- show_default_actions = true, -- Show the default actions in the action palette? - -- show_default_prompt_library = true, -- Show the default prompt library in the action palette? - -- title = 'CodeCompanion actions', -- The title of the action palette - -- }, - -- }, - -- }, - -- -- NOTE: The log_level is in `opts.opts` - -- opts = { - -- log_level = 'DEBUG', -- or "TRACE" - -- }, - -- }, - -- }, - -- Codium: - -- { - -- 'Exafunction/windsurf.nvim', - -- dependencies = { - -- 'nvim-lua/plenary.nvim', - -- 'hrsh7th/nvim-cmp', - -- }, - -- config = function() - -- require('codeium').setup {} - -- vim.keymap.set('n', 'tc', ':Codeium Toggle', { desc = 'Toggle Codeium' }) - -- end, - -- }, -} diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index 494666e4..fff952b7 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -22,30 +22,30 @@ return { }, -- themes { 'catppuccin/nvim', name = 'catppuccin', priority = 1000 }, - { - 'navarasu/onedark.nvim', - priority = 1000, -- make sure to load this before all the other start plugins - config = function() - require('onedark').setup { - style = 'darker', - } - -- Enable theme - require('onedark').load() - end, - }, - { 'marko-cerovac/material.nvim', priority = 1000 }, -- { - -- 'nxstynate/oneDarkPro.nvim', - -- priority = 1000, - -- opts = { - -- palette_overrides = { - -- dark0 = '#282c34', - -- }, - -- }, - -- init = function() - -- vim.cmd.colorscheme 'oneDarkPro' + -- 'navarasu/onedark.nvim', + -- priority = 1000, -- make sure to load this before all the other start plugins + -- config = function() + -- require('onedark').setup { + -- style = 'darker', + -- } + -- -- Enable theme + -- require('onedark').load() -- end, -- }, + -- { 'marko-cerovac/material.nvim', priority = 1000 }, + { + 'olimorris/onedarkpro.nvim', + priority = 1000, + -- opts = { + -- palette_overrides = { + -- dark0 = '#282c34', + -- }, + -- }, + init = function() + vim.cmd.colorscheme 'onedark' + end, + }, { 'NvChad/nvim-colorizer.lua', opts = { user_default_options = { css = true, diff --git a/lua/custom/plugins/lspconfig.lua b/lua/custom/plugins/lspconfig.lua index eee5798a..009b72ac 100644 --- a/lua/custom/plugins/lspconfig.lua +++ b/lua/custom/plugins/lspconfig.lua @@ -14,6 +14,8 @@ return { jsonls = {}, yamlls = {}, lua_ls = {}, + pylsp = {}, + pyright = {}, }, }, config = function(_, opts) diff --git a/lua/custom/plugins/mason.lua b/lua/custom/plugins/mason.lua index fae5fa8f..76d7b812 100644 --- a/lua/custom/plugins/mason.lua +++ b/lua/custom/plugins/mason.lua @@ -35,7 +35,7 @@ return { 'svelte', 'lua_ls', 'graphql', - 'emmet_language_server', + -- 'emmet_language_server', 'prismals', }, } diff --git a/lua/custom/plugins/opencode.lua b/lua/custom/plugins/opencode.lua new file mode 100644 index 00000000..577b285b --- /dev/null +++ b/lua/custom/plugins/opencode.lua @@ -0,0 +1,32 @@ +return { + 'NickvanDyke/opencode.nvim', + dependencies = { 'folke/snacks.nvim' }, + config = function() + ---@type opencode.Opts + -- vim.g.opencode_opts = {} + + -- Required for `opts.events.reload`. + vim.o.autoread = true + + -- Keymaps with port injection + vim.keymap.set({ 'n', 'x' }, 'oq', function() + require('opencode').ask('@this: ', { submit = true }) + end, { desc = 'Ask opencode' }) + + vim.keymap.set({ 'n', 'x' }, 'os', function() + require('opencode').select() + end, { desc = 'Execute opencode action…' }) + + vim.keymap.set({ 'n', 'x' }, 'oa', function() + require('opencode').prompt '@this' + end, { desc = 'Add to opencode' }) + + vim.keymap.set({ 'n', 't' }, 'ot', function() + require('opencode').toggle() + end, { desc = 'Toggle opencode' }) + + vim.keymap.set('n', 'oT', function() + require('opencode').command 'session.half.page.down' + end, { desc = 'opencode half page down' }) + end, +} diff --git a/lua/custom/plugins/snacks.lua b/lua/custom/plugins/snacks.lua index b46ff0a3..d4784954 100644 --- a/lua/custom/plugins/snacks.lua +++ b/lua/custom/plugins/snacks.lua @@ -24,6 +24,11 @@ return { }, }, }, + layout = { + layout = { + width = 28, + }, + }, }, }, }, diff --git a/lua/myconfigs.lua b/lua/myconfigs.lua index 67e38730..76942c6f 100644 --- a/lua/myconfigs.lua +++ b/lua/myconfigs.lua @@ -46,7 +46,7 @@ vim.keymap.set('n', 'ca', vim.lsp.buf.code_action, { noremap = true, des vim.api.nvim_set_keymap('n', 'yr', ":let @+=expand('%:.%:t')", { noremap = true, silent = true, desc = 'Copy Relative Path' }) vim.api.nvim_set_keymap('n', 'ya', ":let @+=expand('%:P%:t')", { noremap = true, silent = true, desc = 'Copy Absolute Path' }) -vim.g.diagnostics_active = true +vim.g.diagnostics_active = false function _G.toggle_diagnostics() if vim.g.diagnostics_active then vim.g.diagnostics_active = false