I'm trying to add a key binding to ido-find-file, so that it calls deadgrep from the current directory. Similar to how pressing C-d from ido-find-file calls dired.

The problem is that both deadgrep and ido-find-file use the minibuffer, producing the error "Command attempted to use minibuffer while in minibuffer."

The code I'm using to assign a new key binding (C-s) to ido-find-file is this:

(add-hook 'ido-setup-hook
          (lambda ()
            (define-key ido-completion-map (kbd "C-s") 'deadgrep)))

Any ideas about how to actually call deadgrep (or any other command that uses the minubuffer) from within ido-find-file?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.