diff options
author | Ryan Kavanagh <rak@debian.org> | 2016-04-22 09:47:13 -0400 |
---|---|---|
committer | Ryan Kavanagh <rak@debian.org> | 2016-04-22 09:47:13 -0400 |
commit | 4c50defbd7bc761078020465f74ab4e86cba6612 (patch) | |
tree | ba87e9d8c183f58f5f390baa632ce56734c2c187 | |
parent | Updated screenlayout for zeta (diff) |
Add sass-mode, latex wrapping to emacs
-rw-r--r-- | .emacs | 38 |
1 files changed, 38 insertions, 0 deletions
@@ -62,6 +62,8 @@ :ensure t) (use-package yaml-mode :ensure t) +(use-package sass-mode + :ensure t) ;;;; AUTO FILL ; We want auto-fill enabled for all text modes @@ -149,3 +151,39 @@ (fset 'yes-or-no-p 'y-or-n-p) (put 'narrow-to-region 'disabled nil) + +(defun my-fill-latex-paragraph () + "Fill the current paragraph, separating sentences w/ a newline. + +AUCTeX's latex.el reimplements the fill functions and is *very* +convoluted. We use part of it --- skip comment par we are in." + (interactive) + (if (save-excursion + (beginning-of-line) (looking-at TeX-comment-start-regexp)) + (TeX-comment-forward) + (let ((to (progn + (LaTeX-forward-paragraph) + (point))) + (from (progn + (LaTeX-backward-paragraph) + (point))) + (to-marker (make-marker))) + (set-marker to-marker to) + (while (< from (marker-position to-marker)) + (forward-sentence) + (setq tmp-end (point)) + (LaTeX-fill-region-as-paragraph from tmp-end) + (setq from (point)) + (unless (bolp) + (LaTeX-newline)))))) + +(eval-after-load "latex" + '(define-key LaTeX-mode-map (kbd "C-M-q") 'my-fill-latex-paragraph)) + +(windmove-default-keybindings) +(setq windmove-wrap-around t) + +; align-regexp should use spaces. +(defadvice align-regexp (around align-regexp-with-spaces activate) + (let ((indent-tabs-mode nil)) + ad-do-it)) |