aboutsummaryrefslogtreecommitdiff
path: root/emacs/.emacs.d/init/ycp-markup.el
diff options
context:
space:
mode:
authorYuchen Pei <id@ypei.org>2023-06-17 17:20:29 +1000
committerYuchen Pei <id@ypei.org>2023-06-17 17:20:29 +1000
commit093ffa5fbf7143f4668bb0a3dc9659a5cc836e12 (patch)
tree1ed4e14b2a43b8e338f4ad6a04d969b99b9239be /emacs/.emacs.d/init/ycp-markup.el
parentabc686827ae38ee715d9eed1c5c29161c74127e6 (diff)
Moving things one level deeper
To ease gnu stow usage. Now we can do stow -t ~ emacs
Diffstat (limited to 'emacs/.emacs.d/init/ycp-markup.el')
-rw-r--r--emacs/.emacs.d/init/ycp-markup.el97
1 files changed, 97 insertions, 0 deletions
diff --git a/emacs/.emacs.d/init/ycp-markup.el b/emacs/.emacs.d/init/ycp-markup.el
new file mode 100644
index 0000000..c001131
--- /dev/null
+++ b/emacs/.emacs.d/init/ycp-markup.el
@@ -0,0 +1,97 @@
+;;; ycp-markup.el -- My config for markup formats -*- lexical-binding: t -*-
+
+;; Copyright (C) 2023 Free Software Foundation.
+
+;; Author: Yuchen Pei <id@ypei.org>
+;; Package-Requires: ((emacs "28.2"))
+
+;; This file is part of dotfiles.
+
+;; dotfiles is free software: you can redistribute it and/or modify it under
+;; the terms of the GNU Affero General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; dotfiles is distributed in the hope that it will be useful, but WITHOUT
+;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General
+;; Public License for more details.
+
+;; You should have received a copy of the GNU Affero General Public
+;; License along with dotfiles. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; My config for markup formats.
+
+;;; Code:
+
+
+
+;;; parsing and formatting markup and serialization languages: html, markdown,
+;;; xml, yaml, etc.
+;;; Some parts adapted from prot-dotfiles
+(my-package shr
+ (:delay 30)
+ (advice-add 'shr-heading :around #'my-shr-add-id-advice)
+ (setq shr-use-colors nil)
+ (setq shr-use-fonts nil)
+ (setq shr-max-image-proportion 0.6)
+ (setq shr-image-animate nil)
+ (setq shr-width fill-column)
+ (setq shr-max-width fill-column)
+ (setq shr-discard-aria-hidden t)
+ (setq shr-cookie-policy nil)
+ )
+
+(my-package tex-mode
+ (:delay 60)
+ (setq latex-run-command "pdflatex")
+ (setq tex-print-file-extension ".pdf"))
+
+(my-package texinfo
+ (:delay 60)
+ (my-keybind texinfo-mode-map "C-c C-c" #'makeinfo-buffer))
+
+(my-package yaml-mode
+ (:delay 60)
+ (:install t)
+ (add-to-list 'auto-mode-alist '("\\.yml\\'" . yaml-mode))
+ (add-hook 'yaml-mode-hook #'display-line-numbers-mode))
+
+;;; markdown
+(my-package markdown-mode
+ (:delay 60)
+ (my-keybind markdown-mode-map "C-c C-l" 'markdown-insert-link)
+ (setq markdown-hide-urls t)
+ (put 'markdown-translate-filename-function 'safe-local-variable 'functionp)
+ (require 'my-markdown)
+ (my-keybind markdown-mode-map "<ret>" 'my-markdown-maybe-follow-thing-at-point))
+
+;; mediawiki
+(my-package mediawiki (:delay 60))
+
+(my-package ledger-mode
+ (:install t)
+ (:delay 60)
+ (add-hook 'ledger-mode-hook
+ (lambda ()
+ (setq-local tab-always-indent 'complete)
+ (setq-local completion-cycle-threshold t)
+ (setq-local ledger-complete-in-steps t)
+ (setq-local company-mode nil)))
+ (setq ledger-binary-path "hledger"))
+
+;;; todo: open epub in emacs client with nov
+(my-package nov
+ (:delay 15)
+ (add-to-list 'auto-mode-alist '("\\.epub\\'" . nov-mode))
+ (setq nov-text-width fill-column)
+ (add-hook 'nov-mode-hook 'follow-mode)
+ (require 'my-nov)
+ (my-override nov-render-title)
+ (my-override nov-scroll-up)
+ )
+
+(provide 'ycp-markup)
+;;; ycp-markup.el ends here