+35
-3
@@ -1,5 +1,3 @@
|
||||
local lsp = require("lsp")
|
||||
|
||||
local lua_library_paths = { vim.env.VIMRUNTIME }
|
||||
vim.list_extend(lua_library_paths, require("pack").get_paths())
|
||||
|
||||
@@ -32,5 +30,39 @@ return {
|
||||
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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user