json-nvim
is a NeoVim plugin that aims to vastly improve json editing and processing experience with help of jq and Neovim Treesitter
🚧 NOTE: This plugin is developed on linux environment and support for mac is not tested. Also some functionality won't work on windows
:warning: switching key cases is not supported on windows yet
Using lazy.nvim:
{
"VPavliashvili/json-nvim",
ft = "json", -- only load for json filetype
}
There is not much needed but I reccomend to use keymaps, otherwise you can ignore this section
For example setup with lazy.nvim like this
{
"VPavliashvili/json-nvim",
config = function()
vim.keymap.set("n", "<leader>jff", '<cmd>JsonFormatFile<cr>')
vim.keymap.set("n", "<leader>jmf", '<cmd>JsonMinifyFile<cr>')
end,
}
These are all the available commands below with usage examples
Commands involving visual mode always should be used with valid json selection
:JsonFormatFile
![format_file](https://github.com/VPavliashvili/json-nvim/assets/40483227/a84930dd-c6f4-46a3-a9e8-7240c449cfe3)
:JsonMinifyFile
![minify_file](https://github.com/VPavliashvili/json-nvim/assets/40483227/c36d590d-006f-45e8-9e96-d7d91537eddd)
:JsonFormatSelection
![format_selection](https://github.com/VPavliashvili/json-nvim/assets/40483227/03d6dccf-774b-46e0-a37d-6cedc4fbc711)
:JsonMinifySelection
![minify_selection](https://github.com/VPavliashvili/json-nvim/assets/40483227/b1b14d2e-e920-415b-9bf3-60afa920b3fd)
:JsonFormatToken
:JsonMinifyToken
:JsonEscapeFile
:JsonUnescapeFile
:JsonEscapeSelection
:JsonUnescapeSelection
:JsonKeysToCamelCase
:JsonKeysToPascalCase
:JsonKeysToSnakeCase