helix icon indicating copy to clipboard operation
helix copied to clipboard

Key mapping for "Alt+[" not working

Open gariel opened this issue 2 years ago • 2 comments

Summary

Hi guys, thankyou for you amazing project

I'm trying to define some keymaps for navigating through buffers, but I'm having one issue with the "A-[" mapping

Reproduction Steps

I'm using the following configuration:

[keys.normal]
"A-[" = "goto_previous_buffer"
"A-]" = "goto_next_buffer"

The "A-]" for going to the next buffer works as expected, but the "A-[" seems not mapped (pressing it twice opens the "[" menu)

Helix log

I delete the log file for cleaning up before sending, opened the helix and used the keybindings to generate something but the file was empty

Here is my complete helix.toml:

theme = "dracula_at_night"

[editor]
line-number = "relative"
mouse = true
true-color = true
bufferline = "always"
color-modes = true

[editor.cursor-shape]
insert = "bar"
normal = "block"
select = "underline"

[editor.file-picker]
hidden = false

[editor.statusline]
left = ["mode", "spinner"]
center = ["file-name"]

[editor.indent-guides]
render = true
character = "⸽"
skip-levels = 1

[keys.normal]
C-s = ":w"
C-S-up = ["extend_to_line_bounds", "delete_selection", "move_line_up", "paste_before"]
C-S-down = ["extend_to_line_bounds", "delete_selection", "paste_after"]
A-pageup = "goto_previous_buffer"
A-pagedown = "goto_next_buffer"
C-n = ":new"
C-w = ":buffer-close"
C-S-w = ":buffer-close!"
"A-[" = "goto_previous_buffer"
"A-]" = "goto_next_buffer"
"[" = { "[" = "goto_previous_buffer" }
"]" = { "]" = "goto_next_buffer" }

[keys.select]
C-S-up = ["extend_to_line_bounds", "delete_selection", "move_line_up", "paste_before"]
C-S-down = ["extend_to_line_bounds", "delete_selection", "paste_after"]
A-pageup = "goto_previous_buffer"
A-pagedown = "goto_next_buffer"
C-s = ["normal_mode", ":w"]

[keys.insert]
C-s = ["normal_mode", ":w"]
C-space = "completion"
C-S-k = "hover"
C-S-up = ["normal_mode", "extend_to_line_bounds", "delete_selection", "move_line_up", "paste_before"]
C-S-down = ["normal_mode", "extend_to_line_bounds", "delete_selection", "paste_after"]
A-pageup = "goto_previous_buffer"
A-pagedown = "goto_next_buffer"

Platform

Linux

Terminal Emulator

Alacritty and gnome-terminal

Helix Version

helix 22.12

gariel avatar Jan 08 '23 03:01 gariel

I'm pretty sure this is the same problem as https://github.com/helix-editor/helix/issues/1085 - the terminal keycodes for A-[ are confused with something else (escape if I remember correctly?). This will be fixed by https://github.com/helix-editor/helix/pull/4939

the-mikedavis avatar Jan 08 '23 14:01 the-mikedavis

#4939 would also allow usage of C-/, right?

kendfss avatar Jan 14 '23 05:01 kendfss