more formatting and lsp foo
This commit is contained in:
parent
429b20293a
commit
6d11664e7b
3 changed files with 61 additions and 0 deletions
|
@ -16,6 +16,9 @@
|
||||||
cargo
|
cargo
|
||||||
rust-analyzer
|
rust-analyzer
|
||||||
rustfmt
|
rustfmt
|
||||||
|
# misc
|
||||||
|
nodePackages.prettier
|
||||||
|
marksman
|
||||||
];
|
];
|
||||||
|
|
||||||
plugins = with pkgs.vimPlugins; [
|
plugins = with pkgs.vimPlugins; [
|
||||||
|
|
25
users/common/nvim/lua/plugins/conform.lua
Normal file
25
users/common/nvim/lua/plugins/conform.lua
Normal 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" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
|
@ -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",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue