0

I understand that <C-W> is backward-kill-word and I have bound this to shiftBS and it works.

But now I want to bind <C-U> to cmdBS. Is this possible? If so, how can I do this?

7
  • Does this sequence produce a key code that can be detected by Vim? If you go into Insert mode in Vim and type Ctrl+V followed by Cmd-Backspace, does it actually insert anything? You might need to configure your O.S. and your terminal to get them to send a key code for this key all the way to Vim. – filbranden Jan 6 at 14:40
  • 2
    BTW, Ctrl+W and Ctrl+U are more or less universal on Unix. They will work in all shells and generally everything that takes any input from the keyboard. Rather than trying to override them everywhere, you should consider adopting them and getting used to them. – filbranden Jan 6 at 14:42
  • 1
    Wait, do you want Ctrl-U to send Command-BS, or vice-versa? You wrote the former, but I suspect the latter – D. Ben Knoble Jan 6 at 14:49
  • @filbranden: I doesn't generate anything, I also checked how to define it in Terminal Preference > Profiles > Keyboard, but there it has option, control, shift but no command... – job_start Jan 6 at 14:51
  • 1
    I'm not surprised... That's the usual on Mac, the Command key is usually reserved for Mac-specific shortcuts and application-specific shortcuts and Unix-like terminals usually only use Control and Alt/Meta/Option, so it's not that surprising that it's not offering you to map a combination that includes Command... – filbranden Jan 6 at 14:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.