Skip to content

Instantly share code, notes, and snippets.

@vermiculus
Last active December 17, 2015 13:28
Show Gist options
  • Save vermiculus/5616995 to your computer and use it in GitHub Desktop.
Save vermiculus/5616995 to your computer and use it in GitHub Desktop.
Provides functionality for diff-friendly, phrase-based TeX editing by inserting comment characters smartly
(local-set-key
(kbd "RET")
(lambda () (interactive)
(if (= 37 (char-before (1- (point))))
(progn (delete-backward-char 2) (TeX-newline) (TeX-newline))
(if (= 10 (char-before (1- (point))))
(progn (TeX-newline) (indent-for-tab-command))
(if (= 10 (char-before))
(progn (insert "%") (TeX-newline))
(progn (TeX-newline) (indent-for-tab-command)))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment