emacs: improve tex-mode list workflows
authorAmin Bandali <bandali@gnu.org>
Tue, 3 Sep 2019 16:07:06 +0000 (12:07 -0400)
committerAmin Bandali <bandali@gnu.org>
Tue, 3 Sep 2019 16:07:06 +0000 (12:07 -0400)
type ā€˜oā€™ followed by space for enumerate (ordered list), and ā€˜uā€™
folloewd by space for itemize (unordered list); insert new \item with
M-RET

.emacs.d/etc/yasnippet/snippets/latex-mode/enumerate
.emacs.d/etc/yasnippet/snippets/latex-mode/item [deleted file]
.emacs.d/etc/yasnippet/snippets/latex-mode/item-li [deleted file]
.emacs.d/etc/yasnippet/snippets/latex-mode/itemize
.emacs.d/init.el

index df51892..bcb1df1 100644 (file)
@@ -1,7 +1,7 @@
 # -*- mode: snippet -*-
 # name: enumerate
-# key: ol
+# key: o
 # --
 \begin{enumerate}
-$0
+\item $0
 \end{enumerate}
\ No newline at end of file
diff --git a/.emacs.d/etc/yasnippet/snippets/latex-mode/item b/.emacs.d/etc/yasnippet/snippets/latex-mode/item
deleted file mode 100644 (file)
index d4773f5..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-# -*- mode: snippet -*-
-# name: item
-# key: -
-# --
-\item $0
\ No newline at end of file
diff --git a/.emacs.d/etc/yasnippet/snippets/latex-mode/item-li b/.emacs.d/etc/yasnippet/snippets/latex-mode/item-li
deleted file mode 100644 (file)
index 1bc93b5..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-# -*- mode: snippet -*-
-# name: item-li
-# key: li
-# type: command
-# --
-(yas-expand-snippet (yas-lookup-snippet "item"))
\ No newline at end of file
index eb97984..b7a6949 100644 (file)
@@ -1,7 +1,7 @@
 # -*- mode: snippet -*-
 # name: itemize
-# key: ul
+# key: u
 # --
 \begin{itemize}
-$0
+\item $0
 \end{itemize}
\ No newline at end of file
index 2063aab..b6b27c6 100644 (file)
@@ -1442,8 +1442,7 @@ This function is intended for use with `ivy-ignore-buffers'."
    (lambda (p) (string-match "^---?" (car p)))
    tex--prettify-symbols-alist)
   :hook ((tex-mode . auto-fill-mode)
-         (tex-mode . flyspell-mode)
-         (tex-mode . (lambda () (electric-indent-local-mode -1)))))
+         (tex-mode . flyspell-mode)))
 
 \f
 ;;; Theme