How to turn off alternative Enter with Ctrl+M in Linux

前端 未结 8 841
广开言路
广开言路 2021-02-04 06:37

Why is Ctrl+M bound to Enter in Ubuntu Jaunty? How to turn it off?

I\'m using Emacs and would like to bind Ctrl+M to some other command.

8条回答
  •  北海茫月
    2021-02-04 07:11

    Actually, this is a very tricky question, you won't get it right with: (global-set-key (kbd "") 'newline)

    because that return (RET) is newline in just some particular cases. You will see the weirdness I'm talking about if you try that in your .emacs

    I've found an ugly but working solution by using some KDE events application, and bound Ctrl+m to Ctrl+1 . I've chosen that because I wouldn't use that combination (Ctrl+1) but you can choose something else. This way, in emacs (but in my X environment) I don't get the RET (or linefeed character) when I press Ctrl+m, instead I get Ctrl+1. And then, I did something like: (global-set-key "\C-1" 'mycmd)

    The problem is, that now I use awesome window manager, and I don't know how to do that X mapping again. If you don't use KDE, you search for something similar in Gnome.

提交回复
热议问题