more formatting and lsp foo

This commit is contained in:
CherryKitten 2024-03-26 13:04:17 +01:00
parent 429b20293a
commit 6d11664e7b
Signed by: sammy
GPG key ID: 98D8F75FB0658276
3 changed files with 61 additions and 0 deletions

View file

@ -16,6 +16,9 @@
cargo
rust-analyzer
rustfmt
# misc
nodePackages.prettier
marksman
];
plugins = with pkgs.vimPlugins; [

View file

@ -0,0 +1,25 @@
return {
"stevearc/conform.nvim",
optional = true,
opts = {
formatters_by_ft = {
["javascript"] = { "prettier" },
["javascriptreact"] = { "prettier" },
["typescript"] = { "prettier" },
["typescriptreact"] = { "prettier" },
["vue"] = { "prettier" },
["css"] = { "prettier" },
["scss"] = { "prettier" },
["less"] = { "prettier" },
["html"] = { "prettier" },
["json"] = { "prettier" },
["jsonc"] = { "prettier" },
["yaml"] = { "prettier" },
["markdown"] = { "prettier" },
["markdown.mdx"] = { "prettier" },
["graphql"] = { "prettier" },
["handlebars"] = { "prettier" },
["python"] = { "black" },
},
},
}

View file

@ -36,6 +36,39 @@ return {
},
},
},
jsonls = {
-- lazy-load schemastore when needed
on_new_config = function(new_config)
new_config.settings.json.schemas = new_config.settings.json.schemas or {}
vim.list_extend(new_config.settings.json.schemas, require("schemastore").json.schemas())
end,
settings = {
json = {
format = {
enable = true,
},
validate = { enable = true },
},
},
},
marksman = {},
ruff_lsp = {
keys = {
{
"<leader>co",
function()
vim.lsp.buf.code_action({
apply = true,
context = {
only = { "source.organizeImports" },
diagnostics = {},
},
})
end,
desc = "Organize Imports",
},
},
},
},
},
},