2019-10-14 17:38:14 +02:00
|
|
|
;;; misc.el --- Miscellaneous file formats. -*- lexical-binding: t; -*-
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
2020-03-18 15:00:17 +01:00
|
|
|
(require 'basics/package-management)
|
2020-12-07 20:40:17 +01:00
|
|
|
(require 'basics/buffers)
|
2020-12-08 14:10:01 +01:00
|
|
|
(require 'misc/completion)
|
|
|
|
(require 'text/common)
|
2019-10-14 17:38:14 +02:00
|
|
|
|
|
|
|
(use-package conf-mode
|
2020-12-07 20:35:13 +01:00
|
|
|
:straight (:type built-in)
|
2020-03-27 18:05:15 +01:00
|
|
|
:mode (("^/etc/conf\\.d/" . conf-mode) ; openrc config.
|
|
|
|
("^/etc/portage/package\\.use/" . conf-space-mode) ; Portage config.
|
|
|
|
("^/etc/portage/package\\.accept_keywords/" . conf-space-mode)
|
2020-04-24 15:10:31 +02:00
|
|
|
("^/etc/portage/package\\.mask/" . conf-space-mode)
|
|
|
|
("^/etc/portage/package\\.unmask/" . conf-space-mode)
|
2020-12-07 20:36:24 +01:00
|
|
|
("^/etc/portage/package\\.license" . conf-space-mode)
|
2020-04-24 15:10:31 +02:00
|
|
|
("package\\.mask$" . conf-space-mode) ; In ebuild repos.
|
2020-03-27 18:05:15 +01:00
|
|
|
("\\.pc\\(\\.in\\)?$" . conf-mode) ; pkg-config files.
|
|
|
|
("conanfile\\.txt$" . conf-mode))) ; Conan recipes.
|
2019-10-14 17:38:14 +02:00
|
|
|
|
|
|
|
(use-package crontab-mode
|
2020-03-27 18:05:15 +01:00
|
|
|
;; Shrink minutes to normal size.
|
|
|
|
:custom-face (outline-1 ((t (:inherit outline-1 :height 1.0))))
|
|
|
|
:mode (("/cron\\.d/" . crontab-mode)
|
|
|
|
("^'/etc/crontab$" . crontab-mode))
|
2020-12-13 10:33:20 +01:00
|
|
|
:hook (crontab-mode . turn-off-auto-fill)) ; No word-wrapping.
|
2019-10-14 17:38:14 +02:00
|
|
|
|
2020-05-24 22:59:31 +02:00
|
|
|
(use-package nginx-mode)
|
2019-10-14 17:38:14 +02:00
|
|
|
|
|
|
|
(use-package company-nginx
|
2020-02-18 17:18:57 +01:00
|
|
|
:after (nginx-mode company)
|
2020-03-27 18:05:15 +01:00
|
|
|
:hook (nginx-mode . company-nginx-keywords))
|
2019-10-14 17:38:14 +02:00
|
|
|
|
|
|
|
(use-package yaml-mode
|
2020-03-27 18:05:15 +01:00
|
|
|
:mode ("\\.yml$" . yaml-mode)
|
|
|
|
:hook (yaml-mode . my/truncate-lines))
|
2019-10-14 17:38:14 +02:00
|
|
|
|
2020-02-18 16:37:40 +01:00
|
|
|
(use-package mediawiki
|
2020-03-27 18:05:15 +01:00
|
|
|
:commands (mediawiki-mode))
|
2019-10-14 17:38:14 +02:00
|
|
|
|
|
|
|
(use-package csv-mode
|
2020-03-27 18:05:15 +01:00
|
|
|
:mode ("\\.[Cc][Ss][Vv]$" . csv-mode))
|
2019-10-14 17:38:14 +02:00
|
|
|
|
|
|
|
(use-package adoc-mode
|
|
|
|
:custom-face
|
|
|
|
;; Style headers.
|
|
|
|
(markup-title-0-face ((t (:inherit markup-gen-face :height 1.4
|
|
|
|
:weight bold))))
|
|
|
|
(markup-title-1-face ((t (:inherit markup-gen-face :height 1.3
|
|
|
|
:weight bold))))
|
|
|
|
(markup-title-2-face ((t (:inherit markup-gen-face :height 1.2
|
|
|
|
:weight bold))))
|
|
|
|
(markup-title-3-face ((t (:inherit markup-gen-face :height 1.1
|
|
|
|
:weight bold))))
|
|
|
|
(markup-title-4-face ((t (:inherit markup-gen-face :height 1.0
|
|
|
|
:weight bold
|
|
|
|
:underline t))))
|
|
|
|
(markup-title-5-face ((t (:inherit markup-gen-face :height 1.0
|
|
|
|
:weight bold))))
|
|
|
|
;; Enlarge meta-data to the same size as the other text.
|
|
|
|
(markup-meta-face ((t (:inherit font-lock-comment-face))))
|
2020-04-17 05:04:56 +02:00
|
|
|
(markup-secondary-text-face ((t (:inherit markup-gen-face :height 1.0))))
|
2019-10-14 17:38:14 +02:00
|
|
|
(markup-hide-delimiter-face ((t (:inherit markup-meta-face))))
|
|
|
|
(markup-meta-hide-face ((t (:inherit markup-meta-face))))
|
2020-04-17 05:04:56 +02:00
|
|
|
|
|
|
|
:config (set-face-background 'markup-verbatim-face ; Inline code.
|
|
|
|
(face-background 'hl-line))
|
2019-10-14 17:38:14 +02:00
|
|
|
|
2020-03-27 18:05:15 +01:00
|
|
|
:mode ("\\.adoc$" . adoc-mode)
|
|
|
|
:hook ((adoc-mode . auto-fill-mode) ; Wrap at fill-column.
|
|
|
|
(adoc-mode . (lambda () ; Automatically update date.
|
|
|
|
(setq-local time-stamp-pattern
|
2020-04-17 05:04:56 +02:00
|
|
|
"8/:[dD][aA][tT][eE]: +%Y-%02m-%02d\n")))
|
2020-03-27 18:05:15 +01:00
|
|
|
(adoc-mode . yas-minor-mode))) ; Enable yasnippets.
|
2019-10-14 17:38:14 +02:00
|
|
|
|
|
|
|
(use-package markdown-mode
|
2020-11-29 09:11:03 +01:00
|
|
|
:after (hl-line)
|
2020-03-27 18:05:15 +01:00
|
|
|
:custom (markdown-command "cmark")
|
2019-10-14 17:38:14 +02:00
|
|
|
:custom-face
|
|
|
|
;; Style headers.
|
|
|
|
(markdown-header-face-1 ((t (:inherit markdown-header-face :height 1.4
|
|
|
|
:weight bold))))
|
|
|
|
(markdown-header-face-2 ((t (:inherit markdown-header-face :height 1.3
|
|
|
|
:weight bold))))
|
|
|
|
(markdown-header-face-3 ((t (:inherit markdown-header-face :height 1.2
|
|
|
|
:weight bold))))
|
|
|
|
(markdown-header-face-4 ((t (:inherit markdown-header-face :height 1.1
|
|
|
|
:weight bold))))
|
|
|
|
(markdown-header-face-5 ((t (:inherit markdown-header-face :height 1.0
|
|
|
|
:weight bold :underline t))))
|
|
|
|
(markdown-header-face-6 ((t (:inherit markdown-header-face :height 1.0
|
|
|
|
:weight bold))))
|
|
|
|
(markdown-header-face-7 ((t (:inherit markdown-header-face :height 1.0
|
|
|
|
:weight bold))))
|
|
|
|
|
2020-04-17 05:04:56 +02:00
|
|
|
:config (set-face-background 'markdown-code-face ; Won't work in :custom-face.
|
|
|
|
(face-background 'hl-line))
|
2020-03-27 18:05:15 +01:00
|
|
|
:mode (("README\\.md$" . gfm-mode)
|
|
|
|
("\\.md$" . gfm-mode)
|
|
|
|
("\\.markdown$" . gfm-mode))
|
|
|
|
:hook (markdown-mode . auto-fill-mode)) ; Wrap at fill-column.
|
2019-10-14 17:38:14 +02:00
|
|
|
|
2019-11-29 01:57:06 +01:00
|
|
|
;; Document editing, formatting, and organizing mode.
|
|
|
|
(use-package org
|
2020-11-18 18:38:55 +01:00
|
|
|
:straight (:type built-in)
|
2020-10-05 18:39:49 +02:00
|
|
|
:defer 4
|
2020-04-17 05:28:08 +02:00
|
|
|
:defines (org-default-notes-file)
|
2020-10-05 18:40:36 +02:00
|
|
|
:commands (org-mode org-agenda)
|
2020-10-05 18:00:37 +02:00
|
|
|
:custom ((org-default-notes-file "~/notes.org")
|
2020-08-24 03:52:57 +02:00
|
|
|
(org-startup-folded nil)
|
2020-10-05 18:01:26 +02:00
|
|
|
(org-latex-compiler "xelatex")
|
2020-10-07 18:50:11 +02:00
|
|
|
(org-agenda-files '("~/notes.org" "~/Dokumente/Videoserien.org"))
|
|
|
|
(org-blank-before-new-entry
|
2020-11-26 12:06:43 +01:00
|
|
|
'((heading . nil) (plain-list-item . auto)))
|
|
|
|
(org-agenda-show-all-dates nil)
|
|
|
|
(org-agenda-span (* 30.5 6)))
|
2020-05-04 20:43:07 +02:00
|
|
|
:config (progn (set-face-attribute 'org-level-1 nil :height 1.4)
|
2020-07-03 06:25:56 +02:00
|
|
|
(set-face-attribute 'org-level-2 nil :height 1.2)
|
|
|
|
(org-babel-do-load-languages 'org-babel-load-languages
|
|
|
|
'((emacs-lisp . t)
|
|
|
|
(shell . t)
|
2020-07-08 18:14:53 +02:00
|
|
|
(C .t)))
|
2020-07-28 23:40:54 +02:00
|
|
|
(add-to-list 'org-modules 'org-tempo) ; Templates (<s).
|
|
|
|
(put 'org-confirm-babel-evaluate
|
2020-08-16 19:49:36 +02:00
|
|
|
'safe-local-variable #'booleanp)
|
|
|
|
(require 'ox-md))
|
2020-07-29 16:15:41 +02:00
|
|
|
:hook (org-mode . (lambda () ; Automatically update date.
|
|
|
|
(setq-local
|
|
|
|
time-stamp-pattern
|
|
|
|
"8/#\\+[dD][aA][tT][eE]: <+%Y-%02m-%02d %H:%M>")))
|
2020-04-17 01:23:29 +02:00
|
|
|
:bind (("C-c o" . (lambda () (interactive) ; Open notes.
|
|
|
|
(find-file org-default-notes-file)))
|
2020-11-26 12:06:43 +01:00
|
|
|
("C-c a" . org-agenda)
|
2020-04-17 01:23:29 +02:00
|
|
|
(:map org-mode-map ; Remove some annoying keybindings.
|
|
|
|
("M-<left>" . nil)
|
2020-10-04 23:45:57 +02:00
|
|
|
("C-c M-<left>" . org-metaleft)
|
2020-04-17 01:23:29 +02:00
|
|
|
("M-<right>" . nil)
|
2020-10-04 23:45:57 +02:00
|
|
|
("C-c M-<right>" . org-metaright)
|
2020-04-17 01:23:29 +02:00
|
|
|
("M-<up>" . nil)
|
2020-10-04 23:45:57 +02:00
|
|
|
("C-c M-<up>" . org-metaup)
|
2020-04-17 01:23:29 +02:00
|
|
|
("M-<down>" . nil)
|
2020-10-04 23:45:57 +02:00
|
|
|
("C-c M-<down>" . org-metadown)
|
2020-04-17 01:23:29 +02:00
|
|
|
("M-S-<left>" . nil)
|
2020-10-04 23:45:57 +02:00
|
|
|
("C-c M-S-<left>" . org-shiftmetaleft)
|
2020-04-17 01:23:29 +02:00
|
|
|
("M-S-<right>" . nil)
|
2020-10-04 23:45:57 +02:00
|
|
|
("C-c M-S-<right>" . org-shiftmetaright)
|
2020-04-17 01:23:29 +02:00
|
|
|
("M-S-<up>" . nil)
|
2020-10-04 23:45:57 +02:00
|
|
|
("C-c M-S-<up>" . org-shiftmetaup)
|
2020-04-17 01:23:29 +02:00
|
|
|
("M-S-<down>" . nil)
|
2020-10-04 23:45:57 +02:00
|
|
|
("C-c M-S-<down>" . org-shiftmetadown)
|
2020-04-17 01:23:29 +02:00
|
|
|
("S-<left>" . nil)
|
2020-10-04 23:45:57 +02:00
|
|
|
("C-c S-<left>" . org-shiftleft)
|
2020-04-17 01:23:29 +02:00
|
|
|
("S-<right>" . nil)
|
2020-10-04 23:45:57 +02:00
|
|
|
("C-c S-<right>" . org-shiftright)
|
2020-04-17 01:23:29 +02:00
|
|
|
("S-<up>" . nil)
|
2020-10-04 23:45:57 +02:00
|
|
|
("C-c S-<up>" . org-shiftup)
|
2020-04-17 01:46:12 +02:00
|
|
|
("S-<down>" . nil)
|
2020-10-04 23:45:57 +02:00
|
|
|
("C-c S-<down>" . org-shiftdown)
|
2020-04-17 01:46:12 +02:00
|
|
|
("C-S-<left>" . nil)
|
2020-10-04 23:45:57 +02:00
|
|
|
("C-c C-S-<left>" . org-shiftcontrolleft)
|
2020-04-17 01:46:12 +02:00
|
|
|
("C-S-<right>" . nil)
|
2020-10-04 23:45:57 +02:00
|
|
|
("C-c C-S-<right>" . org-shiftcontrolright)
|
2020-04-17 01:46:12 +02:00
|
|
|
("C-S-<up>" . nil)
|
2020-10-04 23:45:57 +02:00
|
|
|
("C-c C-S-<up>" . org-shiftcontrolup)
|
|
|
|
("C-S-<down>" . nil)
|
2020-11-26 12:06:43 +01:00
|
|
|
("C-c C-S-<down>" . org-shiftcontroldown))))
|
2019-11-29 01:57:06 +01:00
|
|
|
|
2020-05-04 20:44:00 +02:00
|
|
|
(use-package org-bullets
|
|
|
|
:after org
|
|
|
|
:hook (org-mode . org-bullets-mode))
|
|
|
|
|
2020-11-18 18:32:47 +01:00
|
|
|
(use-package ox-asciidoc
|
|
|
|
:after org
|
|
|
|
:hook (org-mode . (lambda () (require 'ox-asciidoc))))
|
|
|
|
|
2020-01-26 21:46:17 +01:00
|
|
|
(use-package sendmail
|
2020-12-07 20:35:13 +01:00
|
|
|
:straight (:type built-in)
|
2020-03-27 18:05:15 +01:00
|
|
|
:mode ("/.claws-mail/tmp/tmpmsg\\." . mail-mode) ; claws-mail messages.
|
|
|
|
:hook (mail-mode . (lambda () (set-fill-column 72))))
|
2020-01-26 21:46:17 +01:00
|
|
|
|
2020-02-25 05:20:50 +01:00
|
|
|
;; Open more file extensions in nxml-mode.
|
|
|
|
(use-package nxml
|
2020-12-07 20:35:13 +01:00
|
|
|
:straight (:type built-in)
|
2020-03-27 18:05:15 +01:00
|
|
|
:mode ("\\.qrc" . nxml-mode))
|
2020-02-25 05:20:50 +01:00
|
|
|
|
2020-04-19 13:53:51 +02:00
|
|
|
;; Syntax highlighting for docker files.
|
|
|
|
(use-package dockerfile-mode
|
|
|
|
:mode ("Dockerfile$" . dockerfile-mode))
|
|
|
|
|
2020-05-19 04:07:48 +02:00
|
|
|
(use-package ebuild-mode
|
2020-12-07 16:29:59 +01:00
|
|
|
:straight nil ; Only install if not installed by OS.
|
|
|
|
:init (unless (fboundp 'ebuild-mode)
|
2020-05-20 07:54:04 +02:00
|
|
|
(straight-use-package
|
|
|
|
'(ebuild-mode
|
2020-05-20 08:05:07 +02:00
|
|
|
:host nil
|
2020-05-20 07:54:04 +02:00
|
|
|
:repo "https://anongit.gentoo.org/git/proj/ebuild-mode.git")))
|
2020-05-19 04:07:48 +02:00
|
|
|
:hook (ebuild-mode . (lambda () (set-fill-column 80))))
|
|
|
|
|
2020-05-29 09:42:15 +02:00
|
|
|
;; Syntax-highlighting mode for text/gemini.
|
|
|
|
(use-package gemini-mode
|
2020-12-13 10:33:20 +01:00
|
|
|
:hook (gemini-mode . turn-off-auto-fill))
|
2020-05-29 09:42:15 +02:00
|
|
|
|
2020-07-07 04:37:55 +02:00
|
|
|
;; udev rule files.
|
|
|
|
(use-package udev-mode)
|
|
|
|
|
2020-10-14 21:37:07 +02:00
|
|
|
;; i3 configuration files.
|
2020-12-07 20:37:02 +01:00
|
|
|
(use-package i3wm-config-mode)
|
2020-10-14 21:37:07 +02:00
|
|
|
|
2019-10-14 17:38:14 +02:00
|
|
|
(provide 'text/misc)
|
|
|
|
;;; misc.el ends here
|