nvim/ftplugin/yaml.lua
Jeremie Fraeys 02e26b00b7
Some checks are pending
Check Lua Formatting in MyRepo / Stylua Check (push) Waiting to run
chore(nvim): reinitialize with working config
2026-02-07 21:06:45 -05:00

17 lines
451 B
Lua

-- Set indentation for YAML files
vim.bo.shiftwidth = 2
vim.bo.tabstop = 2
vim.bo.expandtab = true
-- Set text width to 80 to auto-break lines when formatting
vim.bo.textwidth = 80
vim.api.nvim_create_autocmd('BufWritePre', {
buffer = 0,
callback = function()
local first_line = vim.api.nvim_buf_get_lines(0, 0, 1, false)[1] or ''
if first_line ~= '---' then
vim.api.nvim_buf_set_lines(0, 0, 0, false, { '---' })
end
end,
})