If you're like me, you'll usually have a lot of buffers open in
quickly switch between them, you press
C-x b (
b), and type
the beginning of buffer name. This is made much more convenient with
ido (see Switching Buffers) or
icicles. They allow you switch to a
buffer by typing just some characters appearing anywhere in the buffer name,
The question for today is: what to do if am not searching for a buffer or file, but for some emacs command?
Often, I search for a certain command, ie. the ones that come after
M-x. After typing
M-x there's autocompletion if you know the beginning
of the command… but maybe I remember only it was something with
but exactly how? Was it
For these deep problems, there is smex (think: search-M-x).
ido-style completion to choosing commands.
(setq smex-save-file "~/.emacs.d/smex.save") ;; keep my ~/ clean (require 'smex) (smex-initialize) (global-set-key (kbd "M-X") 'smex)
As you can see, I have set the keybinding to
M-X, that is (for most people)
Alt-Shift-x; of course you could override the normal
execute-extended-command', note the small
x), but usually the normal
completion is fine.
smex serves a niche use-case, but I still use it a couple of
times a day.
[ Note that packages like
anything can do similar things; they
do much more as well, and I haven't had the chance to play with those in
detail, so for the time being I stay with