Compare commits

...

17 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
ebbe37bece fix command 2025-04-10 22:17:35 -07:00
211a543b71 update to use file 2025-04-10 22:01:03 -07:00
79556ce727 roll key 2025-04-10 22:00:00 -07:00
cc288092b8 Merge branch 'master' of gitea.suda.codes:sudacode/nvim 2025-04-10 21:58:03 -07:00
3038404b0a update 2025-04-10 21:57:59 -07:00
14 changed files with 310 additions and 160 deletions

View File

@@ -2,59 +2,60 @@
"LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" },
"any-jump.vim": { "branch": "master", "commit": "f95674d9a4251ac02f452d5f1861e4422f4652c7" },
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
"catppuccin": { "branch": "main", "commit": "7ab1a6ec70a664ecb95d84669efc20aaf4f4ed1b" },
"cmp-async-path": { "branch": "main", "commit": "d6d1ffa2075039632a2d71e8fa139818e15ac757" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"catppuccin": { "branch": "main", "commit": "b7bbdf93b42866f166af98d39a2563eedb7cabac" },
"cmp-async-path": { "branch": "main", "commit": "0ed1492f59e730c366d261a5ad822fa37e44c325" },
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
"cmp-nvim-lsp-document-symbol": { "branch": "main", "commit": "f94f7ba948e32cd302caba1c2ca3f7c697fb4fcf" },
"cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "031e6ba70b0ad5eee49fd2120ff7a2e325b17fa7" },
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
"codecompanion.nvim": { "branch": "main", "commit": "c3add8138fe624b794d2226fb04c8540cea73aa7" },
"conform.nvim": { "branch": "master", "commit": "a6f5bdb78caa305496357d17e962bbc4c0b392e2" },
"codecompanion.nvim": { "branch": "main", "commit": "e55bbf5f6969ab41414d3fd68011366d3b80d024" },
"conform.nvim": { "branch": "master", "commit": "372fc521f8421b7830ea6db4d6ea3bae1c77548c" },
"copilot-cmp": { "branch": "master", "commit": "15fc12af3d0109fa76b60b5cffa1373697e261d1" },
"copilot-lualine": { "branch": "main", "commit": "dc4b8ed0f75bc2557b3158c526624bf04ad233ea" },
"copilot.lua": { "branch": "master", "commit": "30321e33b03cb924fdcd6a806a0dc6fa0b0eafb9" },
"dashboard-nvim": { "branch": "master", "commit": "000448d837f6e7a47f8f342f29526c4d7e49e9ce" },
"copilot-lualine": { "branch": "main", "commit": "6bc29ba1fcf8f0f9ba1f0eacec2f178d9be49333" },
"copilot.lua": { "branch": "master", "commit": "a5c390f8d8e85b501b22dcb2f30e0cbbd69d5ff0" },
"dashboard-nvim": { "branch": "master", "commit": "591b5b29e2f17b97496ec3179f6ecd08bb8502cc" },
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
"fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" },
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
"gitsigns.nvim": { "branch": "main", "commit": "4c40357994f386e72be92a46f41fc1664c84c87d" },
"goto-preview": { "branch": "main", "commit": "4751e70a6ebce4fb78327b097cb8fdff55f38f3a" },
"image.nvim": { "branch": "master", "commit": "6ffafab2e98b5bda46bf227055aa84b90add8cdc" },
"indent-blankline.nvim": { "branch": "master", "commit": "e10626f7fcd51ccd56d7ffc00883ba7e0aa28f78" },
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
"gitsigns.nvim": { "branch": "main", "commit": "1796c7cedfe7e5dd20096c5d7b8b753d8f8d22eb" },
"goto-preview": { "branch": "main", "commit": "d1faf6ea992b5bcaaaf2c682e1aba3131a01143e" },
"image.nvim": { "branch": "master", "commit": "4c51d6202628b3b51e368152c053c3fb5c5f76f2" },
"indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" },
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
"lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" },
"lsp_lines.nvim": { "branch": "main", "commit": "a92c755f182b89ea91bd8a6a2227208026f27b4d" },
"lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" },
"lualine.nvim": { "branch": "master", "commit": "f4f791f67e70d378a754d02da068231d2352e5bc" },
"mini.diff": { "branch": "main", "commit": "bc3a7be30fd45ed4961ea90de1d9d04637cdeae6" },
"mini.nvim": { "branch": "main", "commit": "e554890210cd29d017d6a0c1b1a46f995dcf9e64" },
"lualine.nvim": { "branch": "master", "commit": "15884cee63a8c205334ab13ab1c891cd4d27101a" },
"mcphub.nvim": { "branch": "main", "commit": "81394b54e292a50361aba11198e5fa4ebb97d304" },
"mini.diff": { "branch": "main", "commit": "7e268d0241255abaa07b8aa0ddff028f7315fe21" },
"mini.nvim": { "branch": "main", "commit": "90ab64f944a5a63a9efebe6735e1f2c6d4db3613" },
"noice.nvim": { "branch": "main", "commit": "0427460c2d7f673ad60eb02b35f5e9926cf67c59" },
"none-ls.nvim": { "branch": "main", "commit": "a66b5b9ad8d6a3f3dd8c0677a80eb27412fa5056" },
"nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" },
"nvim-autopairs": { "branch": "master", "commit": "68f0e5c3dab23261a945272032ee6700af86227a" },
"nvim-cmp": { "branch": "main", "commit": "5a11682453ac6b13dbf32cd403da4ee9c07ef1c3" },
"none-ls.nvim": { "branch": "main", "commit": "a49f5a79cdb76e0dc1a98899c8598f4db014c5e7" },
"nui.nvim": { "branch": "main", "commit": "8d5b0b568517935d3c84f257f272ef004d9f5a59" },
"nvim-autopairs": { "branch": "master", "commit": "4d74e75913832866aa7de35e4202463ddf6efd1b" },
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
"nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" },
"nvim-html-css": { "branch": "main", "commit": "fa7e2da75edfd3d110fc8d4f8e5215b5de56ff42" },
"nvim-lint": { "branch": "master", "commit": "6e9dd545a1af204c4022a8fcd99727ea41ffdcc8" },
"nvim-lspconfig": { "branch": "master", "commit": "5344e00b86d1ea50c39a1da8af9f3d197234bcfe" },
"nvim-html-css": { "branch": "main", "commit": "23f53cbb8cf4ae7c302ba483ea8a28e5b03713a7" },
"nvim-lint": { "branch": "master", "commit": "9dfb77ef6c5092a19502883c02dc5a02ec648729" },
"nvim-lspconfig": { "branch": "master", "commit": "46434074f188e6bfccf9d9153dd8be6b1381498b" },
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
"nvim-notify": { "branch": "master", "commit": "22f29093eae7785773ee9d543f8750348b1a195c" },
"nvim-tree.lua": { "branch": "master", "commit": "6709463b2d18e77f7a946027917aa00d4aaed6f4" },
"nvim-treesitter": { "branch": "master", "commit": "8f87d28442f7f91347e993661c319135f47729c7" },
"nvim-web-devicons": { "branch": "master", "commit": "1020869742ecb191f260818234517f4a1515cfe8" },
"nvim-notify": { "branch": "master", "commit": "b5825cf9ee881dd8e43309c93374ed5b87b7a896" },
"nvim-tree.lua": { "branch": "master", "commit": "be5b788f2dc1522c73fb7afad9092331c8aebe80" },
"nvim-treesitter": { "branch": "master", "commit": "94ea4f436d2b59c80f02e293466c374584f03b8c" },
"nvim-treesitter-context": { "branch": "master", "commit": "6daca3ad780f045550b820f262002f35175a6c04" },
"nvim-web-devicons": { "branch": "master", "commit": "2c2b4eafce6cdd0cb165036faa17396eff18f847" },
"obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" },
"odis": { "branch": "master", "commit": "5176a07a729860d0c0cdefe96252fc7ff9e16d43" },
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
"presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" },
"rainbow-delimiters.nvim": { "branch": "master", "commit": "011d98eaa3a73b5a51d82ce5bc6b1397dde95562" },
"render-markdown.nvim": { "branch": "main", "commit": "1cd546e96cb8520a148610ca86596ed238eeb936" },
"rainbow-delimiters.nvim": { "branch": "master", "commit": "55ad4fb76ab68460f700599b7449385f0c4e858e" },
"render-markdown.nvim": { "branch": "main", "commit": "b2d857c848c2c27440c8e5efc8e49a9b5bcf13c6" },
"telescope-color-names.nvim": { "branch": "main", "commit": "95b372b9a8ba0fc7cf6a67be637ee37453f322da" },
"telescope-file-browser.nvim": { "branch": "master", "commit": "626998e5c1b71c130d8bc6cf7abb6709b98287bb" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "2a5ceff981501cff8f46871d5402cd3378a8ab6a" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },
"telescope-glyph.nvim": { "branch": "master", "commit": "f63f01e129e71cc25b79637610674bbf0be5ce9d" },
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
"telescope.nvim": { "branch": "master", "commit": "814f102cd1da3dc78c7d2f20f2ef3ed3cdf0e6e4" },
"telescope.nvim": { "branch": "master", "commit": "a4ed82509cecc56df1c7138920a1aeaf246c0ac5" },
"toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" },
"vim-commentary": { "branch": "master", "commit": "64a654ef4a20db1727938338310209b6a63f60c9" },
"vim-dotenv": { "branch": "master", "commit": "5c51cfcf8d87280d6414e03cd6b253eb70ecb800" },

View File

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

View File

@@ -15,7 +15,7 @@ o.syntax = "on"
o.laststatus = 3
o.number = true
o.relativenumber = true
o.colorcolumn = "80"
o.colorcolumn = "88"
o.textwidth = 80
o.shiftwidth = 4
o.expandtab = true
@@ -67,5 +67,19 @@ local border = {
}
-- set border for floating windows and signature help
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 })
-- UNSUPPPORTED: https://github.com/neovim/neovim/issues/32242#issuecomment-2777120640
-- 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-treesitter/nvim-treesitter",
"j-hui/fidget.nvim",
"ravitemer/mcphub.nvim",
},
opts = {
adapters = {
@@ -17,7 +18,9 @@ return {
model = {
-- default = "claude-3.7-sonnet-thought",
-- 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",
-- choices = {
-- ["o3-mini-2025-01-31"] = { opts = { can_reason = true } },
@@ -77,7 +80,7 @@ return {
return require("codecompanion.adapters").extend("openai_compatible", {
env = {
url = "https://openrouter.ai/api",
api_key = "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",
api_key = "cmd:cat $HOME/.openrouterapikey",
chat_url = "/v1/chat/completions",
},
schema = {
@@ -94,8 +97,8 @@ return {
},
strategies = {
chat = {
-- adapter = "copilot",
adapter = "openrouter",
adapter = "copilot",
-- adapter = "openrouter",
roles = {
llm = function(adapter)
if adapter.model == nil then
@@ -134,8 +137,8 @@ return {
},
},
inline = {
-- adapter = "copilot",
adapter = "openrouter",
adapter = "copilot",
-- adapter = "openrouter",
},
},
display = {
@@ -191,6 +194,16 @@ return {
log_level = "DEBUG",
-- 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()
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")
local servers = {
"bashls",
"jedi_language_server",
-- "jedi_language_server",
"basedpyright",
"jsonls",
-- "yamlls",
"vimls",
@@ -19,28 +20,37 @@ return {
"angularls",
"ansiblels",
"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
if lsp == "lua_ls" then
lspconfig[lsp].setup({
-- on_attach = require("lsp-format").on_attach,
on_attach = function()
vim.notify("Lua LSP attached", nil, { title = "LSP" })
end,
vim.lsp.enable(lsp)
vim.lsp.config("lua_ls", {
on_init = function(client)
if client.workspace_folders then
local path = client.workspace_folders[1].name
if
path ~= vim.fn.stdpath("config")
and (
vim.loop.fs_stat(path .. "/.luarc.json")
or vim.loop.fs_stat(path .. "/.luarc.jsonc")
)
and (vim.uv.fs_stat(path .. "/.luarc.json") or vim.uv.fs_stat(path .. "/.luarc.jsonc"))
then
return
end
end
client.config.settings.Lua = vim.tbl_deep_extend("force", client.config.settings.Lua, {
runtime = {
-- Tell the language server which version of Lua you're using
@@ -53,7 +63,7 @@ return {
library = {
vim.env.VIMRUNTIME,
-- Depending on the usage, you might want to add additional paths here.
-- "${3rd}/luv/library"
-- "${3rd}/luv/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)
@@ -61,24 +71,36 @@ return {
},
})
end,
callSnippet = "Replace",
settings = {
Lua = {},
},
handlers = {},
})
elseif lsp == "docker_compose_language_service" then
lspconfig[lsp].setup({
filetypes = { "dockerfile", "docker-compose", "yaml", "yml" },
on_attach = function()
vim.notify("Docker Compose LSP attached", nil, { title = "LSP" })
end,
elseif lsp == "basedpyright" then
vim.lsp.enable(lsp)
vim.lsp.config(lsp, {
analysis = {
autoSearchPaths = true,
diagnosticMode = "openFilesOnly",
useLibraryCodeForTypes = true,
},
diagnosticMode = "openFilesOnly",
inlayHints = {
callArgumentNames = true,
},
})
else
lspconfig[lsp].setup({
on_attach = function()
vim.notify(lsp .. " LSP attached", nil, { title = "LSP" })
end,
})
vim.lsp.enable(lsp)
-- vim.lsp.config(lsp, {
-- handlers = {
-- 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,

View File

@@ -20,6 +20,7 @@ return {
lualine_x = {
{
"seachcount",
{ require("mcphub.extensions.lualine") },
"copilot",
symbols = {
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
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 = {
-- if you lazy-load any plugin below, make sure to add proper `module="..."` entries

View File

@@ -20,8 +20,7 @@ return {
-- })
-- you can reuse a shared lspconfig on_attach callback here
require('null-ls').setup({
require("null-ls").setup({
on_attach = function(client, bufnr)
if client.supports_method("textDocument/formatting") then
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
@@ -50,16 +49,25 @@ return {
null_ls.builtins.diagnostics.mypy,
null_ls.builtins.diagnostics.markdownlint,
null_ls.builtins.diagnostics.pylint,
-- null_ls.builtins.diagnostics.pydocstyle.with({
-- extra_arags = { "--config=$ROOT/setup.cfg" },
-- }),
-- null_ls.builtins.diagnostics.pydoclint,
null_ls.builtins.formatting.stylua,
-- null_ls.builtins.formatting.stylua.with({
-- extra_args = { '--config-path', vim.fn.expand('~/.config/stylua.toml') },
-- }),
null_ls.builtins.formatting.markdownlint,
null_ls.builtins.formatting.prettier, -- handled by lsp server
null_ls.builtins.formatting.shfmt.with({
filetypes = { "sh", "bash" },
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,
},
})
end
end,
}

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

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

View File

@@ -1,14 +1,34 @@
return {
"mfussenegger/nvim-lint",
config = function()
require("lint").linters_by_ft = {
local lint = require("lint")
lint.linters_by_ft = {
markdown = { "markdownlint" },
lua = { "luacheck" },
py = { "pylint", "pydocstyle", "pycodestyle", "mypy" },
py = { "flake8", "pylint", "pydocstyle", "pycodestyle", "mypy" },
sh = { "shellcheck" },
json = { "jsonlint" },
yaml = { "yamllint" },
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,
event = { "BufReadPre", "BufNewFile" },
}

View File

@@ -0,0 +1 @@
return { "nvim-treesitter/nvim-treesitter-context" }

View File

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