user2767553
user2767553

Reputation: 73

How to set global key C-x

I want to set all C-x command to be M-x so I can keep my thumb in my left hand on ALT button. But what is the function which C-h and C-x run? Thanks.

Upvotes: 3

Views: 260

Answers (2)

alexis
alexis

Reputation: 50190

Control-X is bound to the function Control-X-prefix, which is a keymap (a table associating keystrokes with commands).

So to set \M-x to work like \C-x, just do the following:

(define-key global-map "\M-x" 'Control-X-prefix)

All that said, instead of rebinding emacs I would recommend that you look into remapping your keyboard: Many window managers (X11, OS X and many Windows set-ups included) give you ways to customize various modifier keys (e.g., turning Left-Alt into another Control.) Look into them, you may find a set up you like.

Upvotes: 4

Drew
Drew

Reputation: 30701

Use C-x C-h to see the C-x bindings. Load help-fns+.el and use C-h M-k with ctl-x-map and help-map to see all bindings for C-x and C-h.

Upvotes: 0

Related Questions