]> git.rmz.io Git - dotfiles.git/blob - nvim/lua/plugins/lang/json.lua
lazyvim: absorb all langs
[dotfiles.git] / nvim / lua / plugins / lang / json.lua
1 return {
2 -- add json to treesitter
3 {
4 "nvim-treesitter/nvim-treesitter",
5 opts = { ensure_installed = { "json5" } },
6 },
7
8 -- yaml schema support
9 {
10 "b0o/SchemaStore.nvim",
11 lazy = true,
12 version = false, -- last release is way too old
13 },
14
15 -- correctly setup lspconfig
16 {
17 "neovim/nvim-lspconfig",
18 opts = {
19 -- make sure mason installs the server
20 servers = {
21 jsonls = {
22 -- lazy-load schemastore when needed
23 on_new_config = function(new_config)
24 new_config.settings.json.schemas = new_config.settings.json.schemas or {}
25 vim.list_extend(new_config.settings.json.schemas, require("schemastore").json.schemas())
26 end,
27 settings = {
28 json = {
29 format = {
30 enable = true,
31 },
32 validate = { enable = true },
33 },
34 },
35 },
36 },
37 },
38 },
39 }