add yaml lsp

This commit is contained in:
newbie 2023-12-19 12:08:06 +08:00
parent 6b8fec654c
commit 90c900c602
3 changed files with 16 additions and 13 deletions

View File

@ -0,0 +1,12 @@
return {
capabilities = require('cmp_nvim_lsp').default_capabilities(),
settings = {
yaml = {
schemas = {
["https://json.schemastore.org/github-workflow.json"] = "/.github/workflows/*",
["../path/relative/to/file.yml"] = "/.github/workflows/*",
["/path/from/root/of/project"] = "/.github/workflows/*",
},
},
}
}

View File

@ -46,8 +46,9 @@ return {
require 'lspconfig'.clangd.setup(require('lsp.c')) require 'lspconfig'.clangd.setup(require('lsp.c'))
require 'lspconfig'.bashls.setup(require('lsp.bash')) require 'lspconfig'.bashls.setup(require('lsp.bash'))
require 'lspconfig'.pyright.setup(require('lsp.pyright')) require 'lspconfig'.pyright.setup(require('lsp.pyright'))
require 'lspconfig'.jsonls.setup({}) require 'lspconfig'.jsonls.setup {}
require('lspconfig').yamlls.setup(require("lsp.yaml")) require 'lspconfig'.yamlls.setup(require('lsp.yaml'))
G.map({ G.map({
{ 'n', '<leader>rn', '<cmd>lua vim.lsp.buf.rename()<CR>' }, { 'n', '<leader>rn', '<cmd>lua vim.lsp.buf.rename()<CR>' },
@ -60,6 +61,7 @@ return {
{ 'n', '<cs-i>', '<cmd>lua vim.lsp.buf.format()<CR>' }, { 'n', '<cs-i>', '<cmd>lua vim.lsp.buf.format()<CR>' },
}) })
end end
}, },

View File

@ -1,11 +0,0 @@
return {
settings = {
yaml = {
schemas = {
["https://json.schemastore.org/github-workflow.json"] = "/.github/workflows/*",
["../path/relative/to/file.yml"] = "/.github/workflows/*",
["/path/from/root/of/project"] = "/.github/workflows/*",
},
},
}
}