diff --git a/src/keybind/builtin/helix.json b/src/keybind/builtin/helix.json index a784717..3e5bbd8 100644 --- a/src/keybind/builtin/helix.json +++ b/src/keybind/builtin/helix.json @@ -282,7 +282,7 @@ "line_numbers": "relative", "cursor": "block", "selection": "inclusive", - "init_command": ["enable_selection"], + "init_command": ["init_helix_select_mode"], "press": [ ["ctrl+b", "select_page_up"], diff --git a/src/tui/mode/helix.zig b/src/tui/mode/helix.zig index 20ca66f..8580ac1 100644 --- a/src/tui/mode/helix.zig +++ b/src/tui/mode/helix.zig @@ -240,6 +240,12 @@ const cmds_ = struct { } pub const extend_line_below_meta: Meta = .{ .arguments = &.{.integer}, .description = "Select current line, if already selected, extend to next line" }; + pub fn init_helix_select_mode(_: *void, _: Ctx) Result { + _, const ed = get_context() orelse return; + try ed.enable_selection(.{}); + } + pub const init_helix_select_mode_meta: Meta = .{}; + pub fn move_next_word_start(_: *void, ctx: Ctx) Result { try move_to_word(ctx, Editor.move_cursor_word_right_vim, .forwards); }