Compare commits

...

12 Commits

Author SHA1 Message Date
kyasuda
f4f8b345dd Merge branch 'master' of gitea.suda.codes:sudacode/nvim 2025-07-30 16:12:48 -07:00
kyasuda
1aea2cfc68 fix bug in keymap converter for whichkey 2025-07-30 16:12:35 -07:00
9fa8ac630c update 2025-05-03 22:22:30 -07:00
3d6e9d215e update 2025-05-02 21:52:12 -07:00
97e81424fa update 2025-05-02 21:51:10 -07:00
kyasuda
ab352ba2a9 update lsp diagnostics to use internal functions 2025-05-02 10:14:59 -07:00
a8f250f96b update plugins 2025-05-01 21:18:16 -07:00
95089a5a57 update 2025-04-30 18:34:59 -07:00
9a7981eaba add mcphub 2025-04-13 20:27:07 -07:00
78b8e47080 fix lspconfig 2025-04-13 03:57:11 -07:00
dfab17ce27 update 2025-04-13 00:30:44 -07:00
8a151a6430 update lsp config to use vim.lsp 2025-04-13 00:30:16 -07:00
13 changed files with 243 additions and 100 deletions

View File

@@ -2,54 +2,54 @@
"LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" }, "LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" },
"any-jump.vim": { "branch": "master", "commit": "f95674d9a4251ac02f452d5f1861e4422f4652c7" }, "any-jump.vim": { "branch": "master", "commit": "f95674d9a4251ac02f452d5f1861e4422f4652c7" },
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
"catppuccin": { "branch": "main", "commit": "5b5e3aef9ad7af84f463d17b5479f06b87d5c429" }, "catppuccin": { "branch": "main", "commit": "b7bbdf93b42866f166af98d39a2563eedb7cabac" },
"cmp-async-path": { "branch": "main", "commit": "d6d1ffa2075039632a2d71e8fa139818e15ac757" }, "cmp-async-path": { "branch": "main", "commit": "0ed1492f59e730c366d261a5ad822fa37e44c325" },
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
"cmp-nvim-lsp-document-symbol": { "branch": "main", "commit": "f94f7ba948e32cd302caba1c2ca3f7c697fb4fcf" }, "cmp-nvim-lsp-document-symbol": { "branch": "main", "commit": "f94f7ba948e32cd302caba1c2ca3f7c697fb4fcf" },
"cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "031e6ba70b0ad5eee49fd2120ff7a2e325b17fa7" }, "cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "031e6ba70b0ad5eee49fd2120ff7a2e325b17fa7" },
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
"codecompanion.nvim": { "branch": "main", "commit": "35b11dc4b292519a5c09fb2c0c0e8a8832e9e821" }, "codecompanion.nvim": { "branch": "main", "commit": "e55bbf5f6969ab41414d3fd68011366d3b80d024" },
"conform.nvim": { "branch": "master", "commit": "eebc724d12c5579d733d1f801386e0ceb909d001" }, "conform.nvim": { "branch": "master", "commit": "372fc521f8421b7830ea6db4d6ea3bae1c77548c" },
"copilot-cmp": { "branch": "master", "commit": "15fc12af3d0109fa76b60b5cffa1373697e261d1" }, "copilot-cmp": { "branch": "master", "commit": "15fc12af3d0109fa76b60b5cffa1373697e261d1" },
"copilot-lualine": { "branch": "main", "commit": "6bc29ba1fcf8f0f9ba1f0eacec2f178d9be49333" }, "copilot-lualine": { "branch": "main", "commit": "6bc29ba1fcf8f0f9ba1f0eacec2f178d9be49333" },
"copilot.lua": { "branch": "master", "commit": "2378a40e9cecbf3720b6f4f3d5d6b6d8994bd321" }, "copilot.lua": { "branch": "master", "commit": "a5c390f8d8e85b501b22dcb2f30e0cbbd69d5ff0" },
"dashboard-nvim": { "branch": "master", "commit": "000448d837f6e7a47f8f342f29526c4d7e49e9ce" }, "dashboard-nvim": { "branch": "master", "commit": "591b5b29e2f17b97496ec3179f6ecd08bb8502cc" },
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
"fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" },
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
"gitsigns.nvim": { "branch": "main", "commit": "17ab794b6fce6fce768430ebc925347e349e1d60" }, "gitsigns.nvim": { "branch": "main", "commit": "1796c7cedfe7e5dd20096c5d7b8b753d8f8d22eb" },
"goto-preview": { "branch": "main", "commit": "d1faf6ea992b5bcaaaf2c682e1aba3131a01143e" }, "goto-preview": { "branch": "main", "commit": "d1faf6ea992b5bcaaaf2c682e1aba3131a01143e" },
"image.nvim": { "branch": "master", "commit": "2e2d28b7734b5efdfc1219f4da8a46c761587bc2" }, "image.nvim": { "branch": "master", "commit": "4c51d6202628b3b51e368152c053c3fb5c5f76f2" },
"indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" }, "indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" },
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
"lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" },
"lsp_lines.nvim": { "branch": "main", "commit": "a92c755f182b89ea91bd8a6a2227208026f27b4d" },
"lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" }, "lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" },
"lualine.nvim": { "branch": "master", "commit": "0ea56f91b7f51a37b749c050a5e5dfdd56b302b3" }, "lualine.nvim": { "branch": "master", "commit": "15884cee63a8c205334ab13ab1c891cd4d27101a" },
"mcphub.nvim": { "branch": "main", "commit": "81394b54e292a50361aba11198e5fa4ebb97d304" },
"mini.diff": { "branch": "main", "commit": "7e268d0241255abaa07b8aa0ddff028f7315fe21" }, "mini.diff": { "branch": "main", "commit": "7e268d0241255abaa07b8aa0ddff028f7315fe21" },
"mini.nvim": { "branch": "main", "commit": "82c895e58d893bbbde8300277d6ceee813b15f63" }, "mini.nvim": { "branch": "main", "commit": "90ab64f944a5a63a9efebe6735e1f2c6d4db3613" },
"noice.nvim": { "branch": "main", "commit": "0427460c2d7f673ad60eb02b35f5e9926cf67c59" }, "noice.nvim": { "branch": "main", "commit": "0427460c2d7f673ad60eb02b35f5e9926cf67c59" },
"none-ls.nvim": { "branch": "main", "commit": "8d99472fcccffd73d7501e54e9018bab5cb0c4ad" }, "none-ls.nvim": { "branch": "main", "commit": "a49f5a79cdb76e0dc1a98899c8598f4db014c5e7" },
"nui.nvim": { "branch": "main", "commit": "8d3bce9764e627b62b07424e0df77f680d47ffdb" }, "nui.nvim": { "branch": "main", "commit": "8d5b0b568517935d3c84f257f272ef004d9f5a59" },
"nvim-autopairs": { "branch": "master", "commit": "2a406cdd8c373ae7fe378a9e062a5424472bd8d8" }, "nvim-autopairs": { "branch": "master", "commit": "4d74e75913832866aa7de35e4202463ddf6efd1b" },
"nvim-cmp": { "branch": "main", "commit": "059e89495b3ec09395262f16b1ad441a38081d04" }, "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
"nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" },
"nvim-html-css": { "branch": "main", "commit": "435b2aa62d651cda9535aae7854dbea371f0a46e" }, "nvim-html-css": { "branch": "main", "commit": "23f53cbb8cf4ae7c302ba483ea8a28e5b03713a7" },
"nvim-lint": { "branch": "master", "commit": "5b1bdf306bd3e565908145279e8bbfc594dac3b3" }, "nvim-lint": { "branch": "master", "commit": "9dfb77ef6c5092a19502883c02dc5a02ec648729" },
"nvim-lspconfig": { "branch": "master", "commit": "4ea9083b6d3dff4ddc6da17c51334c3255b7eba5" }, "nvim-lspconfig": { "branch": "master", "commit": "46434074f188e6bfccf9d9153dd8be6b1381498b" },
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
"nvim-notify": { "branch": "master", "commit": "22f29093eae7785773ee9d543f8750348b1a195c" }, "nvim-notify": { "branch": "master", "commit": "b5825cf9ee881dd8e43309c93374ed5b87b7a896" },
"nvim-tree.lua": { "branch": "master", "commit": "6709463b2d18e77f7a946027917aa00d4aaed6f4" }, "nvim-tree.lua": { "branch": "master", "commit": "be5b788f2dc1522c73fb7afad9092331c8aebe80" },
"nvim-treesitter": { "branch": "master", "commit": "0e21ee8df6235511c02bab4a5b391d18e165a58d" }, "nvim-treesitter": { "branch": "master", "commit": "94ea4f436d2b59c80f02e293466c374584f03b8c" },
"nvim-treesitter-context": { "branch": "master", "commit": "439789a9a8df9639ecd749bb3286b77117024a6f" }, "nvim-treesitter-context": { "branch": "master", "commit": "6daca3ad780f045550b820f262002f35175a6c04" },
"nvim-web-devicons": { "branch": "master", "commit": "57dfa947cc88cdf1baa2c7e13ed31edddd8fb1d1" }, "nvim-web-devicons": { "branch": "master", "commit": "2c2b4eafce6cdd0cb165036faa17396eff18f847" },
"obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" }, "obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" },
"odis": { "branch": "master", "commit": "5176a07a729860d0c0cdefe96252fc7ff9e16d43" }, "odis": { "branch": "master", "commit": "5176a07a729860d0c0cdefe96252fc7ff9e16d43" },
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
"presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" }, "presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" },
"rainbow-delimiters.nvim": { "branch": "master", "commit": "de39919a57e1a40a4c7dc5bae0de276f9c616ef3" }, "rainbow-delimiters.nvim": { "branch": "master", "commit": "55ad4fb76ab68460f700599b7449385f0c4e858e" },
"render-markdown.nvim": { "branch": "main", "commit": "05e6a6d119f90b99829ecb7eb85428a226c0c05f" }, "render-markdown.nvim": { "branch": "main", "commit": "b2d857c848c2c27440c8e5efc8e49a9b5bcf13c6" },
"telescope-color-names.nvim": { "branch": "main", "commit": "95b372b9a8ba0fc7cf6a67be637ee37453f322da" }, "telescope-color-names.nvim": { "branch": "main", "commit": "95b372b9a8ba0fc7cf6a67be637ee37453f322da" },
"telescope-file-browser.nvim": { "branch": "master", "commit": "626998e5c1b71c130d8bc6cf7abb6709b98287bb" }, "telescope-file-browser.nvim": { "branch": "master", "commit": "626998e5c1b71c130d8bc6cf7abb6709b98287bb" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },

View File

@@ -12,10 +12,14 @@ local nosilent = { noremap = true }
vim.g.mapleader = " " vim.g.mapleader = " "
vim.g.maplocalleader = "," vim.g.maplocalleader = ","
function create_custom_command(trigger, command, description)
-- Create a custom command with the given trigger, command, and description
vim.api.nvim_create_user_command(trigger, command, { desc = description })
end
-- Custom commands -- Custom commands
vim.api.nvim_create_user_command("Config", "edit ~/.config/nvim", {}) create_custom_command("Config", "edit ~/.config/nvim", "Edit nvim configuration")
vim.api.nvim_create_user_command("Keymaps", "edit ~/.config/nvim/lua/core/keymaps.lua", {}) create_custom_command("Keymaps", "edit ~/.config/nvim/lua/core/keymaps.lua", "Edit Hyprland keybindings")
vim.api.nvim_create_user_command("Hypr", "edit ~/.config/hypr/hyprland.conf", {}) create_custom_command("Hypr", "edit ~/.config/hypr/hyprland.conf", "Edit Hyprland configuration")
-- {{{ Basic Mappings -- {{{ Basic Mappings
local basic_mappings = { local basic_mappings = {
@@ -34,10 +38,10 @@ local basic_mappings = {
local buffer_navigation_mappings = { local buffer_navigation_mappings = {
{ key = "<C-J>", cmd = ":bnext<CR>", desc = "Next buffer", mode = "n" }, { key = "<C-J>", cmd = ":bnext<CR>", desc = "Next buffer", mode = "n" },
{ key = "<C-K>", cmd = ":bprev<CR>", desc = "Previous buffer", mode = "n" }, { key = "<C-K>", cmd = ":bprev<CR>", desc = "Previous buffer", mode = "n" },
{ key = "<leader>bb", cmd = ":Telescope buffers<CR>", desc = "List buffers", mode = "n", group = "Buffers" }, { key = "<leader>bb", cmd = ":Telescope buffers<CR>", desc = "List buffers", mode = "n" },
{ key = "<leader>bk", cmd = ":bdelete<CR>", desc = "Delete buffer", mode = "n", group = "Buffers" }, { key = "<leader>bk", cmd = ":bdelete<CR>", desc = "Delete buffer", mode = "n" },
{ key = "<leader>bn", cmd = ":bnext<CR>", desc = "Next buffer", mode = "n", group = "Buffers" }, { key = "<leader>bn", cmd = ":bnext<CR>", desc = "Next buffer", mode = "n" },
{ key = "<leader>bp", cmd = ":bprev<CR>", desc = "Previous buffer", mode = "n", group = "Buffers" }, { key = "<leader>bp", cmd = ":bprev<CR>", desc = "Previous buffer", mode = "n" },
} }
--}}} --}}}
@@ -68,84 +72,72 @@ local terminal_mappings = {
cmd = ":ToggleTerm name=toggleterm<CR>", cmd = ":ToggleTerm name=toggleterm<CR>",
desc = "Toggle terminal", desc = "Toggle terminal",
mode = "n", mode = "n",
group = "Toggle",
}, },
{ {
key = "<leader>tT", key = "<leader>tT",
cmd = ":ToggleTerm name=toggleterm-full direction=tab<CR>", cmd = ":ToggleTerm name=toggleterm-full direction=tab<CR>",
desc = "Toggle full terminal", desc = "Toggle full terminal",
mode = "n", mode = "n",
group = "Toggle",
}, },
{ {
key = "<leader>ot", key = "<leader>ot",
cmd = ":ToggleTerm name=toggleterm<CR>", cmd = ":ToggleTerm name=toggleterm<CR>",
desc = "Open terminal", desc = "Open terminal",
mode = "n", mode = "n",
group = "Open",
}, },
{ {
key = "<leader>oT", key = "<leader>oT",
cmd = ":ToggleTerm name=toggleterm-full direction=tab<CR>", cmd = ":ToggleTerm name=toggleterm-full direction=tab<CR>",
desc = "Open full terminal", desc = "Open full terminal",
mode = "n", mode = "n",
group = "Open",
}, },
{ {
key = "<leader>ts", key = "<leader>ts",
cmd = ":TermSelect<CR>", cmd = ":TermSelect<CR>",
desc = "Select terminal", desc = "Select terminal",
mode = "n", mode = "n",
group = "Terminal",
}, },
{ {
key = "<leader>tv", key = "<leader>tv",
cmd = ":ToggleTerm direction=vertical name=toggleterm-vert<CR>", cmd = ":ToggleTerm direction=vertical name=toggleterm-vert<CR>",
desc = "Toggle vertical terminal", desc = "Toggle vertical terminal",
mode = "n", mode = "n",
group = "Terminal",
}, },
{ {
key = "<leader>th", key = "<leader>th",
cmd = ":ToggleTerm direction=horizontal name=toggleterm-hori<CR>", cmd = ":ToggleTerm direction=horizontal name=toggleterm-hori<CR>",
desc = "Toggle horizontal terminal", desc = "Toggle horizontal terminal",
mode = "n", mode = "n",
group = "Terminal",
}, },
{ {
key = "<leader>ov", key = "<leader>ov",
cmd = ":ToggleTerm direction=vertical name=toggleterm-vert<CR>", cmd = ":ToggleTerm direction=vertical name=toggleterm-vert<CR>",
desc = "Open vertical terminal", desc = "Open vertical terminal",
mode = "n", mode = "n",
group = "Open",
}, },
{ {
key = "<leader>oh", key = "<leader>oh",
cmd = ":ToggleTerm direction=horizontal name=toggleterm-hori<CR>", cmd = ":ToggleTerm direction=horizontal name=toggleterm-hori<CR>",
desc = "Open horizontal terminal", desc = "Open horizontal terminal",
mode = "n", mode = "n",
group = "Open",
}, },
{ {
key = "<leader>tf", key = "<leader>tf",
cmd = ":ToggleTerm name=toggleterm<CR>", cmd = ":ToggleTerm name=toggleterm<CR>",
desc = "Toggle terminal", desc = "Toggle terminal",
mode = "n", mode = "n",
group = "Terminal",
}, },
{ {
key = "<leader>-", key = "<leader>-",
cmd = ":ToggleTerm direction='horizontal'<CR>", cmd = ":ToggleTerm direction='horizontal'<CR>",
desc = "Toggle horizontal terminal", desc = "Toggle horizontal terminal",
mode = "n", mode = "n",
group = "Horizontal Terminal",
}, },
{ {
key = "<leader>|", key = "<leader>|",
cmd = ":ToggleTerm direction='vertical'<CR>", cmd = ":ToggleTerm direction='vertical'<CR>",
desc = "Toggle vertical terminal", desc = "Toggle vertical terminal",
mode = "n", mode = "n",
group = "Vertical Terminal",
}, },
} }
--}}} --}}}

View File

@@ -67,5 +67,19 @@ local border = {
} }
-- set border for floating windows and signature help -- set border for floating windows and signature help
l.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { border = border }) -- UNSUPPPORTED: https://github.com/neovim/neovim/issues/32242#issuecomment-2777120640
l.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = border }) -- l.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { border = border })
-- l.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = border })
o.winborder = "rounded"
vim.diagnostic.config({
virtual_text = true,
signs = true,
underline = true,
float = { border = "rounded", source = true },
severity_sort = true,
})
vim.keymap.set("", "<Leader>tl", function()
local current = vim.diagnostic.config().virtual_text
vim.diagnostic.config({ virtual_text = not current })
end, { desc = "Toggle diagnostics virtual text" })

View File

@@ -4,6 +4,7 @@ return {
"nvim-lua/plenary.nvim", "nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
"j-hui/fidget.nvim", "j-hui/fidget.nvim",
"ravitemer/mcphub.nvim",
}, },
opts = { opts = {
adapters = { adapters = {
@@ -17,7 +18,9 @@ return {
model = { model = {
-- default = "claude-3.7-sonnet-thought", -- default = "claude-3.7-sonnet-thought",
-- default = "o3-mini", -- default = "o3-mini",
default = "gemini-2.0-flash-001", -- default = "gemini-2.0-flash-001",
default = "gpt-4.1",
-- default = "gpt-4o",
-- default = "o3-mini-2025-01-31", -- default = "o3-mini-2025-01-31",
-- choices = { -- choices = {
-- ["o3-mini-2025-01-31"] = { opts = { can_reason = true } }, -- ["o3-mini-2025-01-31"] = { opts = { can_reason = true } },
@@ -26,7 +29,7 @@ return {
-- "gpt-4o-2024-08-06", -- "gpt-4o-2024-08-06",
-- "claude-3.7-sonnet-thought", -- "claude-3.7-sonnet-thought",
-- "claude-3.7-sonnet", -- "claude-3.7-sonnet",
-- "claude-3.5-sonnet", -- "claude-3.5-sonnet",
-- "gemini-2.0-flash-001", -- "gemini-2.0-flash-001",
-- }, -- },
}, },
@@ -94,8 +97,8 @@ return {
}, },
strategies = { strategies = {
chat = { chat = {
-- adapter = "copilot", adapter = "copilot",
adapter = "openrouter", -- adapter = "openrouter",
roles = { roles = {
llm = function(adapter) llm = function(adapter)
if adapter.model == nil then if adapter.model == nil then
@@ -134,8 +137,8 @@ return {
}, },
}, },
inline = { inline = {
-- adapter = "copilot", adapter = "copilot",
adapter = "openrouter", -- adapter = "openrouter",
}, },
}, },
display = { display = {
@@ -191,6 +194,16 @@ return {
log_level = "DEBUG", log_level = "DEBUG",
-- log_level = "TRACE", -- log_level = "TRACE",
}, },
extensions = {
mcphub = {
callback = "mcphub.extensions.codecompanion",
opts = {
show_result_in_chat = true, -- Show the mcp tool result in the chat buffer
make_vars = true, -- make chat #variables from MCP server resources
make_slash_commands = true, -- make /slash_commands from MCP server prompts
},
},
},
}, },
init = function() init = function()
require("plugins.codecompanion.fidget-spinner"):init() require("plugins.codecompanion.fidget-spinner"):init()

View File

@@ -1,9 +0,0 @@
return {
"https://git.sr.ht/~whynothugo/lsp_lines.nvim",
config = function()
-- lsp_lines
vim.diagnostic.config({ virtual_text = false })
-- --
vim.keymap.set("", "<Leader>tl", require("lsp_lines").toggle, { desc = "Toggle lsp_lines" })
end,
}

View File

@@ -5,7 +5,8 @@ return {
vim.notify = require("notify") vim.notify = require("notify")
local servers = { local servers = {
"bashls", "bashls",
"jedi_language_server", -- "jedi_language_server",
"basedpyright",
"jsonls", "jsonls",
-- "yamlls", -- "yamlls",
"vimls", "vimls",
@@ -19,28 +20,37 @@ return {
"angularls", "angularls",
"ansiblels", "ansiblels",
"docker_compose_language_service", "docker_compose_language_service",
"golangci_lint_ls",
"gopls",
}
-- Define the highlight color for float border
vim.api.nvim_set_hl(0, "FloatBorder", { fg = "#89b4fa", bold = true })
local border = {
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
} }
for _, lsp in ipairs(servers) do for _, lsp in ipairs(servers) do
if lsp == "lua_ls" then if lsp == "lua_ls" then
lspconfig[lsp].setup({ vim.lsp.enable(lsp)
-- on_attach = require("lsp-format").on_attach, vim.lsp.config("lua_ls", {
on_attach = function()
vim.notify("Lua LSP attached", nil, { title = "LSP" })
end,
on_init = function(client) on_init = function(client)
if client.workspace_folders then if client.workspace_folders then
local path = client.workspace_folders[1].name local path = client.workspace_folders[1].name
if if
path ~= vim.fn.stdpath("config") path ~= vim.fn.stdpath("config")
and ( and (vim.uv.fs_stat(path .. "/.luarc.json") or vim.uv.fs_stat(path .. "/.luarc.jsonc"))
vim.loop.fs_stat(path .. "/.luarc.json")
or vim.loop.fs_stat(path .. "/.luarc.jsonc")
)
then then
return return
end end
end end
client.config.settings.Lua = vim.tbl_deep_extend("force", client.config.settings.Lua, { client.config.settings.Lua = vim.tbl_deep_extend("force", client.config.settings.Lua, {
runtime = { runtime = {
-- Tell the language server which version of Lua you're using -- Tell the language server which version of Lua you're using
@@ -53,7 +63,7 @@ return {
library = { library = {
vim.env.VIMRUNTIME, vim.env.VIMRUNTIME,
-- Depending on the usage, you might want to add additional paths here. -- Depending on the usage, you might want to add additional paths here.
-- "${3rd}/luv/library" -- "${3rd}/luv/library",
-- "${3rd}/busted/library", -- "${3rd}/busted/library",
}, },
-- or pull in all of 'runtimepath'. NOTE: this is a lot slower and will cause issues when working on your own configuration (see https://github.com/neovim/nvim-lspconfig/issues/3189) -- or pull in all of 'runtimepath'. NOTE: this is a lot slower and will cause issues when working on your own configuration (see https://github.com/neovim/nvim-lspconfig/issues/3189)
@@ -61,24 +71,36 @@ return {
}, },
}) })
end, end,
callSnippet = "Replace",
settings = { settings = {
Lua = {}, Lua = {},
}, },
handlers = {},
}) })
elseif lsp == "docker_compose_language_service" then elseif lsp == "basedpyright" then
lspconfig[lsp].setup({ vim.lsp.enable(lsp)
filetypes = { "dockerfile", "docker-compose", "yaml", "yml" }, vim.lsp.config(lsp, {
on_attach = function() analysis = {
vim.notify("Docker Compose LSP attached", nil, { title = "LSP" }) autoSearchPaths = true,
end, diagnosticMode = "openFilesOnly",
useLibraryCodeForTypes = true,
},
diagnosticMode = "openFilesOnly",
inlayHints = {
callArgumentNames = true,
},
}) })
else else
lspconfig[lsp].setup({ vim.lsp.enable(lsp)
on_attach = function() -- vim.lsp.config(lsp, {
vim.notify(lsp .. " LSP attached", nil, { title = "LSP" }) -- handlers = {
end, -- UNNSUUPPORTED
}) -- ["textDocument/signatureHelp"] = vim.lsp.with(
-- vim.lsp.handlers.signature_help,
-- { border = border }
-- ),
-- ["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = border }),
-- },
-- })
end end
end end
end, end,

View File

@@ -20,6 +20,7 @@ return {
lualine_x = { lualine_x = {
{ {
"seachcount", "seachcount",
{ require("mcphub.extensions.lualine") },
"copilot", "copilot",
symbols = { symbols = {
status = { status = {

51
lua/plugins/mcphub.lua Normal file
View File

@@ -0,0 +1,51 @@
return {
"ravitemer/mcphub.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
},
cmd = "MCPHub",
build = "bundled_build.lua", -- Bundles mcp-hub locally
config = function()
vim.notify = require("notify")
require("mcphub").setup({
use_bundled_binary = true, -- Use local binary
port = 37373, -- Port for MCP Hub Express API
config = vim.fn.expand("~/.config/mcphub/servers.json"), -- Config file path
native_servers = {}, -- add your native servers here
auto_approve = true,
extensions = {
avante = {},
codecompanion = {
show_result_in_chat = true, -- Show tool results in chat
make_vars = true, -- Create chat variables from resources
make_slash_commands = true, -- make /slash_commands from MCP server prompts
},
},
-- UI configuration
ui = {
window = {
width = 0.8, -- Window width (0-1 ratio)
height = 0.8, -- Window height (0-1 ratio)
border = "rounded", -- Window border style
relative = "editor", -- Window positioning
zindex = 50, -- Window stack order
},
},
-- Event callbacks
on_ready = function(hub) end, -- Called when hub is ready
on_error = function(err)
vim.notify(err, "ERROR")
end, -- Called on errors
-- Logging configuration
log = {
level = vim.log.levels.WARN, -- Minimum log level
to_file = false, -- Enable file logging
file_path = nil, -- Custom log file path
prefix = "MCPHub", -- Log message prefix
},
})
end,
}

View File

@@ -48,6 +48,39 @@ return {
inc_rename = false, -- enables an input dialog for inc-rename.nvim inc_rename = false, -- enables an input dialog for inc-rename.nvim
lsp_doc_border = true, -- add a border to hover docs and signature help lsp_doc_border = true, -- add a border to hover docs and signature help
}, },
cmdline = {
enabled = true, -- enables the Noice cmdline UI
view = "cmdline_popup", -- view for rendering the cmdline. Change to `cmdline` to get a classic cmdline at the bottom
opts = {}, -- global options for the cmdline. See section on views
---@type table<string, CmdlineFormat>
format = {
-- conceal: (default=true) This will hide the text in the cmdline that matches the pattern.
-- view: (default is cmdline view)
-- opts: any options passed to the view
-- icon_hl_group: optional hl_group for the icon
-- title: set to anything or empty string to hide
cmdline = { pattern = "^:", icon = "", lang = "vim" },
search_down = { kind = "search", pattern = "^/", icon = " ", lang = "regex" },
search_up = { kind = "search", pattern = "^%?", icon = " ", lang = "regex" },
filter = { pattern = "^:%s*!", icon = "$", lang = "bash" },
lua = { pattern = { "^:%s*lua%s+", "^:%s*lua%s*=%s*", "^:%s*=%s*" }, icon = "", lang = "lua" },
help = { pattern = "^:%s*he?l?p?%s+", icon = "" },
input = { view = "cmdline_input", icon = "󰥻 " }, -- Used by input()
-- lua = false, -- to disable a format, set to `false`
},
},
views = {
cmdline_popup = {
border = {
style = "none",
padding = { 0, 0 },
},
filter_options = {},
win_options = {
winhighlight = "NormalFloat:NormalFloat,FloatBorder:FloatBorder",
},
},
},
}, },
dependencies = { dependencies = {
-- if you lazy-load any plugin below, make sure to add proper `module="..."` entries -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries

View File

@@ -1,10 +1,10 @@
return { return {
'nvimtools/none-ls.nvim', "nvimtools/none-ls.nvim",
config = function() config = function()
local null_ls = require('null-ls') local null_ls = require("null-ls")
local helpers = require('null-ls.helpers') local helpers = require("null-ls.helpers")
-- syncronous formatting -- syncronous formatting
local augroup = vim.api.nvim_create_augroup('LspFormatting', {}) local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
-- null_ls.setup({ -- null_ls.setup({
-- on_attach = function(client) -- on_attach = function(client)
@@ -20,11 +20,11 @@ return {
-- }) -- })
-- you can reuse a shared lspconfig on_attach callback here -- you can reuse a shared lspconfig on_attach callback here
require('null-ls').setup({ require("null-ls").setup({
on_attach = function(client, bufnr) on_attach = function(client, bufnr)
if client.supports_method('textDocument/formatting') then if client.supports_method("textDocument/formatting") then
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr }) vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
vim.api.nvim_create_autocmd('BufWritePre', { vim.api.nvim_create_autocmd("BufWritePre", {
group = augroup, group = augroup,
buffer = bufnr, buffer = bufnr,
callback = function() callback = function()
@@ -35,7 +35,7 @@ return {
async = false, async = false,
bufnr = bufnr, bufnr = bufnr,
filter = function(client) filter = function(client)
return client.name == 'null-ls' return client.name == "null-ls"
end, end,
}) })
end, end,
@@ -60,9 +60,12 @@ return {
null_ls.builtins.formatting.markdownlint, null_ls.builtins.formatting.markdownlint,
null_ls.builtins.formatting.prettier, -- handled by lsp server null_ls.builtins.formatting.prettier, -- handled by lsp server
null_ls.builtins.formatting.shfmt.with({ null_ls.builtins.formatting.shfmt.with({
filetypes = { 'sh', 'bash' }, filetypes = { "sh", "bash" },
extra_args = { '-i', '0', '-ci', '-sr' }, extra_args = { "-i", "0", "-ci", "-sr" },
}), }),
null_ls.builtins.formatting.gofmt,
null_ls.builtins.formatting.goimports,
null_ls.builtins.formatting.goimports_reviser,
-- null_ls.builtins.diagnostics.actionlint, -- null_ls.builtins.diagnostics.actionlint,
}, },
}) })

1
lua/plugins/nui.lua Normal file
View File

@@ -0,0 +1 @@
return { "MunifTanjim/nui.nvim" }

View File

@@ -1,7 +1,8 @@
return { return {
"mfussenegger/nvim-lint", "mfussenegger/nvim-lint",
config = function() config = function()
require("lint").linters_by_ft = { local lint = require("lint")
lint.linters_by_ft = {
markdown = { "markdownlint" }, markdown = { "markdownlint" },
lua = { "luacheck" }, lua = { "luacheck" },
py = { "flake8", "pylint", "pydocstyle", "pycodestyle", "mypy" }, py = { "flake8", "pylint", "pydocstyle", "pycodestyle", "mypy" },
@@ -9,6 +10,25 @@ return {
json = { "jsonlint" }, json = { "jsonlint" },
yaml = { "yamllint" }, yaml = { "yamllint" },
vim = { "vint" }, vim = { "vint" },
go = { "golangcilint" },
} }
local shellcheck = require("lint").linters.shellcheck
shellcheck.args = {
"-s",
"bash",
"-o",
"all",
"-e",
"2250",
}
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
group = lint_augroup,
callback = function()
lint.try_lint()
end,
})
end, end,
event = { "BufReadPre", "BufNewFile" },
} }

View File

@@ -10,7 +10,6 @@ vim.notify = require("notify")
---@usage addToWhichKey(mappings, group) ---@usage addToWhichKey(mappings, group)
---@example addToWhichKey({{key = "n", cmd = "next", mode = "n", desc = "Next Line", group = "Navigation"}, {key = "t", group = "example"}) ---@example addToWhichKey({{key = "n", cmd = "next", mode = "n", desc = "Next Line", group = "Navigation"}, {key = "t", group = "example"})
function M.addToWhichKey(mappings, group) function M.addToWhichKey(mappings, group)
local wk_mappings = {}
if group then if group then
whichkey.add({ group.key, group = group.group }) whichkey.add({ group.key, group = group.group })
end end
@@ -21,6 +20,7 @@ function M.addToWhichKey(mappings, group)
return return
end end
for _, mapping in ipairs(mappings) do for _, mapping in ipairs(mappings) do
local wk_mappings = {}
if not mapping.key or mapping.key == "" then if not mapping.key or mapping.key == "" then
vim.notify("Error: Key is empty or nil", "error") vim.notify("Error: Key is empty or nil", "error")
return return
@@ -38,9 +38,11 @@ function M.addToWhichKey(mappings, group)
wk_mappings[1] = mapping.key wk_mappings[1] = mapping.key
wk_mappings[2] = mapping.cmd wk_mappings[2] = mapping.cmd
wk_mappings.mode = mapping.mode wk_mappings.mode = mapping.mode or "n"
wk_mappings.desc = mapping.desc or "No Description" wk_mappings.desc = mapping.desc
wk_mappings.group = mapping.group or "No Group" if mapping.group then
wk_mappings.group = mapping.group
end
whichkey.add(wk_mappings) whichkey.add(wk_mappings)
end end
end end