yaml.nvim
Simple tools to help developers working YAML in Neovim.
Assuming yaml = require("yaml_nvim")
for the Lua API:
Command | Lua API | Description |
---|---|---|
:YAMLView |
yaml.view() |
Shows the full path and value of the current key/value pair |
:YAMLYank [register] |
yaml.yank_all([register]) |
Yanks the full path and value of the current key/value pair. The default register is the unnamed one (" ) |
: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 (" ) |
:YAMLYankValue [regster] |
yaml.yank_value([register]) |
Yanks the value of the current key/value pair. The default register is the unnamed one (" ) |
:YAMLQuickfix |
yaml.quickfix() |
Generates a quickfix with key/value pairs |
:YAMLTelescope |
yaml.telescope() |
Full path key/value fuzzy finder via Telescope if installed |
Requirements
- Neovim 0.9 or newer
nvim-treesitter
with YAML support
Telescope is optional.
What about older versions of Neovim?
Install
lazy.nvim
With {
"cuducos/yaml.nvim",
ft = { "yaml" }, -- optional
dependencies = {
"nvim-treesitter/nvim-treesitter",
"nvim-telescope/telescope.nvim", -- optional
},
}
packer.nvim
:
With use {
"cuducos/yaml.nvim",
ft = { "yaml" }, -- optional
requires = {
"nvim-treesitter/nvim-treesitter",
"nvim-telescope/telescope.nvim" -- optional
},
}
vim-plug
:
With Plug 'nvim-telescope/telescope.nvim' " optional
Plug 'nvim-treesitter/nvim-treesitter'
Plug 'cuducos/yaml.nvim'
Reporting bugs and contributing
There is a mini toolchain to help you test the plugin in isolation using a container. It requires:
Command | Description |
---|---|
./manage build |
Builds the container |
./manage test |
Runs the tests inside the container |
./manage nvim |
Opens the container's Neovim with a sample YAML file |