mirror of
https://github.com/dcarrillo/dotfiles.git
synced 2025-07-01 19:49:25 +00:00
[neovim] Add yaml-companion module and update plugins
This commit is contained in:
@ -7,5 +7,6 @@ require("plugins.lsp.mason")
|
||||
require("plugins.lsp.handlers").setup()
|
||||
require("plugins.lsp.null-ls")
|
||||
require("plugins.lsp.lsp-saga")
|
||||
require("plugins.lsp.yaml-companion")
|
||||
|
||||
win.default_options.border = "rounded"
|
||||
|
2
.config/nvim/lua/plugins/lsp/yaml-companion.lua
Normal file
2
.config/nvim/lua/plugins/lsp/yaml-companion.lua
Normal file
@ -0,0 +1,2 @@
|
||||
local cfg = require("yaml-companion").setup({})
|
||||
require("lspconfig")["yamlls"].setup(cfg)
|
@ -26,6 +26,7 @@ local diff = {
|
||||
local filetype = {
|
||||
"filetype",
|
||||
colored = false,
|
||||
separator = "",
|
||||
}
|
||||
|
||||
local lsp_progress = {
|
||||
@ -54,6 +55,21 @@ local venv = function()
|
||||
return ""
|
||||
end
|
||||
|
||||
local get_schema = function()
|
||||
local ft = vim.bo.filetype or ""
|
||||
|
||||
if ft == "yaml" then
|
||||
local schema = require("yaml-companion").get_buf_schema(0)
|
||||
if schema.result[1].name == "none" then
|
||||
return ""
|
||||
end
|
||||
|
||||
return "(" .. schema.result[1].name .. ")"
|
||||
else
|
||||
return ""
|
||||
end
|
||||
end
|
||||
|
||||
local gitblame_status_ok, gitblame = pcall(require, "gitblame")
|
||||
if not gitblame_status_ok then
|
||||
return
|
||||
@ -77,6 +93,7 @@ lualine.setup({
|
||||
spaces,
|
||||
"encoding",
|
||||
filetype,
|
||||
{ get_schema, separator = "" },
|
||||
},
|
||||
lualine_y = { "progress" },
|
||||
lualine_z = { "location" },
|
||||
|
Reference in New Issue
Block a user