nvim: add some rust stuff and codecompanion
This commit is contained in:
parent
4cec54dcf9
commit
42d31a8de1
11 changed files with 81 additions and 11 deletions
9
.config/nvim/after/ftplugin/rust.lua
Normal file
9
.config/nvim/after/ftplugin/rust.lua
Normal 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}
|
||||||
|
-- )
|
|
@ -84,3 +84,9 @@ end
|
||||||
|
|
||||||
-- :W to save with sudo
|
-- :W to save with sudo
|
||||||
-- vim.api.nvim_create_user_command('')
|
-- 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
|
||||||
|
-- })
|
||||||
|
|
36
.config/nvim/lua/klowner/plugins/codecompanion.lua
Normal file
36
.config/nvim/lua/klowner/plugins/codecompanion.lua
Normal 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,
|
||||||
|
}
|
3
.config/nvim/lua/klowner/plugins/dap.lua
Normal file
3
.config/nvim/lua/klowner/plugins/dap.lua
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
return {
|
||||||
|
"mfussenegger/nvim-dap",
|
||||||
|
}
|
|
@ -6,6 +6,7 @@ return {
|
||||||
"hrsh7th/cmp-nvim-lsp-signature-help",
|
"hrsh7th/cmp-nvim-lsp-signature-help",
|
||||||
{ "antosha417/nvim-lsp-file-operations", config = true },
|
{ "antosha417/nvim-lsp-file-operations", config = true },
|
||||||
{ "folke/neodev.nvim", opts = {} },
|
{ "folke/neodev.nvim", opts = {} },
|
||||||
|
'j-hui/fidget.nvim',
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
-- import lspconfig plugin
|
-- import lspconfig plugin
|
||||||
|
|
|
@ -39,6 +39,7 @@ return {
|
||||||
"svelte",
|
"svelte",
|
||||||
"tailwindcss",
|
"tailwindcss",
|
||||||
"tsserver",
|
"tsserver",
|
||||||
|
"rust_analyzer",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
3
.config/nvim/lua/klowner/plugins/rust.lua
Normal file
3
.config/nvim/lua/klowner/plugins/rust.lua
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
return {
|
||||||
|
"rust-lang/rust.vim",
|
||||||
|
}
|
|
@ -2,10 +2,12 @@ return {
|
||||||
"nvim-telescope/telescope.nvim",
|
"nvim-telescope/telescope.nvim",
|
||||||
branch = "0.1.x",
|
branch = "0.1.x",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
|
"nvim-lua/popup.nvim",
|
||||||
"nvim-lua/plenary.nvim",
|
"nvim-lua/plenary.nvim",
|
||||||
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
|
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
|
||||||
"nvim-tree/nvim-web-devicons",
|
"nvim-tree/nvim-web-devicons",
|
||||||
"folke/todo-comments.nvim",
|
"folke/todo-comments.nvim",
|
||||||
|
"nvim-telescope/telescope-media-files.nvim",
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
local telescope = require("telescope")
|
local telescope = require("telescope")
|
||||||
|
@ -37,6 +39,7 @@ return {
|
||||||
})
|
})
|
||||||
|
|
||||||
telescope.load_extension("fzf")
|
telescope.load_extension("fzf")
|
||||||
|
telescope.load_extension("media_files")
|
||||||
|
|
||||||
-- set keymaps
|
-- set keymaps
|
||||||
local keymap = vim.keymap -- for conciseness
|
local keymap = vim.keymap -- for conciseness
|
||||||
|
|
|
@ -25,21 +25,22 @@ return {
|
||||||
-- ensure these language parsers are installed
|
-- ensure these language parsers are installed
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"json",
|
"json",
|
||||||
"javascript",
|
"bash",
|
||||||
"typescript",
|
|
||||||
"tsx",
|
|
||||||
"yaml",
|
|
||||||
"html",
|
|
||||||
"css",
|
"css",
|
||||||
"prisma",
|
"dockerfile",
|
||||||
|
"graphql",
|
||||||
|
"html",
|
||||||
|
"javascript",
|
||||||
|
"lua",
|
||||||
"markdown",
|
"markdown",
|
||||||
"markdown_inline",
|
"markdown_inline",
|
||||||
|
"prisma",
|
||||||
|
"rust",
|
||||||
"svelte",
|
"svelte",
|
||||||
"graphql",
|
"tsx",
|
||||||
"bash",
|
"typescript",
|
||||||
"lua",
|
|
||||||
"vim",
|
"vim",
|
||||||
"dockerfile",
|
"yaml",
|
||||||
"gitignore",
|
"gitignore",
|
||||||
"query",
|
"query",
|
||||||
"vimdoc",
|
"vimdoc",
|
||||||
|
|
|
@ -2,11 +2,15 @@ return {
|
||||||
"folke/trouble.nvim",
|
"folke/trouble.nvim",
|
||||||
dependencies = { "nvim-tree/nvim-web-devicons", "folke/todo-comments.nvim" },
|
dependencies = { "nvim-tree/nvim-web-devicons", "folke/todo-comments.nvim" },
|
||||||
keys = {
|
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>xw", "<cmd>TroubleToggle workspace_diagnostics<CR>", desc = "Open trouble workspace diagnostics" },
|
||||||
{ "<leader>xd", "<cmd>TroubleToggle document_diagnostics<CR>", desc = "Open trouble document 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>xq", "<cmd>TroubleToggle quickfix<CR>", desc = "Open trouble quickfix list" },
|
||||||
{ "<leader>xl", "<cmd>TroubleToggle loclist<CR>", desc = "Open trouble location list" },
|
{ "<leader>xl", "<cmd>TroubleToggle loclist<CR>", desc = "Open trouble location list" },
|
||||||
{ "<leader>xt", "<cmd>TodoTrouble<CR>", desc = "Open todos in trouble" },
|
{ "<leader>xt", "<cmd>TodoTrouble<CR>", desc = "Open todos in trouble" },
|
||||||
},
|
},
|
||||||
|
config = function ()
|
||||||
|
local trouble = require 'trouble'
|
||||||
|
trouble.setup({})
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
|
|
3
.config/nvim/lua/klowner/plugins/vimspector.lua
Normal file
3
.config/nvim/lua/klowner/plugins/vimspector.lua
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
return {
|
||||||
|
'puremourning/vimspector',
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue