Skip to content

Instantly share code, notes, and snippets.

@kiwanami
Created December 21, 2010 15:42
Show Gist options
  • Save kiwanami/750077 to your computer and use it in GitHub Desktop.
Save kiwanami/750077 to your computer and use it in GitHub Desktop.

Revisions

  1. kiwanami created this gist Dec 21, 2010.
    24 changes: 24 additions & 0 deletions ac-yas-expand-conf.el
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    ;;; yasnippet and auto-complete

    (defvar ac-yas-expand-autostart-backup nil "保存用")

    (defun ac-yas-expand-start ()
    "yasnippet展開開始時にはACを止める"
    (setq ac-yas-expand-autostart-backup ac-auto-start)
    (setq ac-auto-start nil))

    (defun ac-yas-expand-end ()
    "yasnippet展開終了時にACを再開させる"
    (setq ac-auto-start ac-yas-expand-autostart-backup))

    (defun ac-yas-expand-install ()
    (interactive)
    (add-hook 'yas/before-expand-snippet-hook 'ac-yas-expand-start)
    (add-hook 'yas/after-exit-snippet-hook 'ac-yas-expand-end))

    (defun ac-yas-expand-uninstall ()
    (interactive)
    (remove-hook 'yas/before-expand-snippet-hook 'ac-yas-expand-start)
    (remove-hook 'yas/after-exit-snippet-hook 'ac-yas-expand-end))

    (ac-yas-expand-install)