Commit ebdf11f

HPCesia <me@hpcesia.com>
2025-07-03 09:28:36
feat(editor): add lua config
1 parent b75845c
Changed files (1)
home
base
tui
editors
helix
languages
home/base/tui/editors/helix/languages/lua.nix
@@ -0,0 +1,41 @@
+{...}: {
+  programs.helix.languages = {
+    language = [
+      {
+        name = "lua";
+        auto-format = true;
+        indent = {
+          tab-width = 2;
+          unit = "  ";
+        };
+        formatter = {
+          command = "stylua";
+          args = [
+            "--indent-type"
+            "Spaces"
+            "--indent-width"
+            "2"
+            "--column-width"
+            "80"
+            "--call-parentheses"
+            "NoSingleTable"
+            "--sort-requires"
+            "-" # From stdin
+          ];
+        };
+        roots = [
+          "stylua.toml"
+          ".stylua.toml"
+          ".editorconfig"
+        ];
+      }
+    ];
+    language-server.lua-language-server = {
+      command = "lua-language-server";
+      args = ["--locale=zh-cn"];
+      config.Lua = {
+        format.enable = false;
+      };
+    };
+  };
+}