helix
helix copied to clipboard
add info about binding to mac specific modifier keys
documentation describes modifier keys in terms of classic "Control, Alt, Shift" trinity, but mac has "Command, Option, Shift" (and Control which I don't want to use), how to deal with it? maybe add a note about it in the documentation?
I want to have Command-x bindings, not Control-x.
Command modifiers are not supported because they're not supported upstream in crossterm: https://github.com/crossterm-rs/crossterm/issues/389
Support for command could most likely be added with a GUI but otherwise awaits that issue upstream.
As far as I know, Cmd usually isn't exposed at all in macOS terminals, I think you'd need to remap it inside iTerm to expose it. It would start to clash with OS-level/terminal shortcuts like Cmd+n etc
iTerm2 is very flexible with remapping modifier keys. ctrl is in an awkward location on macs. I always swap caps lock and ctrl in system preferences but if you don't want that I'm sure iTerm2 can help.
Command can be exposed with Kitty's keyboard protocol. That's started being added in https://github.com/crossterm-rs/crossterm/pull/691. Once that lands, I think we could build on it for additional modifiers.
Command can be exposed with Kitty's keyboard protocol. That's started being added in crossterm-rs/crossterm#691. Once that lands, I think we could build on it for additional modifiers.
@groves Just pinging that the linked PR has been merged as I am interested in this as well. Thanks!
Also interested. Editor looks great, but using Mac + nordic keyboard makes it a little awkward.
Are there any updates?
I tried to remap keys using kitty:
When Cmd+KEY is pressed, kitty sends Ctrl+KEY hex code as text. However it does not work. And there is no way to debug it.
Does anyone have any success in making Command key working?
@justaskz one example with Kitty that I did to save with cmd+s
# Kitty config
map cmd+S send_text all \x13
# Helix Config
[keys.normal]
'C-s' = ':w!'
\x13 = control+s you can see more here
Kitty accepts unicode too.
This will be closed by https://github.com/helix-editor/helix/pull/6592
@danillos thank you, it is working now!!
I took wrong config example from somewhere map cmd+s send_text normal,application \x13 and it did not work
if you use alacritty,Bind cmd + s to ctrl + s and use it with helix's key bindings
~/.config/alacritty/alacritty.yaml
import = ["/Users/ls/.config/alacritty/themes/themes/tokyo-night.toml"]
live_config_reload = true
[font]
# AppleFontSmoothing = true
size = 14.0
[font.normal]
family = "JetBrainsMono Nerd Font"
style = "Regular"
[[keyboard.bindings]]
chars = "\u0013"
key = "S"
mods = "Command"
~/.config/helix/config.toml
theme = "tokyonight"
[editor]
middle-click-paste = false
auto-save = true
[editor.file-picker]
hidden = false
[editor.lsp]
display-messages = true
display-inlay-hints = true
[editor.cursor-shape]
normal = "block"
insert = "bar"
[keys.normal]
C-s = ":w"