diff options
Diffstat (limited to 'emacs/.emacs.d/init/ycp-markup.el')
-rw-r--r-- | emacs/.emacs.d/init/ycp-markup.el | 50 |
1 files changed, 45 insertions, 5 deletions
diff --git a/emacs/.emacs.d/init/ycp-markup.el b/emacs/.emacs.d/init/ycp-markup.el index e03fd86..68b5459 100644 --- a/emacs/.emacs.d/init/ycp-markup.el +++ b/emacs/.emacs.d/init/ycp-markup.el @@ -71,8 +71,12 @@ (my-package wiki (my-keybind wiki-mode-map "C-'" #'my-wiki-grok-wikipedia) - (my-setq-from-local wiki-sites) - (wiki-define-site-commands)) + (my-setq-from-local wiki-sites wiki-local-dir) + (wiki-define-site-commands) + (add-to-list 'browse-url-handlers + `(wiki-engine-entry-url-p + . ,(lambda (url &rest _) (wiki-open-url url)))) + ) (my-package ledger-mode (:install t) @@ -83,17 +87,44 @@ (setq-local completion-cycle-threshold t) (setq-local ledger-complete-in-steps t) (setq-local company-mode nil))) - (setq ledger-binary-path "hledger")) + (setq ledger-binary-path "hledger") + (require 'my-ledger) + (my-keybind ledger-mode-map + "M-<down>" #'my-ledger-move-xact-down + "M-<up>" #'my-ledger-move-xact-up + "C-c C-c" #'compile) + (add-to-list 'compilation-error-regexp-alist 'ledger) + (add-to-list 'compilation-error-regexp-alist-alist my-ledger-compilation-error-re) + (add-hook 'ledger-mode-hook 'my-ledger-set-compile-command) + ) ;;; 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) + ;; No fill, so it requires visual line mode to look nice + (setq nov-text-width t) + (add-hook 'nov-mode-hook 'visual-line-mode) + ;; interfering with dbus + ;; (add-hook 'nov-mode-hook 'follow-mode) + (add-hook 'nov-mode-hook (lambda () + (setq line-spacing .1))) + (add-hook 'nov-post-html-render-hook 'my-nov-set-margins) (require 'my-nov) (my-override nov-render-title) (my-override nov-scroll-up) + (my-keybind nov-mode-map + "Q" #'my-nov-copy-buffer-file-with-staging + "i" #'imenu + "f" #'nov-scroll-up + "b" #'nov-scroll-down + "F" #'my-nov-skim-forward + "B" #'my-nov-skim-backward) + (add-to-list 'nov-shr-rendering-functions '(span . my-nov-render-span)) + (add-to-list 'nov-shr-rendering-functions '(ol . my-nov-render-ol)) + (add-hook 'nov-mode-hook + (lambda () + (add-hook 'post-command-hook #'my-nov-update-mode-line nil t))) ) ;;; json-mode @@ -104,5 +135,14 @@ (add-hook 'json-mode-hook 'my-json-setup-hook) ) +(my-package mhtml-mode + (my-keybind mhtml-mode-map + "C-c C-v" #'my-html-render)) + +(my-package my-markup + (:delay 15) + (add-to-list 'auto-mode-alist '("\\.html\\'" . htmlv-mode)) + ) + (provide 'ycp-markup) ;;; ycp-markup.el ends here |