ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Status Bar Json​Path

by Alex Kirk ST3

Sublime Text plugin to get the JSONPath under the cursor in a JSON

Details

Installs

  • Total 2K
  • Win 625
  • Mac 825
  • Linux 195
Feb 28 Feb 27 Feb 26 Feb 25 Feb 24 Feb 23 Feb 22 Feb 21 Feb 20 Feb 19 Feb 18 Feb 17 Feb 16 Feb 15 Feb 14 Feb 13 Feb 12 Feb 11 Feb 10 Feb 9 Feb 8 Feb 7 Feb 6 Feb 5 Feb 4 Feb 3 Feb 2 Feb 1 Jan 31 Jan 30 Jan 29 Jan 28 Jan 27 Jan 26 Jan 25 Jan 24 Jan 23 Jan 22 Jan 21 Jan 20 Jan 19 Jan 18 Jan 17 Jan 16 Jan 15 Jan 14
Windows 0 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 2 1 0 1 1 1 0 1 0 0 1 1 1 1 2 1 0 3 0 0 0 2 0 0 0 0 2 2
Mac 0 1 4 2 1 0 0 2 2 0 0 2 0 1 1 0 1 0 1 0 1 2 1 1 3 0 0 0 2 2 1 0 0 0 0 3 4 2 2 1 0 1 2 2 1 2
Linux 0 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 1 0 0 0

Readme

Source
raw.​githubusercontent.​com

StatusBarJsonPath

Sublime Text plugin to get the JSONPath (a notation to access the item) under the cursor in a JSON.

The plugin also includes a command JSONPath: Copy to copy the displayed path to the clipboard.

Example

Given the following JSON object:

{
    "name": "Hello World",
    "tags": [
        "example"
    ],
    "metadata": {
        "author": "Alex Kirk"
    }
}

In this scenario the plugin will display/copy the following JSONPaths (all directly queryable in jq for matching results):

  • Cursor inside “name”: .name
  • Cursor inside “Hello World”: .name
  • Cursor inside “tags”: .tags
  • Cursor inside “example”: .tags[0]
  • Cursor inside “metadata”: .metadata
  • Cursor inside “author”: .metadata.author

Demo

screen recording

Installation

On PackageControl it's called Status Bar JsonPath: https://packagecontrol.io/packages/Status%20Bar%20JsonPath

  1. Run Package Control: Advanced Install Package
  2. Enter Status Bar JsonPath

You can also install the package manually like this:

  1. Click the Preferences >Browse Packages… menu, this should open a folder Packages.
  2. Download https://github.com/akirk/StatusBarJsonPath/archive/refs/heads/main.zip and extract it into that directory (it should then have a subfolder StatusBarJsonPath-main).
  3. Restart Sublime Text.