You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wrote a toggle-hide-cloze-brackets function for those of us who use their actual notes as flashcards and want to keep it readable.
(setq cloze-expression-keyword
;; group 0 is the cloze expression in curly brackets
;; group 1 is the actual contents of the cloze, without the hints, brackets and @1 etc
'((
"^.*\\({{\\(.*\\)}@.*}\\).*$"
;; The previous regex was the anchor, this is the real hightlight
"{{\\|}}\\|}\\({[^}]+}\\)?@[0-9]*}"
(goto-char (match-beginning 0))
nil
(0 (put-text-property (match-beginning 0) (match-end 0) 'display "")))))
(setq hide-cloze-brackets 1)
(defun toggle-hide-cloze-brackets()
(interactive)
(if hide-cloze-brackets
(progn
(font-lock-remove-keywords 'org-mode cloze-expression-keyword)
(setq hide-cloze-brackets nil))
(progn
(font-lock-add-keywords 'org-mode cloze-expression-keyword)
(setq hide-cloze-brackets 1))
)
(org-mode-restart))
The text was updated successfully, but these errors were encountered:
I wrote a toggle-hide-cloze-brackets function for those of us who use their actual notes as flashcards and want to keep it readable.
The text was updated successfully, but these errors were encountered: