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

Can we get <c-.>, <c-,> to work? #4019

Open
daboross opened this issue Jan 10, 2021 · 5 comments
Open

Can we get <c-.>, <c-,> to work? #4019

daboross opened this issue Jan 10, 2021 · 5 comments

Comments

@daboross
Copy link
Contributor

Feature

I'd really like to be able to use <c-.>, <c-,> (ctrl-dot, ctrl-comma) as keybindings. Currently, kakoune just doesn't recognize them. In searching around, I found a stackoverflow question for vim mentioning this - it seems like they aren't defined codes in ASCII.

Usecase

Two extra keys to attach useful commands to! In my case, I set ctrl-. as a keybinding in another editor, and already have useful muscle memory attached to it, so I'd ideally like to be able to use it in kakoune as well.

@SolitudeSF
Copy link
Contributor

terminals cant differentiate ctrl-dot/comma and dot/comma

@Screwtapello
Copy link
Contributor

Kakoune runs inside a terminal, and (as the StackOverflow question you link to mentions) there's no traditional terminal sequence for <c-.> or <c-,>. If the terminal doesn't send anything to Kakoune when you press those keys, there's nothing Kakoune can do about it.

However, some terminals can be configured to send "CSI u" codes for keys without a traditional terminal sequence, and Kakoune understands those keys out of the box. The only terminal I know of that sends those codes is xterm, and only with a specific custom configuration:

XTerm*modifyOtherKeys:  1
XTerm*formatOtherKeys:  1

If you're not using xterm, your terminal emulator may support custom mappings or macros. If it does, you should be able to configure <c-,> to send the magic string ^[[44;5u and <c-.> to send ^[[46;5u (where ^[ means the "ESC" control character, ASCII code 0x1B, not the ^ and [ characters) and then they should Just Work in Kakoune.

Alternatively, the keystrokes <a-,> and <a-.> are supported by Kakoune in any terminal. <a-.> is actually a default keybinding, but not a commonly used one, so not much of an inconvenience.

@lenormf
Copy link
Contributor

lenormf commented Jan 11, 2021

Related #3912

@vbauerster
Copy link
Contributor

Related #2209

@vbauerster
Copy link
Contributor

It works in kitty out of the box.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants