From cef18536018f260d1276b3a4efe3db0b40e03617 Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 1 Sep 2025 09:29:13 +0200 Subject: [PATCH] updated neovim state --- states/neovim/templates/init.lua.j2 | 5 +++++ 1 file changed, 5 insertions(+) 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()')")