Giter Club home page Giter Club logo

jsonfly.nvim's Introduction

jsonfly.nvim

Fly through your JSON files with ease. Search ✨ blazingly fast ✨ for keys via Telescope, and navigate through your JSON structure with ease.

json(fly) is a Telescope extension that will show you all keys (including nested ones) in your JSON files and allow you to search and jump to them quickly. It's completely customizable and even supports highlighting of the values.

Features

  • 🔍 Search for deeply nested keys - expo.android.imageAsset.0.uri
  • 🎨 See values with their correct syntax highlighting (numbers, strings, booleans, null; configurable)
  • 💻 Use your LSP or the built-in JSON parser
  • 🫣 Automatic concealment based on your configuration
  • 📐 Everything completely customizable!

Installation

Install with your favorite plugin manager, for example with lazy.nvim:

{
    "nvim-telescope/telescope.nvim",
    dependencies = {
        -- "Myzel394/easytables.nvim",
        -- "Myzel394/telescope-last-positions",
        -- Other dependencies
        -- ..
        "Myzel394/jsonfly.nvim",
    }
}

Here's how I load it with lazy.nvim with lazy-loading and <leader>j as the keymap :)

{
    "nvim-telescope/telescope.nvim",
    dependencies = {
        "Myzel394/jsonfly.nvim",
    },
    keys = {
        {
            "<leader>j",
            "<cmd>Telescope jsonfly<cr>",
            desc = "Open json(fly)",
            ft = { "json" },
            mode = "n"
        }
    }
}

Load the extension with:

require("telescope").load_extension("jsonfly")

Usage

Go to a JSON file and run:

:Telescope jsonfly

## See also

* [jsonpath.nvim](https://github.com/phelipetls/jsonpath.nvim) - Copy JSON paths to your clipboard

Configuration

Edit jsonfly like any other Telescope extension:

require"telescope".setup {
    extensions = {
        jsonfly = {
            -- Your configuration here
        }
    }
}

Please see jsonfly.lua for the default configuration. The first comment in the file contains a list of all available options.

Example: Vertical layout

require"telescope".setup {
    extensions = {
        jsonfly = {
            mirror = true,
            layout_strategy = "vertical",
            layout_config = {
                mirror = true,
                preview_height = 0.65,
                prompt_position = "top",
            },
            key_exact_length = true
        }
    }
}

Example: Horizontal layout

require"telescope".setup {
    extensions = {
        jsonfly = {
            layout_strategy = "horizontal",
            prompt_position = "top",
            layout_config = {
                mirror = false,
                prompt_position = "top",
                preview_width = 0.45
            }
        }
    }
}

Example: Waterfall keys

require"telescope".setup {
    extensions = {
        jsonfly = {
            subkeys_display = "waterfall"
        }
    }
}

Acknowledgements

jsonfly.nvim's People

Contributors

myzel394 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.