How do I enter the minibuffer for editing in Emacs?

When certain commands are run, the mini-buffer prompts for input lines (e.g. CMs).

Sometimes I need to inject complex strings into the minibuffer. So I need to use move commands like Cf, Cb, Ca, etc. However, this doesn't work when I enter a line inside the command C-M-s.

So what is the general command / key bindings for me to focus on in the mini-buffer for advanced motion support?


Edit:

I just discovered that Me will work for finding commands. But I'm not sure if this command is a generic command "switch from buffer to minibuffer for special editing"

+3


source to share


2 answers


  • Yes, M-e

    this is what you are looking for if you want to edit your search string. It allows you to do general editing. Just press C-s

    or C-M-s

    again when you're ready to search for the edited line.

  • However, it M-e

    is only intended for editing the search string. If, instead, you want to interrupt isearch to do any editing somewhere, then simply end the search for it, and then resume isearch when you are done editing, using C-s

    or again C-M-s

    .



+3


source


I was happy to use them and I bind them to the function button and arrow keys on my Mac keyboard. I often block and copy text and move in and out of the mini-buffer. The following example frees up some of the keyboard assignments in minibuffer-local-map

and minibuffer-local-completion-map

(that is, by setting them to nil

) so that I can use my own custom keyboard shortcuts to enter and exit the minibuffer.

Inside the minibuffer, you can use C-h k

and then enter a keyboard shortcut to see which function is associated.



When I turn the minibuffer window on and off, I use a custom function that changes the mode line color and the minibuffer prompt color and the default color inside the minibuffer, but that is outside the scope of your question. [I just add the name of my minibuffer color change function at the end of the following four functions: i.e. After if / then statements.]

(defun lawlist-windmove-right ()
(interactive)
  (if (window-in-direction 'right)
    (select-window (window-in-direction 'right))
    (other-window 1)))

(defun lawlist-windmove-left ()
(interactive)
  (if (window-in-direction 'left)
    (select-window (window-in-direction 'left))
    (other-window -1)))

(defun lawlist-windmove-up ()
(interactive)
  (if (window-in-direction 'above)
    (select-window (window-in-direction 'above))
    (other-window 1)))

(defun lawlist-windmove-down ()
(interactive)
  (if (window-in-direction 'below)
    (select-window (window-in-direction 'below))
    (other-window -1)))

(define-key minibuffer-local-map [prior] nil)
(define-key minibuffer-local-map [next] nil)
(define-key minibuffer-local-map [home] nil)
(define-key minibuffer-local-map [end] nil)
(define-key minibuffer-local-completion-map [prior] nil)
(define-key minibuffer-local-completion-map [next] nil)
(define-key minibuffer-local-completion-map [home] nil)
(define-key minibuffer-local-completion-map [end] nil) 

(global-set-key (kbd "<end>") 'lawlist-windmove-right)

(global-set-key (kbd "<home>") 'lawlist-windmove-left)

(global-set-key (kbd "<prior>") 'lawlist-windmove-up)

(global-set-key (kbd "<next>") 'lawlist-windmove-down)

      

+1


source







All Articles