feat: duplicate vim modes to create helix modes

This commit is contained in:
CJ van den Berg 2024-08-26 20:43:35 +02:00
parent d4b7a6ab9b
commit 0b42308321
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
4 changed files with 1586 additions and 1 deletions

View file

@ -602,8 +602,15 @@ const cmds = struct {
}
pub fn toggle_input_mode(self: *Self, _: Ctx) Result {
self.config.input_mode = if (std.mem.eql(u8, self.config.input_mode, "flow")) "vim/normal" else "flow";
self.config.input_mode = if (std.mem.eql(u8, self.config.input_mode, "flow"))
"vim/normal"
else if (std.mem.eql(u8, self.config.input_mode, "vim/normal"))
"helix/normal"
else
"flow";
try self.save_config();
var it = std.mem.splitScalar(u8, self.config.input_mode, '/');
self.logger.print("input mode {s}", .{it.first()});
return enter_mode(self, Ctx.fmt(.{self.config.input_mode}));
}
@ -620,6 +627,12 @@ const cmds = struct {
try @import("mode/input/vim/insert.zig").create(self.a)
else if (std.mem.eql(u8, mode, "vim/visual"))
try @import("mode/input/vim/visual.zig").create(self.a)
else if (std.mem.eql(u8, mode, "helix/normal"))
try @import("mode/input/helix/normal.zig").create(self.a)
else if (std.mem.eql(u8, mode, "helix/insert"))
try @import("mode/input/helix/insert.zig").create(self.a)
else if (std.mem.eql(u8, mode, "helix/select"))
try @import("mode/input/helix/select.zig").create(self.a)
else if (std.mem.eql(u8, mode, "flow"))
try @import("mode/input/flow.zig").create(self.a)
else if (std.mem.eql(u8, mode, "home"))