๐Ÿ’ YAML toolkit for Neovim users

Update README.md

Formatted tabs in code blocks to be consistent with style previously used in README. Added guide for resolving treesitter error.

authored by

Tyrel and committed by
GitHub
0df9c7f1 615985c1

+33 -10
+33 -10
README.md
··· 46 } 47 ``` 48 49 ### With [`packer.nvim`](https://github.com/wbthomason/packer.nvim): 50 51 ```lua ··· 85 86 ```lua 87 vim.api.nvim_create_autocmd({ "BufEnter", "CursorMoved" }, { 88 - pattern = { "*.yaml" }, 89 - callback = function() 90 - vim.opt_local.winbar = require("yaml_nvim").get_yaml_key_and_value() 91 - end, 92 }) 93 ``` 94 95 - You can also call `get_yaml_key()` instead of `get_yaml_key_and_value()` to show only the YAML key. 96 97 #### Neovim's statusline (with [`lualine.nvim`](https://github.com/nvim-lualine/lualine.nvim)) 98 99 ```lua 100 require("lualine").setup({ 101 - sections = { 102 - lualine_x = { require("yaml_nvim").get_yaml_key_and_value }, 103 - -- etc 104 - } 105 }) 106 - 107 ``` 108 109 ## Reporting bugs and contributing
··· 46 } 47 ``` 48 49 + <details> 50 + <summary>If you get a <code>no parser for 'yaml' language</code> error message when calling <code>:YAMLTelescope</code></summary> 51 + 52 + This means that you need to install a parser such as [<code>tree-sitter-yaml</code>](https://github.com/ikatyang/tree-sitter-yaml). 53 + 54 + Then you need to enable it in your nvim config. Here is an example. 55 + 56 + ```lua 57 + { 58 + "nvim-treesitter/nvim-treesitter", 59 + build = ":TSUpdate", 60 + config = function() 61 + require("nvim-treesitter.configs").setup({ 62 + ensure_installed = { "yaml" }, 63 + highlight = { 64 + enable = true, 65 + disable = {}, 66 + }, 67 + }) 68 + end, 69 + } 70 + ``` 71 + </details> 72 + 73 ### With [`packer.nvim`](https://github.com/wbthomason/packer.nvim): 74 75 ```lua ··· 109 110 ```lua 111 vim.api.nvim_create_autocmd({ "BufEnter", "CursorMoved" }, { 112 + pattern = { "*.yaml" }, 113 + callback = function() 114 + vim.opt_local.winbar = require("yaml_nvim").get_yaml_key_and_value() 115 + end, 116 }) 117 ``` 118 119 + You can also call `get_yaml_key()` instead of `get_yaml_key_and_value()` to show only the YAML key. 120 121 #### Neovim's statusline (with [`lualine.nvim`](https://github.com/nvim-lualine/lualine.nvim)) 122 123 ```lua 124 require("lualine").setup({ 125 + sections = { 126 + lualine_x = { require("yaml_nvim").get_yaml_key_and_value }, 127 + -- etc 128 + } 129 }) 130 ``` 131 132 ## Reporting bugs and contributing