updates
This commit is contained in:
@@ -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", "<leader>ca", "<cmd>CodeCompanionActions<cr>", { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("v", "<leader>ca", "<cmd>CodeCompanionActions<cr>", { noremap = true, silent = true })
|
||||
|
||||
|
||||
-- Additional keymaps for Opus
|
||||
vim.api.nvim_set_keymap(
|
||||
"n",
|
||||
"<leader>co",
|
||||
"<cmd>CodeCompanionChat anthropic_opus Toggle<cr>",
|
||||
{ noremap = true, silent = true, desc = "Chat with Claude Opus" }
|
||||
)
|
||||
vim.api.nvim_set_keymap(
|
||||
"v",
|
||||
"<leader>co",
|
||||
"<cmd>CodeCompanionChat anthropic_opus Toggle<cr>",
|
||||
{ noremap = true, silent = true, desc = "Chat with Claude Opus" }
|
||||
)
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ return {
|
||||
window = {
|
||||
mappings = {
|
||||
["\\"] = "close_window",
|
||||
["/"] = "fuzzy_finder",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -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",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user