···13| `:YAMLQuickfix` | `yaml.quickfix()` | Generates a quickfix with key/value pairs |
14| `:YAMLSnacks` | `yaml.snacks()` | Full path key/value fuzzy finder via [Snacks](https://github.com/folke/snacks.nvim) **if installed** |
15| `:YAMLTelescope` | `yaml.telescope()` | Full path key/value fuzzy finder via [Telescope](https://github.com/nvim-telescope/telescope.nvim) **if installed** |
01617
18···21* **Neovim 0.9** or newer
22* [`nvim-treesitter`](https://github.com/nvim-treesitter/nvim-treesitter) with [YAML support](https://github.com/ikatyang/tree-sitter-yaml)
2324-Snacks and Telescope are **optional**.
2526<details>
27···44 "nvim-treesitter/nvim-treesitter",
45 "folke/snacks.nvim", -- optional
46 "nvim-telescope/telescope.nvim", -- optional
047 },
48}
49```
···58 "nvim-treesitter/nvim-treesitter",
59 "folke/snacks.nvim", -- optional
60 "nvim-telescope/telescope.nvim" -- optional
061 },
62}
63```
···67```viml
68Plug 'folke/snacks.nvim' " optional
69Plug 'nvim-telescope/telescope.nvim' " optional
070Plug 'nvim-treesitter/nvim-treesitter'
71Plug 'cuducos/yaml.nvim'
72```
···13| `:YAMLQuickfix` | `yaml.quickfix()` | Generates a quickfix with key/value pairs |
14| `:YAMLSnacks` | `yaml.snacks()` | Full path key/value fuzzy finder via [Snacks](https://github.com/folke/snacks.nvim) **if installed** |
15| `:YAMLTelescope` | `yaml.telescope()` | Full path key/value fuzzy finder via [Telescope](https://github.com/nvim-telescope/telescope.nvim) **if installed** |
16+| `:YAMLFzfLua` | `yaml.fzf_lua()` | Full path key/value fuzzy finder via [fzf-lua](https://github.com/ibhagwan/fzf-lua) **if installed** |
1718
19···22* **Neovim 0.9** or newer
23* [`nvim-treesitter`](https://github.com/nvim-treesitter/nvim-treesitter) with [YAML support](https://github.com/ikatyang/tree-sitter-yaml)
2425+Snacks, Telescope and fzf-lua are **optional**.
2627<details>
28···45 "nvim-treesitter/nvim-treesitter",
46 "folke/snacks.nvim", -- optional
47 "nvim-telescope/telescope.nvim", -- optional
48+ "ibhagwan/fzf-lua" -- optional
49 },
50}
51```
···60 "nvim-treesitter/nvim-treesitter",
61 "folke/snacks.nvim", -- optional
62 "nvim-telescope/telescope.nvim" -- optional
63+ "ibhagwan/fzf-lua" --optional
64 },
65}
66```
···70```viml
71Plug 'folke/snacks.nvim' " optional
72Plug 'nvim-telescope/telescope.nvim' " optional
73+Plug 'ibhagwan/fzf-lua' " optional
74Plug 'nvim-treesitter/nvim-treesitter'
75Plug 'cuducos/yaml.nvim'
76```
+6
doc/help.txt
···53 Creates a |:quickfix| list as in |:YAMLQuickfix|, and loads it with
54 |:telescope.nvim| using |:telescope.builtin|'s `quickfix()` function. Only
55 available if |:telescope.nvim| is installed.
000000
···53 Creates a |:quickfix| list as in |:YAMLQuickfix|, and loads it with
54 |:telescope.nvim| using |:telescope.builtin|'s `quickfix()` function. Only
55 available if |:telescope.nvim| is installed.
56+57+:YAMLFzfLua *YAMLFzfLua*
58+59+ Creates a |:quickfix| list as in |:YAMLQuickfix|, and loads it with
60+ |:fzf-lua|'s `quickfix()` function. Only available if |:fzf-lua| is
61+ installed.
+22-8
lua/yaml_nvim/init.lua
···1-local has_telescope, _ = pcall(require, "telescope")
2-local has_snacks, _ = pcall(require, "snacks")
03local document = require("yaml_nvim.document")
4local pair = require("yaml_nvim.pair")
5···155 vim.fn.setqflist(lines)
156end
157000000000158M.telescope = function()
159 if not has_telescope then
160 return
161 end
162163 M.quickfix()
164- require("telescope.builtin").quickfix()
165end
166167-M.snacks = function()
168- if not has_snacks then
169 return
170 end
171172 M.quickfix()
173- require("snacks").picker.qflist()
174end
175176-- Commands
···181vim.cmd("command! -nargs=? YAMLYankValue lua require('yaml_nvim').yank_value(<f-args>)")
182vim.cmd("command! YAMLQuickfix lua require('yaml_nvim').quickfix()")
1830000184if has_telescope then
185 vim.cmd("command! YAMLTelescope lua require('yaml_nvim').telescope()")
186end
187188-if has_snacks then
189- vim.cmd("command! YAMLSnacks lua require('yaml_nvim').snacks()")
190end
191192return M
···1+local has_snacks, snacks = pcall(require, "snacks")
2+local has_telescope, telescope = pcall(require, "telescope.builtin")
3+local has_fzf_lua, fzf_lua = pcall(require, "fzf-lua")
4local document = require("yaml_nvim.document")
5local pair = require("yaml_nvim.pair")
6···156 vim.fn.setqflist(lines)
157end
158159+M.snacks = function()
160+ if not has_snacks then
161+ return
162+ end
163+164+ M.quickfix()
165+ snacks.picker.qflist()
166+end
167+168M.telescope = function()
169 if not has_telescope then
170 return
171 end
172173 M.quickfix()
174+ telescope.quickfix()
175end
176177+M.fzf_lua = function()
178+ if not has_fzf_lua then
179 return
180 end
181182 M.quickfix()
183+ fzf_lua.quickfix()
184end
185186-- Commands
···191vim.cmd("command! -nargs=? YAMLYankValue lua require('yaml_nvim').yank_value(<f-args>)")
192vim.cmd("command! YAMLQuickfix lua require('yaml_nvim').quickfix()")
193194+if has_snacks then
195+ vim.cmd("command! YAMLSnacks lua require('yaml_nvim').snacks()")
196+end
197+198if has_telescope then
199 vim.cmd("command! YAMLTelescope lua require('yaml_nvim').telescope()")
200end
201202+if has_fzf_lua then
203+ vim.cmd("command! YAMLFzfLua lua require('yaml_nvim').fzf_lua()")
204end
205206return M
+3-2
tests/init.lua
···16end
1718local dependencies = {
0019 "nvim-lua/plenary.nvim",
20- "folke/snacks.nvim",
21 "nvim-treesitter/nvim-treesitter",
22- "nvim-telescope/telescope.nvim",
23}
24for _, dep in pairs(dependencies) do
25 install_from_github(dep)
···16end
1718local dependencies = {
19+ "folke/snacks.nvim",
20+ "ibhagwan/fzf-lua",
21 "nvim-lua/plenary.nvim",
22+ "nvim-telescope/telescope.nvim",
23 "nvim-treesitter/nvim-treesitter",
024}
25for _, dep in pairs(dependencies) do
26 install_from_github(dep)