Skip to content

Instantly share code, notes, and snippets.

@fionn
Created December 24, 2025 13:15
Show Gist options
  • Select an option

  • Save fionn/4e5e7800879365536965fa6453604976 to your computer and use it in GitHub Desktop.

Select an option

Save fionn/4e5e7800879365536965fa6453604976 to your computer and use it in GitHub Desktop.
YAML indent guides in Neovim
vim.api.nvim_create_autocmd("FileType", {
desc = "Meta-level YAML indent guides",
pattern = "yaml",
group = vim.api.nvim_create_augroup("indent_guides", {clear = true}),
callback = function()
vim.api.nvim_create_autocmd('BufWinEnter', {
group = "indent_guides",
callback = function(args)
local char = "▏" .. (" "):rep(vim.bo[args.buf].shiftwidth - 1)
vim.opt_local.listchars:append({ leadmultispace = char })
end
})
end
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment