feat: add vim mode keybindings for setting integer argument

This commit is contained in:
CJ van den Berg 2025-04-08 18:23:40 +02:00
parent ec483d34d5
commit ae815043d9
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
2 changed files with 20 additions and 2 deletions

View file

@ -46,6 +46,14 @@ const cmds_ = struct {
}
pub const @"wq!_meta": Meta = .{ .description = "wq! (write file and quit without saving)" };
pub fn move_begin_or_add_integer_argument_zero(_: *void, _: Ctx) Result {
return if (@import("keybind").current_integer_argument()) |_|
command.executeName("add_integer_argument_digit", command.fmt(.{0}))
else
command.executeName("move_begin", .{});
}
pub const move_begin_or_add_integer_argument_zero_meta: Meta = .{ .description = "Move cursor to beginning of line (vim)" };
pub fn enter_mode_at_next_char(self: *void, ctx: Ctx) Result {
_ = self; // autofix
_ = ctx; // autofix