MiniBuffer

The minibuffer is a special buffer for entering commands or input arguments to commands. It appears either in a separate, standalone frame or at the bottom of each frame.

Sometimes, the area where you input commands is used to display informative messages without requesting input (i.e., not just a prompt). When this area is used this way, it is called the EchoArea, not the minibuffer.

In many respects, the minibuffer is a buffer like any other: You can edit the text you are inputting there. Most editing KeySequences are available for this, including SearchingTheMinibuffer. It’s also possible to resize the minibuffer.

Everything you enter in the minibuffer using ‘RET’ (commands, input arguments) is added to a MinibufferHistory. There are generally different histories for the names of different object types that you enter: files, buffers, commands… You can retrieve names from the currently used history to edit and reuse.

To cancel whatever you’re doing in the minibuffer, use ‘C-g’. To cancel minibuffer if your focus is in another window, try the command ‘abort-recursive-edit’ which by default is bound to `C-]’.

Because by default the minibuffer window height is short, it can be difficult to click inside it with the mouse. If you have a lot of windows, switching to the minibuffer might take many uses of ‘C-x o’ (‘other-window’). If you have non-‘nil’ ‘enable-recursive-minibuffers’ then you might need to switch to the minibuffer more often.

The following command returns the focus to the minibuffer, no matter which window is currently selected.

(defun switch-to-minibuffer ()
  "Switch to minibuffer window."
  (interactive)
  (if (active-minibuffer-window)
      (select-window (active-minibuffer-window))
    (error "Minibuffer is not active")))

(global-set-key "\C-co" 'switch-to-minibuffer) ;; Bind to `C-c o'

But if you use a standalone minibuffer frame, that is, a single frame that has the only minibuffer for all frames (and has only the minibuffer), then you will likely need to modify the above code so that it invokes ‘select-frame-set-input-focus’. That gives the input focus to a particular frame, in this case the minibuffer frame.


CategoryGlossary CategoryWindows