I often use isearch (C-s
normally or /
in evil) and then want to use that query (or part of it) for replacing. This answer explains how to cycle history, but M-p
cycles the history for each mode separately so I don't see isearch queries from query-replace.
Ideally, the query I used for either search is automatically saved and I can use a key binding to insert the query into a buffer or minibuffer.
Example: search for "fib-function", C-h f
and insert "fib-function" for help, or helm-do-grep to search for it in files, or just insert it into the current file to start defining it.
helm-minibuffer-history
that shows all inputs. and bind it to a key inisearch-mode-map
.(define-key isearch-mode-map (kbd "C-u") 'helm-minibuffer-history)
causes my entire buffer to be replaced with whatever I select from the history (and I can only select the first item). Also, I can't use that to insert into helm:helm: Error: Trying to run helm within a running helm session
.(define-key isearch-mode-map (kbd "C-c C-l") 'helm-minibuffer-history)
if it works. Are you using Spacemacs? Also, if you see a Helm buffer that gives you a list of strings, it's working as expected. Select an item from the list and pressRET
. Then the input will be inserted into the minibuffer./
to start isearch. I get the same result with that map: I get a helm buffer giving a list of strings separated by ----, but I can't type to narrow down the list and I can't use C-j to move down the list. Typing anything narrows the list to helm-minibuffer-history (the first item in the list). Then my buffer is replaced with helm-minibuffer-history.