diff --git a/states/neovim/templates/init.lua.j2 b/states/neovim/templates/init.lua.j2 index 26492ee..1fcff17 100644 --- a/states/neovim/templates/init.lua.j2 +++ b/states/neovim/templates/init.lua.j2 @@ -23,6 +23,10 @@ vim.{{ t }}["{{ k }}"]{% if v is defined %}={% if v is integer or v is boolean % {{- cfg("options", neovim.config.options) }} -- NeoVIM functions +function JsonFormat() + vim.cmd("% !jq") +end + function RemoveComments() vim.cmd.normal("g/^#/d") vim.cmd.normal("g/^$/d") @@ -32,6 +36,7 @@ function Reformat() vim.cmd.normal("gg=G") end +vim.api.nvim_command("command! JsonFormat call luaeval('JsonFormat()')") vim.api.nvim_command("command! Reformat call luaeval('Reformat()')") vim.api.nvim_command("command! RemoveComments call luaeval('RemoveComments()')")