2012-04-14 35 views

回答

30

此命令顯示片段和鍵

m-x yas/describe-tables 
+0

此功能不存在。 – Reactormonk 2012-04-14 18:18:31

+1

@Tass請更新您的yas包https://github.com/capitaomorte/yasnippet/downloads – kindahero 2012-04-14 20:11:10

5

您是在查找M-x yas/insert-snippet?它會列出所有可用的片段,您可以選擇其中的一個插入。

8

yas/describe-tables是在yasnippet.el.

用於yas-describe-tables一個別名(亞斯/描述桌&可選CHOOSE)

該功能是因爲yasnippet過時0.8;

改爲使用yas-describe-tables

顯示每個表格的片段。

1
(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) 

Example http://www.lawlist.com/images/context-menu.png


參見下面的鏈接相關的例子:https://stackoverflow.com/a/24346990/2112489