开发者

Keyboard shortcut completion help in emacs?

开发者 https://www.devze.com 2022-12-16 04:06 出处:网络
I was wondering if there is anything in emacs which will help me remember keyboard shortcuts? For example, if I press C-x and then press some key (say TAB), emacs sh开发者_StackOverflow中文版ould all

I was wondering if there is anything in emacs which will help me remember keyboard shortcuts?

For example, if I press C-x and then press some key (say TAB), emacs sh开发者_StackOverflow中文版ould all possible combinations of C-X and other keys to give an emacs command (and also show what the command does)?


There is a simpler way to do this than C-h m. You can see all the combinations you need by pressing C-h. Let me explain with an example. Say you want to run the command org-narrow-to-subtree, which in my case is bound to C-x n s I remember that I have to type C-x n but don't remember the next part. I can type C-x n C-h and emacs will show me the following:

Global Bindings Starting With C-x n:
key             binding
---             -------

C-x n d     narrow-to-defun
C-x n n     narrow-to-region
C-x n p     narrow-to-page
C-x n r     narrow-to-region
C-x n s     org-narrow-to-subtree
C-x n w     widen

[back]

So in your case, to see all possibilities after C-x, just type C-x C-h


You can use C-h m to list and describe all active keybindings in current buffer (depending on your active major and minor modes).


Not a complete answer but partial:

  • The Emacs user manual has a key index which lists all the key sequences (Emacs' preferred term for what you call keyboard shortcuts).
  • C-x C-h opens a buffer listing key sequences beginning C-x.
  • C-h k followed by a key sequence describes the key sequence.
  • C-h K followed by a key sequence takes you to the right page of the user manual.


I think one-key is what's your looking for One key


In Icicles you have key completion, which is just about what you described.

You know the help that is offered when you hit a prefix key and then C-h -- e.g. C-x C-h? Well that's just help, and it works only for certain prefixes.

What this Icicles feature is about is actually completing key sequences: hit C-x, then S-TAB to complete, and every possible completion of prefix key C-x is displayed -- just pick one.

If the candidate you picked is itself a prefix key (e.g. you picked r, so so far you're up to C-x r, which is still incomplete), then you pick another piece of the sequence, and so on, until the key sequence is complete (and its command is invoked).

See also:

  • You can complete key sequences too.

  • Which keys can I use now, and what do they do?

0

精彩评论

暂无评论...
验证码 换一张
取 消