Created
December 24, 2025 13:15
-
-
Save fionn/4e5e7800879365536965fa6453604976 to your computer and use it in GitHub Desktop.
YAML indent guides in Neovim
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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