]> git.donarmstrong.com Git - lib.git/blobdiff - emacs_el/configuration/don-configuration.org
add terraform/tofu emacs mode
[lib.git] / emacs_el / configuration / don-configuration.org
index b52cc342bcb054dba9b8c1856e7458dc7b7ceeeb..5ce392a92b618989df7a4b70c59788dba40322f3 100644 (file)
@@ -440,6 +440,9 @@ value, scrolling continues until there is no more output.
             (yas-reload-all)
             )
   )
+(use-package yasnippet-snippets
+  :ensure t
+  )
 #+END_SRC
 *** Auto-YASnippet
 #+BEGIN_SRC emacs-lisp
@@ -504,7 +507,7 @@ value, scrolling continues until there is no more output.
            lsp-ui-doc-delay 2)
   :hook (lsp-mode . lsp-ui-mode)
   :bind (:map lsp-ui-mode-map
-             ("c-c i" . lsp-ui-imenu)))
+             ("C-c i" . lsp-ui-imenu)))
 #+END_SRC
 *** LSP Pyright -- Python language server
 #+BEGIN_SRC emacs-lisp
@@ -572,7 +575,6 @@ value, scrolling continues until there is no more output.
 ;; load tinyprocmail
 (use-package tinyprocmail
   :straight (tinytools :type git :type git :host github :repo "jaalto/project--emacs-tiny-tools")
-  ; :load-path "~/lib/emacs_el/tiny-tools/lisp/tiny"
   :mode (".procmailrc" . turn-on-tinyprocmail-mode)
   )
 #+END_SRC
@@ -1039,10 +1041,31 @@ _d_: subtree
 #+BEGIN_SRC emacs-lisp
 (use-package reftex
   :hook ((LaTeX-mode latex-mode) . reftex-mode)
+  :hook (org-mode . my-org-mode-setup)
+  :after org
   :config
   (setq-default reftex-default-bibliography
-                  '("~/projects/research/references.bib"))
+                '("~/projects/research/references.bib"))
   (setq-default reftex-plug-into-AUCTeX t)
+  (defun org-mode-reftex-search ()
+    (interactive)
+    (org-open-link-from-string (format "[[notes:%s]]" (first (reftex-citation t)))))
+  (defun my-org-mode-setup ()
+    (and (buffer-file-name)
+         (file-exists-p (buffer-file-name))
+         (progn
+           ;; (reftex-parse-all)
+           (reftex-set-cite-format
+            '((?b . "[[bib:%l][%l-bib]]")
+              (?n . "[[notes:%l][%l-notes]]")
+              (?c . "\\cite{%l}")
+              (?h . "*** %t\n:PROPERTIES:\n:Custom_ID: %l\n:END:\n[[papers:%l][%l xoj]] [[papers-pdf:%l][pdf]]")))
+           ))
+    (define-key org-mode-map (kbd "C-c )") 'reftex-citation)
+    (define-key org-mode-map (kbd "C-c [") 'reftex-citation)
+    (define-key org-mode-map (kbd "C-c (") 'org-mode-reftex-search)
+    (define-key org-mode-map (kbd "C-c 0") 'reftex-view-crossref)
+    )
   )
 #+END_SRC
 ** BibTex
@@ -1247,7 +1270,7 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori
    :straight nil
    :delight
    :init
-   (setq outline-minor-mode-prefix "C-c C-2")
+   ; (setq outline-minor-mode-prefix nil)
    :config
    (define-prefix-command 'cm-map nil "Outline-")
    (global-set-key "\M-o" cm-map)
@@ -1490,9 +1513,12 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori
 ** Beancount
 #+BEGIN_SRC emacs-lisp
 (use-package beancount
-  :straight nil
+  :straight (beancount
+             :type git
+             :host github
+             :repo "cnsunyour/beancount.el")
   :load-path "~/lib/emacs_el/beancount-mode/"
-  :mode "\\.beancount\\'"
+  :mode "\\.bean\\(?:count\\)?\\'"
   
   )
 #+END_SRC
@@ -1512,6 +1538,20 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori
   )
 #+END_SRC
 
+** Terraform/Tofu
+#+BEGIN_SRC emacs-lisp
+(use-package terraform-mode
+  :delight 🍜
+  :custom (terraform-indent-level 4)
+  :config
+  (defun my-terraform-mode-init ()
+    ;; if you want to use outline-minor-mode
+    (outline-minor-mode 1)
+    )
+  (add-hook 'terraform-mode-hook 'my-terraform-mode-init)
+  )
+#+END_SRC
+
 * Email
 ** Mutt
 *** Message-mode
@@ -1571,21 +1611,14 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori
 (use-package mutt-mode
   :mode "muttngrc"
   :mode "muttrc"
+  :config
+  (setq mutt-alias-file-list (quote ("~/.mutt/aliases" "~/.mail_aliases")))
 )
 #+END_SRC
 *** Set mail User agent
 #+BEGIN_SRC emacs-lisp
 (setq mail-user-agent (quote sendmail-user-agent))
 #+END_SRC
-*** Mail aliases
-#+BEGIN_SRC emacs-lisp
-; (use-package
-;   :straight t
-;   :hook message
-;   :config
-;   (setq mutt-alias-file-list (quote ("~/.mutt/aliases" "~/.mail_aliases")))
-; )
-#+END_SRC
 * Base emacs
 ** Reverting buffers
 #+BEGIN_SRC emacs-lisp
@@ -1716,7 +1749,7 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori
   ; org mode agenda files
   (setq org-agenda-files
         (append
-        (file-expand-wildcards "~/projects/org-notes/*.org")
+        (directory-files "~/projects/org-notes/" 1 "^[^.#].+\.org$")
         (file-expand-wildcards "~/org-mode/from-mobile.org")
         (file-expand-wildcards "~/org-notes-*/*.org")
         )
@@ -2030,28 +2063,6 @@ Maildir, or by Message-ID."
 ;; add support for "mutt:ID" links
 (org-add-link-type "mutt" 'open-mail-in-mutt)
 
-(defun my-org-mode-setup ()
-  ; (load-library "reftex")
-  (and (buffer-file-name)
-       (file-exists-p (buffer-file-name))
-       (progn
-         ; (reftex-parse-all)
-         (reftex-set-cite-format
-          '((?b . "[[bib:%l][%l-bib]]")
-            (?n . "[[notes:%l][%l-notes]]")
-            (?c . "\\cite{%l}")
-            (?h . "*** %t\n:PROPERTIES:\n:Custom_ID: %l\n:END:\n[[papers:%l][%l xoj]] [[papers-pdf:%l][pdf]]")))
-         ))
-  (define-key org-mode-map (kbd "C-c )") 'reftex-citation)
-  (define-key org-mode-map (kbd "C-c [") 'reftex-citation)
-  (define-key org-mode-map (kbd "C-c (") 'org-mode-reftex-search)
-  (define-key org-mode-map (kbd "C-c 0") 'reftex-view-crossref)
-  )
-(add-hook 'org-mode-hook 'my-org-mode-setup)
-
-(defun org-mode-reftex-search ()
-  (interactive)
-  (org-open-link-from-string (format "[[notes:%s]]" (first (reftex-citation t)))))
 
 (defun open-research-paper (bibtexkey)
   "Open a paper by bibtex key"
@@ -2623,6 +2634,15 @@ same directory as the org-buffer and insert a link to this file."
   (setq debian-changelog-mailing-address "don@debian.org")
   (setq debian-changelog-full-name "Don Armstrong"))
 #+END_SRC
+** dpkg-dev-el (debian/control and others)
+#+BEGIN_SRC emacs-lisp
+(use-package dpkg-dev-el
+  :ensure dpkg-dev-el
+  :mode ("debian/control" . debian-control-mode)
+  :mode ("debian/.*README.*Debian$" . readme-debian-mode)
+  :mode ("^/usr/share/doc/.*/README.*Debian.*$" . readme-debian-mode)
+)
+#+END_SRC
 * Misc (uncharacterized)
 #+BEGIN_SRC emacs-lisp
   (setq calendar-latitude 38.6)