Created
October 10, 2016 03:20
-
-
Save takaxp/8604aa8660be93edd3b89df811851c64 to your computer and use it in GitHub Desktop.
Disable yas-expand if the cursor is in orgmode's source block
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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