From a010c94f287680e10436fc236c67452678e5293d Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Thu, 5 Feb 2026 09:26:20 +0100 Subject: [PATCH 1/3] fix: change default lua lsp to lua-language-server --- src/file_type_lsp.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/file_type_lsp.zig b/src/file_type_lsp.zig index 18f19c6..42e17b3 100644 --- a/src/file_type_lsp.zig +++ b/src/file_type_lsp.zig @@ -104,7 +104,7 @@ pub const julia = .{ pub const kdl = .{}; pub const lua = .{ - .language_server = .{"lua-lsp"}, + .language_server = .{"lua-language-server"}, }; pub const mail = .{}; From 147ec6127fb58b88a4fc283da4cdedaf6db1ef55 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Thu, 5 Feb 2026 09:26:47 +0100 Subject: [PATCH 2/3] feat: add variable expansions indent_mode and indent_size Useful for some formatters and/or LSPs. --- src/tui/expansion.zig | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/tui/expansion.zig b/src/tui/expansion.zig index 721509f..5f34a0c 100644 --- a/src/tui/expansion.zig +++ b/src/tui/expansion.zig @@ -6,7 +6,9 @@ /// {{selection}} - The current selection of the primary cursor /// {{selections}} - All current selections seperated by NL characters /// {{selectionsZ}} - All current selections separated by NULL characters -/// {{selections*}} All current selections expanded to multiple quoted arguments +/// {{selections*}} - All current selections expanded to multiple quoted arguments +/// {{indent_mode}} - The current indent mode ("tabs" or "spaces") +/// {{indent_size}} - The current indent size (in columns) pub fn expand(allocator: Allocator, arg: []const u8) Error![]const u8 { var result: std.Io.Writer.Allocating = .init(allocator); defer result.deinit(); @@ -140,6 +142,24 @@ const functions = struct { // }; // return results.toOwnedSlice(allocator); // } + + /// {{indent_mode}} - The current indent mode ("tabs" or "spaces") + pub fn indent_mode(allocator: Allocator) Error![]const u8 { + const mv = tui.mainview() orelse return &.{}; + const ed = mv.get_active_editor() orelse return &.{}; + var stream: std.Io.Writer.Allocating = .init(allocator); + try stream.writer.print("{t}", .{ed.indent_mode}); + return stream.toOwnedSlice(); + } + + /// {{indent_size}} - The current indent size (in columns) + pub fn indent_size(allocator: Allocator) Error![]const u8 { + const mv = tui.mainview() orelse return &.{}; + const ed = mv.get_active_editor() orelse return &.{}; + var stream: std.Io.Writer.Allocating = .init(allocator); + try stream.writer.print("{d}", .{ed.indent_size}); + return stream.toOwnedSlice(); + } }; fn get_functions() []struct { []const u8, Function } { From bdd1e1dd1ca653f7fbeb531c2163b3e682274f15 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Thu, 5 Feb 2026 09:27:26 +0100 Subject: [PATCH 3/3] feat: set default lua formatter to stylua --- src/file_type_lsp.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/src/file_type_lsp.zig b/src/file_type_lsp.zig index 42e17b3..01cae91 100644 --- a/src/file_type_lsp.zig +++ b/src/file_type_lsp.zig @@ -105,6 +105,7 @@ pub const kdl = .{}; pub const lua = .{ .language_server = .{"lua-language-server"}, + .formatter = .{ "stylua", "--indent-type", "{{indent_mode}}", "--indent-width", "{{indent_size}}", "-" }, }; pub const mail = .{};