dev: automated commit - 2025-12-22 16:25:06
This commit is contained in:
parent
a0e3cf85df
commit
097db10b9f
10 changed files with 107 additions and 240 deletions
|
|
@ -3,46 +3,40 @@
|
||||||
"LuaSnip": { "branch": "master", "commit": "5a1e39223db9a0498024a77b8441169d260c8c25" },
|
"LuaSnip": { "branch": "master", "commit": "5a1e39223db9a0498024a77b8441169d260c8c25" },
|
||||||
"blink.cmp": { "branch": "main", "commit": "b19413d214068f316c78978b08264ed1c41830ec" },
|
"blink.cmp": { "branch": "main", "commit": "b19413d214068f316c78978b08264ed1c41830ec" },
|
||||||
"cloak.nvim": { "branch": "main", "commit": "648aca6d33ec011dc3166e7af3b38820d01a71e4" },
|
"cloak.nvim": { "branch": "main", "commit": "648aca6d33ec011dc3166e7af3b38820d01a71e4" },
|
||||||
"conform.nvim": { "branch": "master", "commit": "4993e07fac6679d0a5005aa7499e0bad2bd39f19" },
|
"conform.nvim": { "branch": "master", "commit": "5420c4b5ea0aeb99c09cfbd4fd0b70d257b44f25" },
|
||||||
"fidget.nvim": { "branch": "main", "commit": "e32b672d8fd343f9d6a76944fedb8c61d7d8111a" },
|
"fidget.nvim": { "branch": "main", "commit": "64463022a1f2ff1318ab22a2ea4125ed9313a483" },
|
||||||
"flash.nvim": { "branch": "main", "commit": "fcea7ff883235d9024dc41e638f164a450c14ca2" },
|
"flash.nvim": { "branch": "main", "commit": "fcea7ff883235d9024dc41e638f164a450c14ca2" },
|
||||||
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
||||||
"fzf-lua": { "branch": "main", "commit": "9a0704e8af8f8442110ff22a83b5608366b235df" },
|
"fzf-lua": { "branch": "main", "commit": "b1d2b0dc146cb9260209da4d7ab754adb0a2653d" },
|
||||||
"git-worktree.nvim": { "branch": "main", "commit": "3ad8c17a3d178ac19be925284389c14114638ebb" },
|
"git-worktree.nvim": { "branch": "main", "commit": "3ad8c17a3d178ac19be925284389c14114638ebb" },
|
||||||
"gitlinker.nvim": { "branch": "master", "commit": "cc59f732f3d043b626c8702cb725c82e54d35c25" },
|
"gitlinker.nvim": { "branch": "master", "commit": "cc59f732f3d043b626c8702cb725c82e54d35c25" },
|
||||||
"gitsigns.nvim": { "branch": "main", "commit": "5813e4878748805f1518cee7abb50fd7205a3a48" },
|
"gitsigns.nvim": { "branch": "main", "commit": "5813e4878748805f1518cee7abb50fd7205a3a48" },
|
||||||
"go.nvim": { "branch": "master", "commit": "81bb94c1d21648245eb14c69461f5c7f8c705752" },
|
"go.nvim": { "branch": "master", "commit": "41a18f0c05534c375bafec7ed05cdb409c4abcc6" },
|
||||||
"grug-far.nvim": { "branch": "main", "commit": "b58b2d65863f4ebad88b10a1ddd519e5380466e0" },
|
"grug-far.nvim": { "branch": "main", "commit": "bc589a1ba340a00ae40bf1436401eac5b1454687" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
|
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
||||||
"lazydev.nvim": { "branch": "main", "commit": "5231c62aa83c2f8dc8e7ba957aa77098cda1257d" },
|
"lazydev.nvim": { "branch": "main", "commit": "5231c62aa83c2f8dc8e7ba957aa77098cda1257d" },
|
||||||
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
|
|
||||||
"mini.ai": { "branch": "main", "commit": "bfb26d9072670c3aaefab0f53024b2f3729c8083" },
|
"mini.ai": { "branch": "main", "commit": "bfb26d9072670c3aaefab0f53024b2f3729c8083" },
|
||||||
"mini.icons": { "branch": "main", "commit": "ff2e4f1d29f659cc2bad0f9256f2f6195c6b2428" },
|
"mini.icons": { "branch": "main", "commit": "ff2e4f1d29f659cc2bad0f9256f2f6195c6b2428" },
|
||||||
"mini.statusline": { "branch": "main", "commit": "14919901649d20d020e659c63c03baa75cd94f33" },
|
"mini.statusline": { "branch": "main", "commit": "3e96596ebe51b899874d8174409cdc4f3c749d9a" },
|
||||||
"mini.surround": { "branch": "main", "commit": "88c52297ed3e69ecf9f8652837888ecc727a28ee" },
|
|
||||||
"nightfox.nvim": { "branch": "main", "commit": "ba47d4b4c5ec308718641ba7402c143836f35aa9" },
|
|
||||||
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
||||||
"nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" },
|
"nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" },
|
||||||
"nvim-dbee": { "branch": "master", "commit": "dda517694889a5d238d7aa407403984da9f80cc0" },
|
"nvim-dbee": { "branch": "master", "commit": "dda517694889a5d238d7aa407403984da9f80cc0" },
|
||||||
"nvim-lastplace": { "branch": "main", "commit": "0bb6103c506315044872e0f84b1f736c4172bb20" },
|
"nvim-lastplace": { "branch": "main", "commit": "0bb6103c506315044872e0f84b1f736c4172bb20" },
|
||||||
"nvim-lint": { "branch": "master", "commit": "d1118791070d090777398792a73032a0ca5c79ff" },
|
"nvim-lint": { "branch": "master", "commit": "7a64f4067065c16a355d40d0d599b8ca6b25de6d" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "07f4e93de92e8d4ea7ab99602e3a8c9ac0fb778a" },
|
"nvim-lspconfig": { "branch": "master", "commit": "361dd9d5f3f8ae3d8c721f4f2c21847050538b1f" },
|
||||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||||
"nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" },
|
"nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" },
|
||||||
"nvim-ufo": { "branch": "main", "commit": "72d54c31079d38d8dfc5456131b1d0fb5c0264b0" },
|
"nvim-ufo": { "branch": "main", "commit": "72d54c31079d38d8dfc5456131b1d0fb5c0264b0" },
|
||||||
"obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" },
|
"oil.nvim": { "branch": "master", "commit": "756dec855b4811f2d27f067a3aca477f368d99f5" },
|
||||||
"oil.nvim": { "branch": "master", "commit": "01cb3a8ad7d5e8707041edc775af83dbf33838f4" },
|
|
||||||
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||||
"presenterm.nvim": { "branch": "main", "commit": "2db942337aeeca99e33f627459df2264b3987634" },
|
|
||||||
"promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" },
|
"promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" },
|
||||||
"quicker.nvim": { "branch": "master", "commit": "9983d4b28881e1df626e3682167b45c284d4da8c" },
|
"quicker.nvim": { "branch": "master", "commit": "ad367a8f27aff3361db43ea2f41cd505ab573617" },
|
||||||
"render-markdown.nvim": { "branch": "main", "commit": "6e0e8902dac70fecbdd8ce557d142062a621ec38" },
|
|
||||||
"rose-pine": { "branch": "main", "commit": "cf2a288696b03d0934da713d66c6d71557b5c997" },
|
"rose-pine": { "branch": "main", "commit": "cf2a288696b03d0934da713d66c6d71557b5c997" },
|
||||||
"schemastore.nvim": { "branch": "main", "commit": "aa25399c48236b77af71d4b64cdf157d2ba4e990" },
|
"schemastore.nvim": { "branch": "main", "commit": "8b92ea89835b8e5dbc779a675ebb0e5fcb9a1993" },
|
||||||
"snacks.nvim": { "branch": "main", "commit": "fe7cfe9800a182274d0f868a74b7263b8c0c020b" },
|
"snacks.nvim": { "branch": "main", "commit": "fe7cfe9800a182274d0f868a74b7263b8c0c020b" },
|
||||||
"suda.vim": { "branch": "master", "commit": "c492741b4679b3cdd4d9e34138209784e061d916" },
|
"suda.vim": { "branch": "master", "commit": "c492741b4679b3cdd4d9e34138209784e061d916" },
|
||||||
"todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" },
|
"todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" },
|
||||||
"typst-preview.nvim": { "branch": "master", "commit": "e544812bba84b4f7976590f2b6c0dfbd099e1893" },
|
"typst-preview.nvim": { "branch": "master", "commit": "87d0f3a1beedefe6fdd96422c04c3dceb69d1063" },
|
||||||
"undotree": { "branch": "master", "commit": "0f1c9816975b5d7f87d5003a19c53c6fd2ff6f7f" },
|
"undotree": { "branch": "master", "commit": "0f1c9816975b5d7f87d5003a19c53c6fd2ff6f7f" },
|
||||||
"vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" },
|
"vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" },
|
||||||
"vim-hugo": { "branch": "master", "commit": "324fb8c7371d31701349c1192e25a0bdcf9898f8" },
|
"vim-hugo": { "branch": "master", "commit": "324fb8c7371d31701349c1192e25a0bdcf9898f8" },
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ M.config = function()
|
||||||
|
|
||||||
lint.linters_by_ft = {
|
lint.linters_by_ft = {
|
||||||
-- fuck this shit, 1.5Gb of RAM for this crap
|
-- fuck this shit, 1.5Gb of RAM for this crap
|
||||||
--
|
|
||||||
-- javascript = {"eslint_d"},
|
-- javascript = {"eslint_d"},
|
||||||
-- typescript = {"eslint_d"},
|
-- typescript = {"eslint_d"},
|
||||||
-- javascriptreact = {"eslint_d"},
|
-- javascriptreact = {"eslint_d"},
|
||||||
|
|
|
||||||
94
lua/plugins/lsp.lua
Normal file
94
lua/plugins/lsp.lua
Normal file
|
|
@ -0,0 +1,94 @@
|
||||||
|
local M = {
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
dependencies = {
|
||||||
|
{
|
||||||
|
"folke/lazydev.nvim",
|
||||||
|
ft = "lua",
|
||||||
|
opts = {
|
||||||
|
library = {
|
||||||
|
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"j-hui/fidget.nvim",
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ray-x/go.nvim",
|
||||||
|
ft = "go",
|
||||||
|
config = function(_, opts)
|
||||||
|
require("go").setup(opts)
|
||||||
|
vim.keymap.set("n", "<leader>gmt", ":GoModTidy<cr>", {
|
||||||
|
desc = "[Go] Tidy",
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
build = function()
|
||||||
|
vim.cmd([[silent! GoModTidy]])
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
function M.config()
|
||||||
|
local lspconfig = require("lspconfig")
|
||||||
|
|
||||||
|
vim.lsp.enable({ "tsgo" })
|
||||||
|
|
||||||
|
local servers = {
|
||||||
|
"gopls",
|
||||||
|
"jsonls",
|
||||||
|
"clangd",
|
||||||
|
"lua_ls",
|
||||||
|
"yamlls",
|
||||||
|
"graphql",
|
||||||
|
"html",
|
||||||
|
"cssls",
|
||||||
|
"omnisharp",
|
||||||
|
"svelte",
|
||||||
|
"templ",
|
||||||
|
"tinymist",
|
||||||
|
"jdtls",
|
||||||
|
"nixd",
|
||||||
|
"qmlls",
|
||||||
|
"zls",
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, server in ipairs(servers) do
|
||||||
|
lspconfig[server].setup({})
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("LspAttach", {
|
||||||
|
group = vim.api.nvim_create_augroup("lsp", { clear = true }),
|
||||||
|
callback = function(ev)
|
||||||
|
local opts = { buffer = ev.buf, silent = true }
|
||||||
|
local client = vim.lsp.get_client_by_id(ev.data.client_id)
|
||||||
|
|
||||||
|
nmap("K", vim.lsp.buf.hover, vim.tbl_extend("force", opts, { desc = "Hover Doc" }))
|
||||||
|
nmap("<C-h>", vim.lsp.buf.signature_help, vim.tbl_extend("force", opts, { desc = "Signature Help" }))
|
||||||
|
nmap("<leader>r", vim.lsp.buf.rename, vim.tbl_extend("force", opts, { desc = "Rename" }))
|
||||||
|
nmap("<leader>ca", vim.lsp.buf.code_action, vim.tbl_extend("force", opts, { desc = "Code Action" }))
|
||||||
|
nmap("vd", vim.diagnostic.open_float, vim.tbl_extend("force", opts, { desc = "View Diagnostics" }))
|
||||||
|
nmap("<leader>lr", "<cmd>LspRestart<CR>", vim.tbl_extend("force", opts, { desc = "Restart LSP" }))
|
||||||
|
|
||||||
|
if client and client.server_capabilities.documentHighlightProvider then
|
||||||
|
local hl_group = vim.api.nvim_create_augroup("lsp_document_highlight_" .. ev.buf, { clear = true })
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
|
||||||
|
group = hl_group,
|
||||||
|
buffer = ev.buf,
|
||||||
|
callback = vim.lsp.buf.document_highlight,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, {
|
||||||
|
group = hl_group,
|
||||||
|
buffer = ev.buf,
|
||||||
|
callback = vim.lsp.buf.clear_references,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
|
--
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
return {
|
|
||||||
"ray-x/go.nvim",
|
|
||||||
ft = "go",
|
|
||||||
config = function(_, opts)
|
|
||||||
require("go").setup(opts)
|
|
||||||
vim.keymap.set("n", "<leader>gmt", ":GoModTidy<cr>", {
|
|
||||||
desc = "[Go] Tidy",
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
build = function()
|
|
||||||
vim.cmd([[silent! GoModTidy]])
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
return {
|
|
||||||
"folke/lazydev.nvim",
|
|
||||||
ft = "lua",
|
|
||||||
opts = {
|
|
||||||
library = {
|
|
||||||
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
@ -1,186 +0,0 @@
|
||||||
return {
|
|
||||||
"neovim/nvim-lspconfig",
|
|
||||||
dependencies = {
|
|
||||||
require("plugins.lsp.extras.lazydev"),
|
|
||||||
require("plugins.lsp.extras.gopher"),
|
|
||||||
"j-hui/fidget.nvim",
|
|
||||||
"ibhagwan/fzf-lua",
|
|
||||||
},
|
|
||||||
|
|
||||||
config = function()
|
|
||||||
require("fidget").setup({})
|
|
||||||
|
|
||||||
-- Enhance floating preview windows
|
|
||||||
local orig_util_open_floating_preview = vim.lsp.util.open_floating_preview
|
|
||||||
function vim.lsp.util.open_floating_preview(contents, syntax, opts, ...)
|
|
||||||
opts = opts or {}
|
|
||||||
opts.border = opts.border or "rounded"
|
|
||||||
opts.max_width = opts.max_width or 80
|
|
||||||
opts.max_height = opts.max_height or 20
|
|
||||||
return orig_util_open_floating_preview(contents, syntax, opts, ...)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Diagnostics configuration
|
|
||||||
vim.diagnostic.config({
|
|
||||||
virtual_text = { spacing = 2, source = "if_many" },
|
|
||||||
float = { border = "rounded", source = "if_many" },
|
|
||||||
signs = vim.g.have_nerd_font and {
|
|
||||||
text = {
|
|
||||||
[vim.diagnostic.severity.ERROR] = "",
|
|
||||||
[vim.diagnostic.severity.WARN] = "",
|
|
||||||
[vim.diagnostic.severity.INFO] = "",
|
|
||||||
[vim.diagnostic.severity.HINT] = "",
|
|
||||||
},
|
|
||||||
} or true,
|
|
||||||
underline = true,
|
|
||||||
update_in_insert = true,
|
|
||||||
severity_sort = true,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Global floating options
|
|
||||||
_G.floating_options = {
|
|
||||||
focusable = true,
|
|
||||||
focus = false,
|
|
||||||
max_height = 50,
|
|
||||||
max_width = 100,
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Auto-format on save
|
|
||||||
-- vim.api.nvim_create_autocmd("BufWritePre", {
|
|
||||||
-- callback = function()
|
|
||||||
-- if vim.lsp.buf_is_attached() then
|
|
||||||
-- vim.lsp.buf.format()
|
|
||||||
-- end
|
|
||||||
-- end,
|
|
||||||
-- })
|
|
||||||
|
|
||||||
-- Filter out unwanted code actions
|
|
||||||
vim.lsp.buf.code_action = (function(orig)
|
|
||||||
return function(opts)
|
|
||||||
opts = opts or {}
|
|
||||||
opts.filter = function(action)
|
|
||||||
if not action then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
-- Ignore gopls "Browse" actions
|
|
||||||
if action.title and action.title:match("Browse gopls") then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
return orig(opts)
|
|
||||||
end
|
|
||||||
end)(vim.lsp.buf.code_action)
|
|
||||||
|
|
||||||
-- Keymaps setup function
|
|
||||||
local function setup_keymaps(bufnr)
|
|
||||||
local fzf = require("fzf-lua")
|
|
||||||
local opts = { buffer = bufnr }
|
|
||||||
|
|
||||||
-- Helper function for mapping
|
|
||||||
local function nmap(key, func, desc_opts)
|
|
||||||
vim.keymap.set("n", key, func, desc_opts)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Basic LSP
|
|
||||||
nmap("K", vim.lsp.buf.hover, vim.tbl_extend("force", opts, { desc = "Hover Doc" }))
|
|
||||||
nmap("<C-h>", vim.lsp.buf.signature_help, vim.tbl_extend("force", opts, { desc = "Signature Help" }))
|
|
||||||
nmap("<leader>r", vim.lsp.buf.rename, vim.tbl_extend("force", opts, { desc = "Rename" }))
|
|
||||||
nmap("<leader>ca", vim.lsp.buf.code_action, vim.tbl_extend("force", opts, { desc = "Code Action" }))
|
|
||||||
|
|
||||||
-- Navigation
|
|
||||||
nmap("gd", fzf.lsp_definitions, vim.tbl_extend("force", opts, { desc = "Go to Definition" }))
|
|
||||||
nmap("gr", fzf.lsp_references, vim.tbl_extend("force", opts, { desc = "Go to References" }))
|
|
||||||
nmap("gD", vim.lsp.buf.declaration, vim.tbl_extend("force", opts, { desc = "Go to Declaration" }))
|
|
||||||
nmap("gi", fzf.lsp_implementations, vim.tbl_extend("force", opts, { desc = "Go to Implementation" }))
|
|
||||||
nmap("gt", fzf.lsp_typedefs, vim.tbl_extend("force", opts, { desc = "Go to Type Definition" }))
|
|
||||||
|
|
||||||
-- Diagnostics
|
|
||||||
nmap("vd", vim.diagnostic.open_float, vim.tbl_extend("force", opts, { desc = "View Diagnostics" }))
|
|
||||||
nmap("<leader>dl", fzf.diagnostics_document, vim.tbl_extend("force", opts, { desc = "Document Diagnostics" }))
|
|
||||||
nmap("<leader>dw", fzf.diagnostics_workspace, vim.tbl_extend("force", opts, { desc = "Workspace Diagnostics" }))
|
|
||||||
nmap("<leader>ds", fzf.lsp_document_symbols, vim.tbl_extend("force", opts, { desc = "Document Symbols" }))
|
|
||||||
nmap("<leader>ws", fzf.lsp_workspace_symbols, vim.tbl_extend("force", opts, { desc = "Workspace Symbols" }))
|
|
||||||
|
|
||||||
-- LSP management
|
|
||||||
nmap("<leader>lr", function()
|
|
||||||
local clients = vim.lsp.get_clients({ bufnr = bufnr })
|
|
||||||
if #clients == 0 then
|
|
||||||
vim.notify("No LSP clients attached to buffer", vim.log.levels.WARN)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local client_names = {}
|
|
||||||
for _, client in ipairs(clients) do
|
|
||||||
table.insert(client_names, client.name)
|
|
||||||
vim.cmd("LspRestart " .. client.name)
|
|
||||||
end
|
|
||||||
vim.notify("Restarted LSP clients: " .. table.concat(client_names, ", "), vim.log.levels.INFO)
|
|
||||||
end, vim.tbl_extend("force", opts, { desc = "Restart LSP" }))
|
|
||||||
nmap("<leader>li", ":LspInfo<CR>", vim.tbl_extend("force", opts, { desc = "LSP Info" }))
|
|
||||||
end
|
|
||||||
|
|
||||||
local lspconfig = require("lspconfig")
|
|
||||||
|
|
||||||
-- Lista de servidores LSP a habilitar
|
|
||||||
local servers = {
|
|
||||||
"gopls",
|
|
||||||
"jsonls",
|
|
||||||
"clangd",
|
|
||||||
"lua_ls",
|
|
||||||
"yamlls",
|
|
||||||
"graphql",
|
|
||||||
"html",
|
|
||||||
"cssls",
|
|
||||||
"omnisharp",
|
|
||||||
"svelte",
|
|
||||||
"templ",
|
|
||||||
"tinymist",
|
|
||||||
"jdtls",
|
|
||||||
-- "ts_ls",
|
|
||||||
"nixd",
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Setup automático - Neovim 11 carga las configs automáticamente
|
|
||||||
for _, server in ipairs(servers) do
|
|
||||||
lspconfig[server].setup({})
|
|
||||||
end
|
|
||||||
|
|
||||||
-- LSP Attach autocmd
|
|
||||||
vim.api.nvim_create_autocmd("LspAttach", {
|
|
||||||
group = vim.api.nvim_create_augroup("UserLspConfig", { clear = true }),
|
|
||||||
callback = function(args)
|
|
||||||
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
|
||||||
if not client then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Setup keymaps
|
|
||||||
setup_keymaps(args.buf)
|
|
||||||
|
|
||||||
-- Inlay hints
|
|
||||||
if client.supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint, args.buf) then
|
|
||||||
vim.keymap.set("n", "<leader>th", function()
|
|
||||||
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ bufnr = args.buf }), { bufnr = args.buf })
|
|
||||||
end, { buffer = args.buf, desc = "Toggle Inlay Hints" })
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Document highlights
|
|
||||||
if client.server_capabilities.documentHighlightProvider then
|
|
||||||
vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
|
|
||||||
buffer = args.buf,
|
|
||||||
callback = vim.lsp.buf.document_highlight,
|
|
||||||
})
|
|
||||||
vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, {
|
|
||||||
buffer = args.buf,
|
|
||||||
callback = vim.lsp.buf.clear_references,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.lsp.enable({
|
|
||||||
"tsgo",
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
|
|
@ -17,18 +17,6 @@ local M = {
|
||||||
require("mini.ai").setup({ n_lines = 500 })
|
require("mini.ai").setup({ n_lines = 500 })
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"echasnovski/mini.surround",
|
|
||||||
config = function()
|
|
||||||
-- Add/delete/replace surroundings (brackets, quotes, etc.)
|
|
||||||
--
|
|
||||||
-- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren
|
|
||||||
-- - sd' - [S]urround [D]elete [']quotes
|
|
||||||
-- - sr)' - [S]urround [R]eplace [)] [']
|
|
||||||
require("mini.surround").setup({})
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
{
|
||||||
"echasnovski/mini.statusline",
|
"echasnovski/mini.statusline",
|
||||||
version = false,
|
version = false,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue