From 4c50defbd7bc761078020465f74ab4e86cba6612 Mon Sep 17 00:00:00 2001 From: Ryan Kavanagh Date: Fri, 22 Apr 2016 09:47:13 -0400 Subject: Add sass-mode, latex wrapping to emacs --- .emacs | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/.emacs b/.emacs index 7da0e75..56d4bef 100644 --- a/.emacs +++ b/.emacs @@ -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)) -- cgit v1.2.3