nvim: add some rust stuff and codecompanion

This commit is contained in:
Mark Riedesel 2024-09-07 12:24:20 -05:00
parent 4cec54dcf9
commit 42d31a8de1
11 changed files with 81 additions and 11 deletions

View file

@ -0,0 +1,9 @@
-- local bufnr = vim.api.nvim_get_current_buf()
-- vim.keymap.set(
-- 'n',
-- '<leader>a',
-- function()
-- vim.cmd.RustLsp('codeAction')
-- end,
-- {silent= true, buffer = bufnr}
-- )

View file

@ -84,3 +84,9 @@ end
-- :W to save with sudo
-- vim.api.nvim_create_user_command('')
-- vim.api.nvim_create_autocmd({"CursorHold", "CursorHoldI"}, {
-- group = vim.api.nvim_create_augroup("float_diagnostic_cursor", { clear = false }),
-- callback = function ()
-- vim.diagnostic.open_float(nil, {focus=false, scope="cursor"})
-- end
-- })

View file

@ -0,0 +1,36 @@
return {
"olimorris/codecompanion.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
"hrsh7th/nvim-cmp", -- Optional: For activating slash commands and variables in the chat buffer
"nvim-telescope/telescope.nvim", -- Optional: For working with files with slash commands
{
"stevearc/dressing.nvim", -- Optional: Improves the default Neovim UI
opts = {},
},
},
config = function ()
require('codecompanion').setup({
strategies = {
chat = { adapter = 'ollama' },
inline = { adapter = 'ollama' },
agent = { adapter = 'ollama' },
},
adapters = {
ollama = function ()
return require('codecompanion.adapters').extend('ollama', {
schema = {
model = {
default = 'yi-coder:1.5b',
},
},
env = {
url = "https://localhost:11434",
},
})
end,
},
})
end,
}

View file

@ -0,0 +1,3 @@
return {
"mfussenegger/nvim-dap",
}

View file

@ -6,6 +6,7 @@ return {
"hrsh7th/cmp-nvim-lsp-signature-help",
{ "antosha417/nvim-lsp-file-operations", config = true },
{ "folke/neodev.nvim", opts = {} },
'j-hui/fidget.nvim',
},
config = function()
-- import lspconfig plugin

View file

@ -39,6 +39,7 @@ return {
"svelte",
"tailwindcss",
"tsserver",
"rust_analyzer",
},
})

View file

@ -0,0 +1,3 @@
return {
"rust-lang/rust.vim",
}

View file

@ -2,10 +2,12 @@ return {
"nvim-telescope/telescope.nvim",
branch = "0.1.x",
dependencies = {
"nvim-lua/popup.nvim",
"nvim-lua/plenary.nvim",
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
"nvim-tree/nvim-web-devicons",
"folke/todo-comments.nvim",
"nvim-telescope/telescope-media-files.nvim",
},
config = function()
local telescope = require("telescope")
@ -37,6 +39,7 @@ return {
})
telescope.load_extension("fzf")
telescope.load_extension("media_files")
-- set keymaps
local keymap = vim.keymap -- for conciseness

View file

@ -25,21 +25,22 @@ return {
-- ensure these language parsers are installed
ensure_installed = {
"json",
"javascript",
"typescript",
"tsx",
"yaml",
"html",
"bash",
"css",
"prisma",
"dockerfile",
"graphql",
"html",
"javascript",
"lua",
"markdown",
"markdown_inline",
"prisma",
"rust",
"svelte",
"graphql",
"bash",
"lua",
"tsx",
"typescript",
"vim",
"dockerfile",
"yaml",
"gitignore",
"query",
"vimdoc",

View file

@ -2,11 +2,15 @@ return {
"folke/trouble.nvim",
dependencies = { "nvim-tree/nvim-web-devicons", "folke/todo-comments.nvim" },
keys = {
{ "<leader>xx", "<cmd>TroubleToggle<CR>", desc = "Open/close trouble list" },
{ "<leader>xx", "<cmd>Trouble diagnostics toggle<CR>", desc = "Open/close trouble list" },
{ "<leader>xw", "<cmd>TroubleToggle workspace_diagnostics<CR>", desc = "Open trouble workspace diagnostics" },
{ "<leader>xd", "<cmd>TroubleToggle document_diagnostics<CR>", desc = "Open trouble document diagnostics" },
{ "<leader>xq", "<cmd>TroubleToggle quickfix<CR>", desc = "Open trouble quickfix list" },
{ "<leader>xl", "<cmd>TroubleToggle loclist<CR>", desc = "Open trouble location list" },
{ "<leader>xt", "<cmd>TodoTrouble<CR>", desc = "Open todos in trouble" },
},
config = function ()
local trouble = require 'trouble'
trouble.setup({})
end,
}

View file

@ -0,0 +1,3 @@
return {
'puremourning/vimspector',
}