An open API service indexing awesome lists of open source software.

https://github.com/owen-dechow/videre.nvim

JSON explorer using Neovim's terminal interface.
https://github.com/owen-dechow/videre.nvim

graph json neovim terminal

Last synced: 10 months ago
JSON representation

JSON explorer using Neovim's terminal interface.

Awesome Lists containing this project

README

          

# ๐Ÿ“Š videre.nvim

Many editors have the option to view JSON & YAML files as a graph. Neovim, with a
terminal interface, does not have this luxury. While one can't create an
interface like JSON Crack, it is possible to build a similar JSON explorer
using Neovim's terminal interface.

[Videre Preview](https://github.com/user-attachments/assets/eb09e14b-4243-4b27-9928-1c20fec5d337)

```
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ•ฎโ•ญโ”€โ”€โ”ฌโ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎโ•ญโ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ Videreโ”‚[]โ”œโ•ฏ โ”‚ 1โ”‚ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡"This is a great plugin"โ”‚โ”‚ โ”‚ userโ”‚ฮ‡"will try"โ”‚
โ”‚ Exampleโ”‚{}โ”œโ•ฎ โ”‚ 2โ”‚ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡"Look at this number"โ”‚โ”‚ โ”‚isTrueโ”‚"100% True"โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ•ฏโ”‚ โ”‚ 3โ”‚ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡3467โ”‚โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
โ”‚ โ”‚ 4โ”‚ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡nullโ”‚โ”‚
โ”‚ โ”‚ 5โ”‚ฮ‡ฮ‡ฮ‡"The Next lines will be hidden"โ”‚โ”‚
โ”‚ โ•ช.....................................โ”‚โ”‚
โ”‚ โ•ฐโ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏโ”‚
โ•ฐโ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎโ”‚
โ”‚ empty_arrayโ”‚ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡[]โ”‚โ”‚
โ”‚ empty_tableโ”‚ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡ฮ‡{}โ”‚โ”‚
โ”‚ testโ”‚"This is some test data"โ”œโ•ฏ
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
```

> [!NOTE]
> This plugin is still under development. Breaking changes will be avoided
> unless deemed necessary.

## ๐Ÿ› ๏ธ Features

* Algorithmic Graph Rendering
* Collapsible Units
* Jumping Between Linked Units
* Set Any Unit as Root
* Customizable Styles
* Support for Different Filetypes

## โš™๏ธ Setup

[lazy.nvim](https://github.com/folke/lazy.nvim) (Suggested Setup)
```lua
return {
"Owen-Dechow/videre.nvim",
cmd = "Videre",
dependencies = {
"Owen-Dechow/graph_view_yaml_parser", -- Optional: add YAML support
"Owen-Dechow/graph_view_toml_parser", -- Optional: add TOML support
"a-usr/xml2lua.nvim", -- Optional | Experimental: add XML support
},
opts = {
round_units = false,
simple_statusline = true, -- If you are just starting out with Videre,
-- setting this to `false` will give you
-- descriptions of available keymaps.
}
}
```

[vim.pack](https://neovim.io/doc/user/pack.html#_plugin-manager)

```lua
vim.pack.add {
"https://github.com/Owen-Dechow/videre.nvim",
"https://github.com/Owen-Dechow/graph_view_yaml_parser", -- Optional: add YAML support
"https://github.com/Owen-Dechow/graph_view_toml_parser", -- Optional: add TOML support
"https://github.com/a-usr/xml2lua.nvim", -- Optional | Experimental: add XML support
}

require('videre').setup {
round_units = false,
simple_statusline = true, -- If you are just starting out with Videre,
-- setting this to `false` will give you
-- descriptions of available keymaps.
}
```

## ๐Ÿงฉ Options
```lua
{
-- set the window editor type
editor_type = "split", -- split, floating

-- configure the floating window style
floating_editor_style = {
margin = 2,
border = "double",
zindex = 10
},

-- Number of lines before collapsing
max_lines = 5,

-- Set the unit style to round
round_units = true,

-- Set the connection style to round
round_connections = true,

-- Disable line wrapping for the graph buffer
disable_line_wrap = true,

-- Set side scroll off for graph buffer
side_scrolloff = 20,

-- Change the string between the keymap and
-- description of callback within the statusline
-- FOR FONTS WITH LIGATURES TRY USING "๊žŠ" INSTEAD OF "=".
-- Other great options include "->", ": ", "=>", & " ".
keymap_desc_deliminator = "=",

-- Character used to represent empty space
space_char = "ฮ‡",

-- Use simple statusline instead of providing
-- descriptions of keymaps.
simple_statusline = true,

-- Show breadcrumbs to show where you are in
-- a Videre graph.
breadcrumbs = true,

-- Set the priority of keymaps for the quick
-- action keymap.
keymap_priorities = {
expand = 5,
link_forward = 4,
link_backward = 3,
link_down = 1,
link_up = 1,
collapse = 2,
set_as_root = 1,
},

-- Set the keys actions will be mapped to
keymaps = {
-- Expanding collapsed areas
expand = "E",

-- Collapse expanded areas
collapse = "E",

-- Jump to linked unit
link_forward = "L",

-- Jump back to unit parent
link_backward = "H",

-- Jump down a unit
link_down = "J",

-- Jump up a unit
link_up = "K",

-- Set current unit as root
set_as_root = "R",

-- Aliased to first priority available keymap
quick_action = "",

-- Close the window
close_window = "q"

-- Open the help menu
help = "g?",
}
}
```

## ๐Ÿš€ Running

To open a graph view, go to a json file and run `:Videre`.
The Videre window will open in a plit window to the right.
The Videre buffer will have a filetype of `Videre`.

## ๐Ÿ—‚๏ธ Different File Types

To enable different filetypes just add the correct parser plugin.
JsonGraphView will automatically detect the installed plugin and
allow you to explore that filetype.

Here are a list of supported parsers:
* JSON: ***builtin***
* YAML: [graph_view_yaml_parser](https://github.com/Owen-Dechow/graph_view_yaml_parser)
* TOML: [graph_view_toml_parser](https://github.com/Owen-Dechow/graph_view_toml_parser)
* XML **(Experimental)**: [xml2lua.nvim](https://github.com/a-usr/xml2lua.nvim)

If you would like to add a parser please open an issue or contribute a PR.

## ๐ŸŽฏ Future Goals
> [!NOTE]
> These goals are long term and will only be started after this
> plugin is deemed stable and there is enough support.

### ๐Ÿ“š Multiple Filetype Support

Add support for different filetypes such as YAML and TOML.

(Issue: [Multiple Filetype Support *#4*](https://github.com/Owen-Dechow/nvim_json_graph_view/issues/4))

### โœ๏ธ File Editing

Add support for file editing directly form Videre.

(Issue: [File Editing *#5*](https://github.com/Owen-Dechow/nvim_json_graph_view/issues/5))

## ๐Ÿ“„ License

This software is licensed under the MIT Standard License
[(Copyright (c) 2025 Owen Dechow)](https://github.com/Owen-Dechow/nvim_json_graph_view/blob/main/LICENSE).

## ๐Ÿค Contributions

Contributions to this software are greatly appreciated.
Please read [CONTRIBUTING.md](https://github.com/Owen-Dechow/nvim_json_graph_view/blob/main/CONTRIBUTING.md)
for further guidelines.