Skip to content

Commit

Permalink
upgrade yasnippet/org integration
Browse files Browse the repository at this point in the history
  • Loading branch information
sigma committed Oct 7, 2012
1 parent 4cebb26 commit 7909228
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions _emacs.d/config/yasnippet-config.el
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,19 @@
;;

;;; Code:
(eval-when-compile (require 'yasnippet))

(defun yas/org-very-safe-expand ()
(let ((yas/fallback-behavior 'return-nil)) (yas/expand)))

(when (request 'yasnippet)
(make-variable-buffer-local 'yas/trigger-key)
(yas/initialize)
(yas-global-mode 1)

(yas/define-snippets 'nxhtml-mode nil 'html-mode)
(defun yas-org-very-safe-expand ()
(let ((yas-fallback-behavior 'return-nil)) (yas-expand)))

(add-hook 'org-mode-hook
(lambda ()
;; yasnippet (using the new org-cycle hooks)
(setq yas/trigger-key [tab])
(add-to-list 'org-tab-first-hook 'yas/org-very-safe-expand)
(define-key yas/keymap [tab] 'yas/next-field))))
(make-variable-buffer-local 'yas-trigger-key)
(setq yas-trigger-key [tab])
(add-to-list 'org-tab-first-hook 'yas-org-very-safe-expand)
(define-key yas-keymap [tab] 'yas-next-field))))

(provide 'yasnippet-config)
;;; yasnippet-config.el ends here

0 comments on commit 7909228

Please sign in to comment.