Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there any emacs key combinations reserved for custom commands?

Tags:

emacs

elisp

If I want to create a custom key combination to run a command, are there any keyboard shortcuts reserved for this? I always find it difficult to decide on which shortcut to override because I'm not sure what commands I shouldn't override and which commands plugins I may install in the future will try to set.

like image 880
Jason Baker Avatar asked Jul 17 '09 16:07

Jason Baker


People also ask

What keys does Emacs use for special commands?

All told, the prefix keys in Emacs are C-c , C-h , C-x , C-x RET , C-x @ , C-x a , C-x n , C-x r , C-x v , C-x 4 , C-x 5 , C-x 6 , ESC , M-g and M-j .

How do I set Keybinds in Emacs?

emacs file. To interactively bind keys for all modes, type M-x global-set-key RET key cmd RET . To bind a key just in the current major mode, type M-x local-set-key RET key cmd RET .

What is key binding in Emacs?

Key Bind CommandsDefines a key against a keyboard map. Use this if you want to change a keymap that isn't the current buffer map. (local-set-key KEY COMMAND) Binds a key to the local keymap used by the active buffer, unlike define-key which takes an explicit keymap to bind a key against.

What is RET key in Emacs?

"RET" is the Return key while emacs runs in a terminal. and run emacs in terminal, your keybinding will have no effect. But the problem is, by binding (kbd "RET") , you are also binding (kbd "C-m") , regardless you run emacs in terminal or GUI.


1 Answers

I would suggest using unbound. It was made for just this type of scenario.

Once you have it required in your emacs config, typing the following will list possible unbound keys for your customization:

M-x describe-unbound-keys

It asks for a complexity level (I generally just use 5) for the key combination depending on how convenient (less options) or esoteric (more options) a key binding you are interested it.

like image 177
jjames Avatar answered Oct 17 '22 06:10

jjames