Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some configs do not work #1085

Closed
python128 opened this issue Nov 12, 2021 · 10 comments · Fixed by #4939
Closed

Some configs do not work #1085

python128 opened this issue Nov 12, 2021 · 10 comments · Fixed by #4939
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug

Comments

@python128
Copy link
Contributor

python128 commented Nov 12, 2021

I am not able to allow certain keymaps to work.
Here is my config.toml

theme = "bogster"

[lsp]
display-messages = true

[keys.normal]
S-left = "extend_char_left"
S-right = "extend_char_right"
S-up = "extend_line_up"
S-down = "extend_line_down"

"#" = "toggle_comments"
C-c = "no_op"
q = { q = "wclose" }
"space" = { "space" = "keep_primary_selection" }

A-o = "add_newline_below"
A-O = [ "open_above", "normal_mode" ]

[keys.insert]
C-backspace = "delete_word_backward"
  • Here, C-O and C-backspace doesn't work.
  • I have tried C-O with add_newline_above and the given config both.
  • A-o seems to work perfectly fine.

Environment

  • Platform: Linux(WSL)
  • Helix version: v0.5.0-94-gd3def16 (from git describe)

Link to gif.

@python128 python128 added the C-bug Category: This is a bug label Nov 12, 2021
@LollipopFt
Copy link
Contributor

just a suggestion (it may not work) but i think special keys like left and right should be enclosed in "?

@LollipopFt
Copy link
Contributor

see here, the entire command is encapsulated in double quotes.

@Omnikar
Copy link
Contributor

Omnikar commented Nov 13, 2021

just a suggestion (it may not work) but i think special keys like left and right should be enclosed in "?

Quotes are only required by special TOML characters like ., #, {, etc.

@sudormrfbin
Copy link
Member

C-backspace doesn't work

Backspace with modifiers have been problematic for terminal emulators to handle in general (some represent it as control+h, some send different keycodes, etc). There's also an open ticket in the crossterm repo: crossterm-rs/crossterm#504.

@pickfire
Copy link
Contributor

pickfire commented Nov 14, 2021

Yeah, some keys are special, for example C-i is tab so I think only one of them works. We didn't do any post-processing to solve this ambiguity issue in helix.

@python128
Copy link
Contributor Author

Is A-O also an ambiguous key?
If so, why does it work in Kak? (Is it because it is not crossterm or something related?)

@kirawi kirawi added the A-helix-term Area: Helix term improvements label Nov 14, 2021
@David-Else
Copy link
Contributor

David-Else commented Apr 3, 2022

Hi, the C-backspace = "delete_word_backward" not working is killing my typing. I think it is very important for touch typing to be able to easily delete the last word in insert mode, it is nearly always better to delete the misspelled word entirely and start again for the sake of muscle memory. ctrl-backspace is the standard in most software (for example, right here in editing this message on github it works)

In Gnome I set my backspace to be caps lock:

    gsettings set org.gnome.desktop.input-sources \
        xkb-options "['caps:backspace', 'terminate:ctrl_alt_bksp']"

and in my .bashrc i set ctrl-backspace to delete the previous word:

stty werase \^H # set ctrl-backspace to delete previous word instead of ctrl-w

Now in the terminal (kitty and gnome terminal) and Neovim I can delete the previous word with ctrl+caps-lock.

Is it correct that this is never going to work until crossterm-rs/crossterm#504 is fixed? :(

@sudormrfbin
Copy link
Member

It might be solved if/when we migrate from crossterm to termwiz, in the meantime you could use ctrl-w in insert mode for the same purpose (carried over from vim).

@the-mikedavis
Copy link
Member

With the update to crossterm 0.25 in #3390, it looks like there are a lot of key combinations that were mistranslated that have been fixed such as C-backspace and C-m. I can see these being translated correctly on Kitty now but I'm not sure if the fixes apply to all terminal emulators.

@groves
Copy link
Contributor

groves commented Aug 22, 2022

Kitty, foot, and WezTerm support it according to this crossterm comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants