From 379612935b1a46d9339fe8b377c80441316b768f Mon Sep 17 00:00:00 2001 From: Rosa Date: Thu, 25 Jun 2026 13:56:23 -0400 Subject: formatter pass + add FMJ support to kakoune --- modules/user/editors/kakoune/default.nix | 42 +++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 11 deletions(-) (limited to 'modules/user/editors/kakoune') diff --git a/modules/user/editors/kakoune/default.nix b/modules/user/editors/kakoune/default.nix index e4f4aa5..f519c5b 100644 --- a/modules/user/editors/kakoune/default.nix +++ b/modules/user/editors/kakoune/default.nix @@ -22,13 +22,33 @@ { commands = "lsp-enable-window"; name = "WinSetOption"; - option = "filetype=(css|html|java|zig)"; + option = "filetype=(css|html|java|json|zig)"; } { - commands = "set window filetype json"; - name = "WinCreate"; + commands = "set buffer filetype json"; + name = "BufCreate"; option = ".*\.mcmeta"; } + { + commands = '' + set buffer lsp_servers %{ + [vscode-json-language-server] + args = ["--stdio"] + root_globs = [".git"] + settings_section = "_" + [[vscode-json-language-server.settings._]] + provideFormatter = true + json.format.enable = true + json.validate.enabble = true + + [[vscode-json-language-server.settings._.json.schemas]] + fileMatch = ["fabric.mod.json"] + url = "https://www.schemastore.org/fabric.mod.json" + } + ''; + name = "BufSetOption"; + option = "filetype=json"; + } ]; indentWidth = 0; @@ -52,16 +72,16 @@ mode = "normal"; } { - docstring = "Rename the symbol below the cursor"; - effect = ":lsp-rename-prompt"; - key = ""; - mode = "normal"; + docstring = "Rename the symbol below the cursor"; + effect = ":lsp-rename-prompt"; + key = ""; + mode = "normal"; } { - docstring = "Create a new file"; - effect = ":e %sh{${(pkgs.writeShellScript "newfile" (builtins.readFile ./newfile.sh))}}"; - key = ""; - mode = "normal"; + docstring = "Create a new file"; + effect = ":e %sh{${(pkgs.writeShellScript "newfile" (builtins.readFile ./newfile.sh))}}"; + key = ""; + mode = "normal"; } ]; -- cgit v1.3.1