aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.emacs38
1 files changed, 38 insertions, 0 deletions
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))