···4646}
4747```
48484949+<details>
5050+5151+<summary>If you get a <code>no parser for 'yaml' language</code> error message</summary>
5252+5353+This means that you need to install a parser such as [`tree-sitter-yaml`](https://github.com/ikatyang/tree-sitter-yaml).
5454+5555+Then you need to enable it in your nvim config. Here is an example.
5656+5757+```lua
5858+{
5959+ "nvim-treesitter/nvim-treesitter",
6060+ build = ":TSUpdate",
6161+ config = function()
6262+ require("nvim-treesitter.configs").setup({
6363+ ensure_installed = { "yaml" },
6464+ },
6565+ })
6666+ end,
6767+}
6868+</details>
6969+4970### With [`packer.nvim`](https://github.com/wbthomason/packer.nvim):
50715172```lua
···8510686107```lua
87108vim.api.nvim_create_autocmd({ "BufEnter", "CursorMoved" }, {
8888- pattern = { "*.yaml" },
8989- callback = function()
9090- vim.opt_local.winbar = require("yaml_nvim").get_yaml_key_and_value()
9191- end,
109109+ pattern = { "*.yaml" },
110110+ callback = function()
111111+ vim.opt_local.winbar = require("yaml_nvim").get_yaml_key_and_value()
112112+ end,
92113})
93114```
941159595- You can also call `get_yaml_key()` instead of `get_yaml_key_and_value()` to show only the YAML key.
116116+You can also call `get_yaml_key()` instead of `get_yaml_key_and_value()` to show only the YAML key.
9611797118#### Neovim's statusline (with [`lualine.nvim`](https://github.com/nvim-lualine/lualine.nvim))
9811999120```lua
100121require("lualine").setup({
101101- sections = {
102102- lualine_x = { require("yaml_nvim").get_yaml_key_and_value },
103103- -- etc
104104- }
122122+ sections = {
123123+ lualine_x = { require("yaml_nvim").get_yaml_key_and_value },
124124+ -- etc
125125+ }
105126})
106106-107127```
108128109129## Reporting bugs and contributing