+35
-3
@@ -1,5 +1,3 @@
|
|||||||
local lsp = require("lsp")
|
|
||||||
|
|
||||||
local lua_library_paths = { vim.env.VIMRUNTIME }
|
local lua_library_paths = { vim.env.VIMRUNTIME }
|
||||||
vim.list_extend(lua_library_paths, require("pack").get_paths())
|
vim.list_extend(lua_library_paths, require("pack").get_paths())
|
||||||
|
|
||||||
@@ -32,5 +30,39 @@ return {
|
|||||||
telemetry = { enable = false },
|
telemetry = { enable = false },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
on_attach = lsp.on_attach,
|
on_attach = function(client, bufnr)
|
||||||
|
require("lsp").on_attach(client, bufnr)
|
||||||
|
local util = require("util")
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<leader>lf", function()
|
||||||
|
util.format({
|
||||||
|
buf = bufnr,
|
||||||
|
cmd = {
|
||||||
|
"stylua",
|
||||||
|
"--stdin-filepath",
|
||||||
|
"%file%",
|
||||||
|
"-",
|
||||||
|
},
|
||||||
|
output = "stdout",
|
||||||
|
auto_indent = true,
|
||||||
|
})
|
||||||
|
end, { buffer = bufnr })
|
||||||
|
|
||||||
|
vim.keymap.set("x", "<leader>lf", function()
|
||||||
|
util.format({
|
||||||
|
buf = bufnr,
|
||||||
|
cmd = {
|
||||||
|
"stylua",
|
||||||
|
"--range-start",
|
||||||
|
"%byte_start%",
|
||||||
|
"--range-end",
|
||||||
|
"%byte_end%",
|
||||||
|
"--stdin-filepath",
|
||||||
|
"%file%",
|
||||||
|
"-",
|
||||||
|
},
|
||||||
|
output = "stdout",
|
||||||
|
})
|
||||||
|
end, { buffer = bufnr })
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,10 @@ require("mason-auto-install").setup({
|
|||||||
"lemminx",
|
"lemminx",
|
||||||
dependencies = { "xmlformatter" },
|
dependencies = { "xmlformatter" },
|
||||||
},
|
},
|
||||||
|
{
|
||||||
"lua-language-server",
|
"lua-language-server",
|
||||||
|
dependencies = { "stylua" },
|
||||||
|
},
|
||||||
"mesonlsp",
|
"mesonlsp",
|
||||||
"oxfmt",
|
"oxfmt",
|
||||||
"oxlint",
|
"oxlint",
|
||||||
|
|||||||
Reference in New Issue
Block a user