Skip to content

JFryy/keytrail.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KeyTrail.nvim

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.

Demo

Features

  • 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

Requirements

Installation

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,
}

Configuration

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,
    },
})

Usage

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.

About

Neovim plugin in pure Lua for displaying paths and key-based search with fuzzy finding.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages