From b17afad3453e4a067d1cfb114553baef28ac095d Mon Sep 17 00:00:00 2001 From: Steven Crawford Date: Mon, 22 Dec 2025 13:54:17 -0600 Subject: [PATCH] updates --- lua/shelbybark/plugins/codecompanion.lua | 26 ++++++- lua/shelbybark/plugins/neo-tree.lua | 1 + lua/shelbybark/plugins/treesitter.lua | 96 +++++------------------- 3 files changed, 44 insertions(+), 79 deletions(-) diff --git a/lua/shelbybark/plugins/codecompanion.lua b/lua/shelbybark/plugins/codecompanion.lua index b16c15c..0954c7f 100644 --- a/lua/shelbybark/plugins/codecompanion.lua +++ b/lua/shelbybark/plugins/codecompanion.lua @@ -36,6 +36,18 @@ return { }, }) end, + anthropic_opus = function() + return require("codecompanion.adapters").extend("anthropic", { + env = { + api_key = "ANTHROPIC_API_KEY", + }, + schema = { + model = { + default = "claude-opus-4-5-20251101", + }, + }, + }) + end, }, }, -- Display settings for the chat window @@ -71,6 +83,18 @@ return { vim.api.nvim_set_keymap("n", "ca", "CodeCompanionActions", { noremap = true, silent = true }) vim.api.nvim_set_keymap("v", "ca", "CodeCompanionActions", { noremap = true, silent = true }) - + -- Additional keymaps for Opus + vim.api.nvim_set_keymap( + "n", + "co", + "CodeCompanionChat anthropic_opus Toggle", + { noremap = true, silent = true, desc = "Chat with Claude Opus" } + ) + vim.api.nvim_set_keymap( + "v", + "co", + "CodeCompanionChat anthropic_opus Toggle", + { noremap = true, silent = true, desc = "Chat with Claude Opus" } + ) end, } diff --git a/lua/shelbybark/plugins/neo-tree.lua b/lua/shelbybark/plugins/neo-tree.lua index afe5c1b..a103020 100644 --- a/lua/shelbybark/plugins/neo-tree.lua +++ b/lua/shelbybark/plugins/neo-tree.lua @@ -30,6 +30,7 @@ return { window = { mappings = { ["\\"] = "close_window", + ["/"] = "fuzzy_finder", }, }, }, diff --git a/lua/shelbybark/plugins/treesitter.lua b/lua/shelbybark/plugins/treesitter.lua index 1319cf0..7b3380a 100644 --- a/lua/shelbybark/plugins/treesitter.lua +++ b/lua/shelbybark/plugins/treesitter.lua @@ -1,54 +1,18 @@ --- modified version of code from this config ---https://github.com/fredrikaverpil/dotfiles/blob/main/nvim-fredrik/lua/fredrik/plugins/core/treesitter.lua +-- Treesitter configuration for syntax highlighting and text objects return { { "nvim-treesitter/nvim-treesitter", lazy = false, priority = 1000, build = ":TSUpdate", - dependencies = { - "nvim-treesitter/nvim-treesitter-textobjects", - }, config = function() - local ok, treesitter = pcall(require, "nvim-treesitter.configs") - if not ok then - vim.notify("nvim-treesitter.configs not available", vim.log.levels.WARN) - return - end - - treesitter.setup({ + require("nvim-treesitter.configs").setup({ ensure_installed = { - "astro", - "bash", - "c", - "css", - "diff", - "go", - "gomod", - "gowork", - "gosum", - "graphql", - "html", - "javascript", - "jsdoc", - "json", - "jsonc", - "json5", - "lua", - "luadoc", - "luap", - "markdown", - "markdown_inline", - "python", - "query", - "regex", - "toml", - "tsx", - "typescript", - "vim", - "vimdoc", - "yaml", - "ruby", + "astro", "bash", "c", "css", "diff", "go", "gomod", "gowork", "gosum", + "graphql", "html", "javascript", "jsdoc", "json", "jsonc", "json5", + "lua", "luadoc", "luap", "markdown", "markdown_inline", "python", + "query", "regex", "toml", "tsx", "typescript", "vim", "vimdoc", + "yaml", "ruby", }, sync_install = false, auto_install = true, @@ -56,9 +20,7 @@ return { enable = true, additional_vim_regex_highlighting = false, }, - indent = { - enable = true, - }, + indent = { enable = true }, incremental_selection = { enable = true, keymaps = { @@ -83,38 +45,16 @@ return { "nvim-treesitter/nvim-treesitter-textobjects", event = "BufReadPre", dependencies = { "nvim-treesitter/nvim-treesitter" }, - keys = { - { - "af", - function() - require("nvim-treesitter-textobjects.select").select_textobject("@function.outer", "textobjects") - end, - desc = "Select outer function", - mode = { "x", "o" }, - }, - { - "if", - function() - require("nvim-treesitter-textobjects.select").select_textobject("@function.inner", "textobjects") - end, - desc = "Select inner function", - mode = { "x", "o" }, - }, - { - "ac", - function() - require("nvim-treesitter-textobjects.select").select_textobject("@class.outer", "textobjects") - end, - desc = "Select outer class", - mode = { "x", "o" }, - }, - { - "ic", - function() - require("nvim-treesitter-textobjects.select").select_textobject("@class.inner", "textobjects") - end, - desc = "Select inner class", - mode = { "x", "o" }, + opts = { + select = { + enable = true, + lookahead = true, + keymaps = { + ["af"] = "@function.outer", + ["if"] = "@function.inner", + ["ac"] = "@class.outer", + ["ic"] = "@class.inner", + }, }, }, },