···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** |
1515| `:YAMLTelescope` | `yaml.telescope()` | Full path key/value fuzzy finder via [Telescope](https://github.com/nvim-telescope/telescope.nvim) **if installed** |
1616+| `:YAMLFzfLua` | `yaml.fzf_lua()` | Full path key/value fuzzy finder via [fzf-lua](https://github.com/ibhagwan/fzf-lua) **if installed** |
16171718
1819···2122* **Neovim 0.9** or newer
2223* [`nvim-treesitter`](https://github.com/nvim-treesitter/nvim-treesitter) with [YAML support](https://github.com/ikatyang/tree-sitter-yaml)
23242424-Snacks and Telescope are **optional**.
2525+Snacks, Telescope and fzf-lua are **optional**.
25262627<details>
2728···4445 "nvim-treesitter/nvim-treesitter",
4546 "folke/snacks.nvim", -- optional
4647 "nvim-telescope/telescope.nvim", -- optional
4848+ "ibhagwan/fzf-lua" -- optional
4749 },
4850}
4951```
···5860 "nvim-treesitter/nvim-treesitter",
5961 "folke/snacks.nvim", -- optional
6062 "nvim-telescope/telescope.nvim" -- optional
6363+ "ibhagwan/fzf-lua" --optional
6164 },
6265}
6366```
···6770```viml
6871Plug 'folke/snacks.nvim' " optional
6972Plug 'nvim-telescope/telescope.nvim' " optional
7373+Plug 'ibhagwan/fzf-lua' " optional
7074Plug 'nvim-treesitter/nvim-treesitter'
7175Plug 'cuducos/yaml.nvim'
7276```
+6
doc/help.txt
···5353 Creates a |:quickfix| list as in |:YAMLQuickfix|, and loads it with
5454 |:telescope.nvim| using |:telescope.builtin|'s `quickfix()` function. Only
5555 available if |:telescope.nvim| is installed.
5656+5757+:YAMLFzfLua *YAMLFzfLua*
5858+5959+ Creates a |:quickfix| list as in |:YAMLQuickfix|, and loads it with
6060+ |:fzf-lua|'s `quickfix()` function. Only available if |:fzf-lua| is
6161+ installed.
+22-8
lua/yaml_nvim/init.lua
···11-local has_telescope, _ = pcall(require, "telescope")
22-local has_snacks, _ = pcall(require, "snacks")
11+local has_snacks, snacks = pcall(require, "snacks")
22+local has_telescope, telescope = pcall(require, "telescope.builtin")
33+local has_fzf_lua, fzf_lua = pcall(require, "fzf-lua")
34local document = require("yaml_nvim.document")
45local pair = require("yaml_nvim.pair")
56···155156 vim.fn.setqflist(lines)
156157end
157158159159+M.snacks = function()
160160+ if not has_snacks then
161161+ return
162162+ end
163163+164164+ M.quickfix()
165165+ snacks.picker.qflist()
166166+end
167167+158168M.telescope = function()
159169 if not has_telescope then
160170 return
161171 end
162172163173 M.quickfix()
164164- require("telescope.builtin").quickfix()
174174+ telescope.quickfix()
165175end
166176167167-M.snacks = function()
168168- if not has_snacks then
177177+M.fzf_lua = function()
178178+ if not has_fzf_lua then
169179 return
170180 end
171181172182 M.quickfix()
173173- require("snacks").picker.qflist()
183183+ fzf_lua.quickfix()
174184end
175185176186-- Commands
···181191vim.cmd("command! -nargs=? YAMLYankValue lua require('yaml_nvim').yank_value(<f-args>)")
182192vim.cmd("command! YAMLQuickfix lua require('yaml_nvim').quickfix()")
183193194194+if has_snacks then
195195+ vim.cmd("command! YAMLSnacks lua require('yaml_nvim').snacks()")
196196+end
197197+184198if has_telescope then
185199 vim.cmd("command! YAMLTelescope lua require('yaml_nvim').telescope()")
186200end
187201188188-if has_snacks then
189189- vim.cmd("command! YAMLSnacks lua require('yaml_nvim').snacks()")
202202+if has_fzf_lua then
203203+ vim.cmd("command! YAMLFzfLua lua require('yaml_nvim').fzf_lua()")
190204end
191205192206return M
+3-2
tests/init.lua
···1616end
17171818local dependencies = {
1919+ "folke/snacks.nvim",
2020+ "ibhagwan/fzf-lua",
1921 "nvim-lua/plenary.nvim",
2020- "folke/snacks.nvim",
2222+ "nvim-telescope/telescope.nvim",
2123 "nvim-treesitter/nvim-treesitter",
2222- "nvim-telescope/telescope.nvim",
2324}
2425for _, dep in pairs(dependencies) do
2526 install_from_github(dep)