๐Ÿ’ 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 46 } 47 47 ``` 48 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 + 49 73 ### With [`packer.nvim`](https://github.com/wbthomason/packer.nvim): 50 74 51 75 ```lua ··· 85 109 86 110 ```lua 87 111 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, 112 + pattern = { "*.yaml" }, 113 + callback = function() 114 + vim.opt_local.winbar = require("yaml_nvim").get_yaml_key_and_value() 115 + end, 92 116 }) 93 117 ``` 94 118 95 - You can also call `get_yaml_key()` instead of `get_yaml_key_and_value()` to show only the YAML key. 119 + You can also call `get_yaml_key()` instead of `get_yaml_key_and_value()` to show only the YAML key. 96 120 97 121 #### Neovim's statusline (with [`lualine.nvim`](https://github.com/nvim-lualine/lualine.nvim)) 98 122 99 123 ```lua 100 124 require("lualine").setup({ 101 - sections = { 102 - lualine_x = { require("yaml_nvim").get_yaml_key_and_value }, 103 - -- etc 104 - } 125 + sections = { 126 + lualine_x = { require("yaml_nvim").get_yaml_key_and_value }, 127 + -- etc 128 + } 105 129 }) 106 - 107 130 ``` 108 131 109 132 ## Reporting bugs and contributing