This is a Neovim-only plugin containing a function to return a path to access the value under the cursor by using treesitter. It may help you understand how to access even deeply nested values in JSON files.
A "JSON path" is a jq-like expression, such
as .
for root, .[0]
for the first array item, .name
for the property
"name" of an object.
jsonpath-nvim-demo.webm
Colorscheme is vim-moonfly-colors
" in ~/after/ftplugin/json.vim
" show json path in the winbar
if exists('+winbar')
setlocal winbar=%{luaeval('require\"jsonpath\".get()')}
endif
" send json path to clipboard
nnoremap <buffer> y<C-p> :let @+=luaeval('require"jsonpath".get()')<CR>