JSON
info
You can enable the extra with the :LazyExtras
command.
Plugins marked as optional will only be configured if they are installed.
Alternatively, you can add it to your lazy.nvim
imports
Below you can find a list of included plugins and their default settings.
caution
You don't need to copy the default settings to your config. They are only shown here for reference.
nvim-treesitter
add json to treesitter
- Options
- Full Spec
opts = { ensure_installed = { "json5" } }
SchemaStore.nvim
yaml schema support
- Options
- Full Spec
opts = nil
nvim-lspconfig
correctly setup lspconfig
- Options
- Full Spec
opts = {
-- make sure mason installs the server
servers = {
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 },
},
},
},
},
}