I use yasnippet to insert some symbols (e.g., ✔), and I would like to do that in minibuffer too. When I press TAB in minibuffer, it said " is undefined". How to define it to use yasnippet? Is it safe to do that?


Bind TAB or whatever to whatever command you want (e.g. some yasnippet command) in the minibuffer keymaps.

See (elisp) Text from Minibuffer and Completion Commands for info about the minibuffer keymaps.

  • Thanks for the pointers. Let me add more details and codes I got. – AhLeung Nov 10 '17 at 8:57

After adding the following 3 lines of code, I can use my snippets defined in org-mode, by pressing TAB inside minibuffer:

(add-hook 'minibuffer-setup-hook 'yas-minor-mode)

(yas--define-parents 'minibuffer-inactive-mode '(org-mode))

(define-key minibuffer-local-map [tab] 'yas-expand)

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.