2019-10-14 17:38:14 +02:00
|
|
|
;;; misc.el --- Miscellaneous file formats. -*- lexical-binding: t; -*-
|
|
|
|
|
2020-03-27 18:05:15 +01:00
|
|
|
;; Time-stamp: <2020-03-27T18:05:06+0100>
|
2019-10-14 17:38:14 +02:00
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
2020-03-18 15:00:17 +01:00
|
|
|
(require 'basics/package-management)
|
2019-10-14 17:38:14 +02:00
|
|
|
(require 'text/common)
|
|
|
|
|
|
|
|
(use-package conf-mode
|
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)
|
|
|
|
("\\.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))
|
|
|
|
:hook (crontab-mode . (lambda () (auto-fill-mode -1)))) ; No word-wrapping.
|
2019-10-14 17:38:14 +02:00
|
|
|
|
|
|
|
(use-package nginx-mode
|
2020-03-27 18:05:15 +01:00
|
|
|
:defer t) ; Why defer?
|
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))))
|
|
|
|
(markup-secondary-text-face ((t (:inherit markup-gen-face :height 1.0
|
|
|
|
:foreground "firebrick"))))
|
|
|
|
(markup-hide-delimiter-face ((t (:inherit markup-meta-face))))
|
|
|
|
(markup-meta-hide-face ((t (:inherit markup-meta-face))))
|
|
|
|
;; Style code snippets (``)
|
|
|
|
(markup-verbatim-face ((t (:background "gray5"))))
|
|
|
|
|
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
|
|
|
|
"8/:[dD[aA][tT][eE]: +%Y-%02m-%02d\n")))
|
|
|
|
(adoc-mode . yas-minor-mode))) ; Enable yasnippets.
|
2019-10-14 17:38:14 +02:00
|
|
|
|
|
|
|
(use-package markdown-mode
|
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-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
|
|
|
|
2020-03-27 18:05:15 +01:00
|
|
|
;; Insert pseudo latin text.
|
2019-11-20 18:28:25 +01:00
|
|
|
(use-package lorem-ipsum)
|
|
|
|
|
2019-11-29 01:57:06 +01:00
|
|
|
;; Document editing, formatting, and organizing mode.
|
|
|
|
(use-package org
|
2020-02-18 16:37:40 +01:00
|
|
|
:commands (org-mode)
|
2020-03-27 18:05:15 +01:00
|
|
|
:custom (org-support-shift-select t) ; Make shift behave normally on text.
|
|
|
|
:bind (:map org-mode-map ; Remove some annoying keybindings.
|
|
|
|
("M-<left>" . nil)
|
|
|
|
("M-<right>" . nil)
|
|
|
|
("M-<up>" . nil)
|
|
|
|
("M-<down>" . nil)
|
|
|
|
("M-S-<left>" . nil)
|
|
|
|
("M-S-<right>" . nil)
|
|
|
|
("M-S-<up>" . nil)
|
|
|
|
("M-S-<down>" . nil)))
|
2019-11-29 01:57:06 +01:00
|
|
|
|
2020-01-26 21:46:17 +01:00
|
|
|
(use-package sendmail
|
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-03-27 18:05:15 +01:00
|
|
|
:mode ("\\.qrc" . nxml-mode))
|
2020-02-25 05:20:50 +01:00
|
|
|
|
2019-10-14 17:38:14 +02:00
|
|
|
(provide 'text/misc)
|
|
|
|
;;; misc.el ends here
|