Skip to content

Instantly share code, notes, and snippets.

@takaxp
Created October 10, 2016 03:20
Show Gist options
  • Save takaxp/8604aa8660be93edd3b89df811851c64 to your computer and use it in GitHub Desktop.
Save takaxp/8604aa8660be93edd3b89df811851c64 to your computer and use it in GitHub Desktop.
Disable yas-expand if the cursor is in orgmode's source block
(defun my:yas-expand (&optional field)
"Disable `yas-expand' in src-block."
(interactive)
(if (and (equal major-mode 'org-mode)
(org-in-src-block-p t)
(not (and (fboundp 'org-src-edit-buffer-p)
(org-src-edit-buffer-p))))
(org-cycle)
(yas-expand field)))
(define-key yas-minor-mode-map (kbd "<tab>") 'my:yas-expand)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment