diff --git a/src/keybind/builtin/helix.json b/src/keybind/builtin/helix.json index da9a8a1..3352c42 100644 --- a/src/keybind/builtin/helix.json +++ b/src/keybind/builtin/helix.json @@ -86,6 +86,7 @@ ["shift+j", "join_selections"], + [":", "open_command_palette"], ["shift+;", "open_command_palette"], ["shift+7", "align_selections"], @@ -352,6 +353,7 @@ ["shift+j", "join_selections"], + [":", "open_command_palette"], ["shift+;", "open_command_palette"], ["shift+7", "align_selections"], @@ -507,6 +509,7 @@ "home": { "on_match_failure": "ignore", "press": [ + [":", "open_command_palette"], [";", "open_command_palette"], ["shift+;", "open_command_palette"], ["b", "open_keybind_config"], diff --git a/src/keybind/builtin/vim.json b/src/keybind/builtin/vim.json index fc70c45..c6dff63 100644 --- a/src/keybind/builtin/vim.json +++ b/src/keybind/builtin/vim.json @@ -35,6 +35,7 @@ ["n", "goto_next_match"], ["0", "move_begin"], ["", "move_end"], + [":", "open_command_palette"], [";", "open_command_palette"], ["", "open_command_palette"], ["p", "paste"], @@ -93,6 +94,7 @@ "syntax": "vim", "on_match_failure": "ignore", "press": [ + [":", "open_command_palette"], [";", "open_command_palette"], ["", "open_command_palette"], ["b", "open_keybind_config"], diff --git a/src/keybind/keybind.zig b/src/keybind/keybind.zig index 9779e17..48dcc6d 100644 --- a/src/keybind/keybind.zig +++ b/src/keybind/keybind.zig @@ -720,6 +720,8 @@ const match_test_cases = .{ .{ "", "", .matched }, .{ "dd", "dd", .matched }, .{ "dd", "da", .match_impossible }, + .{ ":", ":", .matched }, + .{ ":", ";", .match_impossible }, }; test "match" { diff --git a/src/keybind/parse_vim.zig b/src/keybind/parse_vim.zig index d8845f9..b6e3cd1 100644 --- a/src/keybind/parse_vim.zig +++ b/src/keybind/parse_vim.zig @@ -92,7 +92,7 @@ pub fn parse_key_events(allocator: std.mem.Allocator, event: input.Event, str: [ //lowercase characters 'a'...'z', '0'...'9', - '`', '-', '=', '[', ']', '\\', ';', '\'', ',', '.', '/', => { + '`', '-', '=', '[', ']', '\\', ':', ';', '\'', ',', '.', '/', => { try result.append(.{ .key = str[i] }); i += 1; }, @@ -340,7 +340,7 @@ pub fn parse_key_events(allocator: std.mem.Allocator, event: input.Event, str: [ //lowercase characters only inside the escape sequence 'a'...'z', '0'...'9', - '`', '-', '=', '[', ']', '\\', ';', '\'', ',', '.', '/', + '`', '-', '=', '[', ']', '\\', ':', ';', '\'', ',', '.', '/', => { try result.append(.{ .key = str[i], .modifiers = modifiers }); modifiers = 0;