···1111| `:YAMLYankKey [register]` | `yaml.yank_key([register])` | Yanks the full path of the key for the current key/value pair. The default register is the unnamed one (`"`) |
1212| `:YAMLYankValue [register]` | `yaml.yank_value([register])` | Yanks the value of the current key/value pair. The default register is the unnamed one (`"`) |
1313| `:YAMLQuickfix` | `yaml.quickfix()` | Generates a quickfix with key/value pairs |
1414+| `:YAMLSnacks` | `yaml.snacks()` | Full path key/value fuzzy finder via [Snacks](https://github.com/folke/snacks.nvim) **if installed** |
1415| `:YAMLTelescope` | `yaml.telescope()` | Full path key/value fuzzy finder via [Telescope](https://github.com/nvim-telescope/telescope.nvim) **if installed** |
15161617
···2021* **Neovim 0.9** or newer
2122* [`nvim-treesitter`](https://github.com/nvim-treesitter/nvim-treesitter) with [YAML support](https://github.com/ikatyang/tree-sitter-yaml)
22232323-Telescope is **optional**.
2424+Snacks and Telescope are **optional**.
24252526<details>
2627···4142 ft = { "yaml" }, -- optional
4243 dependencies = {
4344 "nvim-treesitter/nvim-treesitter",
4545+ "folke/snacks.nvim", -- optional
4446 "nvim-telescope/telescope.nvim", -- optional
4547 },
4648}
4749```
48504949-5051### With [`packer.nvim`](https://github.com/wbthomason/packer.nvim):
51525253```lua
···5556 ft = { "yaml" }, -- optional
5657 requires = {
5758 "nvim-treesitter/nvim-treesitter",
5959+ "folke/snacks.nvim", -- optional
5860 "nvim-telescope/telescope.nvim" -- optional
5961 },
6062}
···6365### With [`vim-plug`](https://github.com/junegunn/vim-plug):
64666567```viml
6868+Plug 'folke/snacks.nvim' " optional
6669Plug 'nvim-telescope/telescope.nvim' " optional
6770Plug 'nvim-treesitter/nvim-treesitter'
6871Plug 'cuducos/yaml.nvim'
+6-3
doc/help.txt
···33==============================================================================
44USAGE INSTRUCTIONS *yaml.nvim-usage*
5566-This plugins offers the following commands and, if |:telescope.nvim| is
77-available, an extension reached by `:Telescope yaml` to navigate through the
88-YAML loaded in the current buffer.
66+This plugins offers the following commands:
97108:YAMLView *:YAMLView*
119···4442 collects all nested keys and outputs them as a dot-case string (e.g.:
4543 `root.parent.child.key = value`). It uses Vim's native |:cex| function, so
4644 the cursor is positioned in the first selection of the |:quickfix|.
4545+4646+:YAMLSnacks *YAMLSnacks*
4747+4848+ Creates a |:quickfix| list as in |:YAMLQuickfix|, and loads it with
4949+ |:Snacks.picker|. Only available if |:Snacks| is installed.
47504851:YAMLTelescope *YAMLTelescope*
4952
+14
lua/yaml_nvim/init.lua
···11local has_telescope, _ = pcall(require, "telescope")
22+local has_snacks, _ = pcall(require, "snacks")
23local document = require("yaml_nvim.document")
34local pair = require("yaml_nvim.pair")
45···163164 require("telescope.builtin").quickfix()
164165end
165166167167+M.snacks = function()
168168+ if not has_snacks then
169169+ return
170170+ end
171171+172172+ M.quickfix()
173173+ require("snacks").picker.qflist()
174174+end
175175+166176-- Commands
167177168178vim.cmd("command! YAMLView lua require('yaml_nvim').view()")
···173183174184if has_telescope then
175185 vim.cmd("command! YAMLTelescope lua require('yaml_nvim').telescope()")
186186+end
187187+188188+if has_snacks then
189189+ vim.cmd("command! YAMLSnacks lua require('yaml_nvim').snacks()")
176190end
177191178192return M