A Neovim plugin in pure lua that shows the current path in YAML and JSON files, with the ability to jump to any path in the document using fuzzyfinding search w/ telescope / filepickers.
- Shows the current path in YAML and JSON files
- Hover popup with the current path
- Jump to any path in the document using Telescope
- Support for both YAML and JSON file types
- Configurable delimiter and hover delay
- Customizable key mapping
- Neovim 0.9.0 or higher
- nvim-treesitter
- telescope.nvim
Using lazy.nvim:
{
"jfryy/keytrail.nvim",
dependencies = {
"nvim-treesitter/nvim-treesitter",
"nvim-telescope/telescope.nvim",
},
config = function()
require("keytrail").setup()
end,
}
Using packer.nvim:
use {
"jfryy/keytrail.nvim",
requires = {
"nvim-treesitter/nvim-treesitter",
"nvim-telescope/telescope.nvim",
},
config = function()
require("keytrail").setup()
end,
}
KeyTrail can be configured by passing a table to the setup function:
require("keytrail").setup({
-- The delimiter to use between path segments
delimiter = ".",
-- The delay in milliseconds before showing the hover popup
hover_delay = 100,
-- The key mapping to use for jumping to a path
key_mapping = "jq",
-- The file types to enable KeyTrail for
filetypes = {
yaml = true,
json = true,
},
})
KeyTrail provides the following commands:
:KeyTrail <path>
- Jump to the specified path:KeyTrailJump
- Open Telescope to select and jump to a path
By default, KeyTrail maps <leader>jq
to :KeyTrailJump
in normal mode.