๐Ÿ’ YAML toolkit for Neovim users

Merge pull request #31 from tyrelcameron-dgit/patch-1

Update README.md

authored by

Eduardo Cuducos and committed by
GitHub
d51b6c3d 615985c1

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