Some checks are pending
Check Lua Formatting in MyRepo / Stylua Check (push) Waiting to run
17 lines
451 B
Lua
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,
|
|
})
|