What's a nice way to display all snippets available to yasnippet to the current major mode?
Asked
Active
Viewed 6,585 times
5 Answers
44
this command shows the snippets and keys
m-x yas/describe-tables

kindahero
- 5,817
- 3
- 25
- 32
-
1@Tass please update your yas package https://github.com/capitaomorte/yasnippet/downloads – kindahero Apr 14 '12 at 20:11
-
FYI in 2020 yasnippet has a new home - https://github.com/joaotavora/yasnippet – BinaryButterfly Oct 26 '20 at 11:00
16
yas/describe-tables
is an alias for yas-describe-tables
in yasnippet.el.
(yas/describe-tables &optional CHOOSE)
This function is obsolete since yasnippet 0.8;
use yas-describe-tables
instead.
Display snippets for each table.

Sulthan Allaudeen
- 11,330
- 12
- 48
- 63

Slava Ignatyev
- 181
- 1
- 4
6
Are you looking for M-x yas/insert-snippet
? It will list all available snippets and you can choose one of them to insert.

Julian Qian
- 696
- 5
- 8
5
(defvar lawlist-context-menu-map
(let ((map (make-sparse-keymap "Context Menu")))
(define-key map [help-for-help] (cons "Help" 'help-for-help))
(define-key map [seperator-two] '(menu-item "--"))
(define-key map [my-menu] (cons "LAWLIST" (make-sparse-keymap "My Menu")))
(define-key map [my-menu 01] (cons "Next Line" 'next-line))
(define-key map [my-menu 02] (cons "Previous Line" 'previous-line))
(define-key map [seperator-one] '(menu-item "--"))
map) "Keymap for the LAWLIST context menu.")
(defun lawlist-popup-context-menu (event &optional prefix)
"Popup a context menu."
(interactive "@e \nP")
(define-key lawlist-context-menu-map [lawlist-major-mode-menu]
`(menu-item ,(symbol-name major-mode)
,(mouse-menu-major-mode-map) :visible t))
(define-key lawlist-context-menu-map (vector major-mode)
`(menu-item ,(concat "YAS " (symbol-name major-mode))
,(gethash major-mode yas--menu-table)
:visible (yas--show-menu-p ',major-mode)))
(popup-menu lawlist-context-menu-map event prefix))
(global-set-key [mouse-3] 'lawlist-popup-context-menu)

hjpotter92
- 78,589
- 36
- 144
- 183

lawlist
- 13,099
- 3
- 49
- 158
2
If you are using company mode for autocompletion you can also call company-yasnippet
to show all available snippets in the company interface.

fap
- 663
- 1
- 5
- 14