60 lines
1.2 KiB
Lua
60 lines
1.2 KiB
Lua
local ok, lspconfig, conform, lint = pcall(function()
|
|
return
|
|
require("lspconfig"),
|
|
require("conform"),
|
|
require("lint")
|
|
end)
|
|
|
|
if not ok then
|
|
return
|
|
end
|
|
|
|
lspconfig.nixd.setup({
|
|
-- capabilities = cmp_nvim_lsp.default_capabilities()
|
|
capabilities = require("config/lsp/lsp-capabilities"),
|
|
on_attach = require("config/lsp/lsp-attach"),
|
|
settings = {
|
|
nixd = {
|
|
nixpkgs = {
|
|
expr = "import <nixpkgs> { }",
|
|
},
|
|
-- formatting = {
|
|
-- command = { "nixfmt" },
|
|
-- },
|
|
},
|
|
},
|
|
})
|
|
|
|
-- conform.setup({
|
|
-- formatters_by_ft = {
|
|
-- nix = { "nixfmt" },
|
|
-- },
|
|
-- format_on_save = {
|
|
-- async = false,
|
|
-- timeout_ms = 500,
|
|
-- lsp_format = "fallback",
|
|
-- },
|
|
-- })
|
|
--
|
|
-- vim.keymap.set({ "n", "v" }, "<leader>lf", function()
|
|
-- conform.format({
|
|
-- async = false,
|
|
-- timeout_ms = 500,
|
|
-- lsp_format = "fallback",
|
|
-- })
|
|
-- end, { desc = "Format" })
|
|
|
|
-- lint.linters_by_ft = {
|
|
-- lua = { "luacheck" },
|
|
-- }
|
|
--
|
|
-- vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
|
-- callback = function()
|
|
-- lint.try_lint()
|
|
-- end,
|
|
-- })
|
|
--
|
|
-- vim.keymap.set("n", "<leader>ll", function()
|
|
-- lint.try_lint()
|
|
-- end, { desc = "Lint" })
|