exp: Testing out yaml-companion plugin, moving nvim-lint to being on a

hotkey rather than on bufread and bufwrite
This commit is contained in:
2026-04-21 09:05:45 -05:00
parent 1d6b711561
commit 5426461dea
5 changed files with 45 additions and 15 deletions

View File

@@ -1,9 +1,15 @@
return {
settings = {
redhat = {
telemetry = {
enabled = false
}
},
yaml = {
-- schemaStore = {
-- enable = true
-- },
validate = true,
schemaStore = {
enable = true
},
format = {
enable = true,
singleQuote = true

View File

@@ -35,4 +35,6 @@ require('lazy').setup({
require('plugins.render-markdown'), -- Render markdown directly in nvim (experimental, may take over for markdown-preview)
require('plugins.autopairs'), -- Autocomplete symbol pairs when typing (experimental)
require('plugins.twilight'), -- Focus mode, dim lines around the current segment of code
require('plugins.yaml-companion'), -- Additional YAML and JSON schema helper
-- require('plugins.schemastore'), -- Loads YAML and JSON schemas for autocompletion
})

View File

@@ -1,14 +1,15 @@
local function get_schema()
local schema = require('yaml-companion').get_buf_schema(0)
if schema.result[1].name == 'none' then
return ''
end
return schema.result[1].name
end
return {
'nvim-lualine/lualine.nvim',
config = function()
require('lualine').setup {
-- options = {
-- component_separators = { left = '\\', right = '/' },
-- component_separators = { left = '', right = '' },
-- section_separators = { left = '', right = '' },
-- globalstatus = true,
-- theme = 'gruvbox',
-- },
tabline = {
lualine_a = {
'tabs',
@@ -16,6 +17,11 @@ return {
lualine_z = {
'buffers',
}
},
sections = {
lualine_x = {
'encoding', 'fileformat', 'filetype', get_schema
},
}
}
end,

View File

@@ -5,10 +5,18 @@ return {
yaml = { 'cfn_lint' }
}
vim.api.nvim_create_autocmd({ 'BufWritePost', 'BufReadPost' }, {
callback = function()
require('lint').try_lint()
end,
})
-- vim.api.nvim_create_autocmd({ 'BufWritePost', 'BufReadPost' }, {
-- callback = function()
-- require('lint').try_lint()
-- end,
-- })
end,
keys = {
{
';l',
function()
require('lint').try_lint()
end
},
},
}

View File

@@ -0,0 +1,8 @@
return {
'mosheavni/yaml-companion.nvim',
config = function(_, opts)
local cfg = require('yaml-companion').setup(opts)
vim.lsp.config('yamlls', cfg)
vim.lsp.enable('yamlls')
end,
}