JSON Path Picker is a Neovim plugin that allows users to easily navigate and copy content from specific paths in JSON files.
- Quick navigation in JSON files
- Select JSON paths using a Telescope interface
- Preview JSON content for selected paths
- One-click copy of formatted JSON to clipboard
Install this plugin using your preferred plugin manager. For example, with packer.nvim:
return {
'try-to-fly/json-path-picker.nvim',
config = function()
vim.api.nvim_set_keymap(
"n",
"<leader>jp",
[[<cmd>lua require('json_path_picker').pick_json_path()<CR>]],
{ noremap = true, silent = true }
)
end
}
Add the following key mapping to your Neovim configuration:
vim.api.nvim_set_keymap(
"n",
"<leader>jp",
[[<cmd>lua require('json_path_picker').pick_json_path()<CR>]],
{ noremap = true, silent = true }
)
You can change <leader>jp
to any other key combination as needed.
- Open a JSON file.
- Press the configured shortcut (default is
<leader>jp
). - Enter the JSON path you want to navigate to.
- Use the Telescope interface to browse and select paths.
- Press Enter to copy the JSON content of the selected path to the clipboard.
- Use dot notation (
.
) to separate object keys. - Use square brackets and index (
[0]
) to access array elements.
For example: data.users[0].name
Issues and pull requests are welcome!
MIT
This README provides a basic introduction to the plugin, installation instructions, configuration method, usage instructions, and other useful information. You can modify or expand it as needed, for example by adding more detailed examples, FAQs, or screenshots.