๐Ÿ’ YAML toolkit for Neovim users

Adds example for non-named buffer

Thanks @treatmesubj : )

Also, see #33

+27
+27
README.md
··· 118 118 119 119 You can also call `get_yaml_key()` instead of `get_yaml_key_and_value()` to show only the YAML key. 120 120 121 + <details> 122 + 123 + <summary>For non-named buffers</summary> 124 + 125 + See #33, for example: 126 + 127 + ```lua 128 + vim.api.nvim_create_autocmd({ "BufEnter", "FileType" }, { 129 + group = vim.api.nvim_create_augroup("bufent_winbar", { clear = true }), 130 + callback = function(opts) 131 + if vim.bo[opts.buf].filetype == "yaml" then 132 + vim.api.nvim_create_autocmd({ "CursorMoved" }, { 133 + group = vim.api.nvim_create_augroup("curs_winbar", { clear = true }), 134 + callback = function() 135 + vim.opt_local.winbar = require("yaml_nvim").get_yaml_key_and_value() 136 + end, 137 + }) 138 + else 139 + vim.opt_local.winbar = "" 140 + vim.api.nvim_create_augroup("curs_winbar", { clear = true }) 141 + end 142 + end, 143 + }) 144 + ``` 145 + 146 + </details> 147 + 121 148 #### Neovim's statusline (with [`lualine.nvim`](https://github.com/nvim-lualine/lualine.nvim)) 122 149 123 150 ```lua