diff options
Diffstat (limited to 'emacs/.emacs.d/init')
-rw-r--r-- | emacs/.emacs.d/init/ycp-basic.el | 8 | ||||
-rw-r--r-- | emacs/.emacs.d/init/ycp-buffer.el | 6 | ||||
-rw-r--r-- | emacs/.emacs.d/init/ycp-client.el | 3 | ||||
-rw-r--r-- | emacs/.emacs.d/init/ycp-complete.el | 3 | ||||
-rw-r--r-- | emacs/.emacs.d/init/ycp-editing.el | 5 | ||||
-rw-r--r-- | emacs/.emacs.d/init/ycp-emms.el | 13 | ||||
-rw-r--r-- | emacs/.emacs.d/init/ycp-gnus.el | 4 | ||||
-rw-r--r-- | emacs/.emacs.d/init/ycp-grep.el | 1 | ||||
-rw-r--r-- | emacs/.emacs.d/init/ycp-help.el | 3 | ||||
-rw-r--r-- | emacs/.emacs.d/init/ycp-markup.el | 28 | ||||
-rw-r--r-- | emacs/.emacs.d/init/ycp-org.el | 8 | ||||
-rw-r--r-- | emacs/.emacs.d/init/ycp-prog.el | 4 | ||||
-rw-r--r-- | emacs/.emacs.d/init/ycp-reading.el | 34 | ||||
-rw-r--r-- | emacs/.emacs.d/init/ycp-theme.el | 1 | ||||
-rw-r--r-- | emacs/.emacs.d/init/ycp-time.el | 4 | ||||
-rw-r--r-- | emacs/.emacs.d/init/ycp-web.el | 18 |
16 files changed, 123 insertions, 20 deletions
diff --git a/emacs/.emacs.d/init/ycp-basic.el b/emacs/.emacs.d/init/ycp-basic.el index 6baf1b8..313004f 100644 --- a/emacs/.emacs.d/init/ycp-basic.el +++ b/emacs/.emacs.d/init/ycp-basic.el @@ -27,6 +27,12 @@ ;;; Code: +;;; If started from systemd, emacs treats env variables inside env +;;; variables as literal. e.g. if we have +;;; Environment=PATH=$HOME/.local/bin:$HOME/bin +;;; emacs will set exec-path to be literally +;;; $HOME/.local/bin:$HOME/bin, without expanding $HOME. +(setq exec-path (seq-map 'substitute-in-file-name exec-path)) (my-configure (my-keybind global-map @@ -56,7 +62,7 @@ (my-package my-utils (:delay 5) (my-setq-from-local my-audio-incoming-dir my-video-incoming-dir - my-document-incoming-dir) + my-music-incoming-dir my-document-incoming-dir) (my-setq-from-local my-copy-file-targets) (my-keybind global-map "C-c <f2>" #'my-rename-file-and-buffer diff --git a/emacs/.emacs.d/init/ycp-buffer.el b/emacs/.emacs.d/init/ycp-buffer.el index 944a45e..6a560ea 100644 --- a/emacs/.emacs.d/init/ycp-buffer.el +++ b/emacs/.emacs.d/init/ycp-buffer.el @@ -50,7 +50,7 @@ (my-configure (:delay 15) (my-keybind ctl-x-x-map - "f" #'follow-mode ; override `font-lock-update' + ;; "f" #'follow-mode ; override `font-lock-update' "r" #'rename-uniquely "l" #'visual-line-mode) @@ -98,6 +98,9 @@ (my-package follow (:delay 15) + (require 'my-buffer) + ;; Disable follow mode + (my-override follow-mode) ;; TODO: update this to adapt to number of windows (my-keybind follow-mode-map "C-v" #'follow-scroll-up @@ -121,6 +124,7 @@ "r" #'next-buffer "d" nil "u" nil + "." nil "w" #'kill-ring-save "i" #'view-mode) (my-keybind global-map "C-`" #'view-mode)) diff --git a/emacs/.emacs.d/init/ycp-client.el b/emacs/.emacs.d/init/ycp-client.el index d35898c..16447fd 100644 --- a/emacs/.emacs.d/init/ycp-client.el +++ b/emacs/.emacs.d/init/ycp-client.el @@ -91,7 +91,8 @@ (:delay 60) (require 'my-utils) (setq my-ytdl-audio-download-dir my-audio-incoming-dir - my-ytdl-video-download-dir my-video-incoming-dir)) + my-ytdl-video-download-dir my-video-incoming-dir + my-ytdl-music-download-dir my-music-incoming-dir)) (my-package my-media-segment (:delay 60)) diff --git a/emacs/.emacs.d/init/ycp-complete.el b/emacs/.emacs.d/init/ycp-complete.el index 2caca0a..2f2117d 100644 --- a/emacs/.emacs.d/init/ycp-complete.el +++ b/emacs/.emacs.d/init/ycp-complete.el @@ -291,6 +291,9 @@ (my-package consult-recoll (:delay 30) (:install t) + (add-to-list 'consult-recoll-open-fns + '("application/pdf" . my-consult-recoll-open-in-pdf-tools)) + (setq consult-recoll-inline-snippets t) ) (my-package hmm diff --git a/emacs/.emacs.d/init/ycp-editing.el b/emacs/.emacs.d/init/ycp-editing.el index d497f42..031ae31 100644 --- a/emacs/.emacs.d/init/ycp-editing.el +++ b/emacs/.emacs.d/init/ycp-editing.el @@ -31,7 +31,10 @@ (setq-default truncate-lines nil) (setq kill-do-not-save-duplicates t) (setq kill-transform-function - (lambda (s) (when (string-match-p "[^ \t\n]" s) s))) + (lambda (s) (when (or + (derived-mode-p 'pdf-view-mode) + (string-match-p "[^ \t\n]" s)) + s))) (setq bidi-inhibit-bpa t) (setq save-interprogram-paste-before-kill t) (setq kill-ring-max 200) diff --git a/emacs/.emacs.d/init/ycp-emms.el b/emacs/.emacs.d/init/ycp-emms.el index 08c9d92..e49209f 100644 --- a/emacs/.emacs.d/init/ycp-emms.el +++ b/emacs/.emacs.d/init/ycp-emms.el @@ -34,6 +34,7 @@ (emms-all) (setq emms-playing-time-resume-from-last-played t) (add-to-list 'emms-info-functions 'emms-info-ytdl) + (add-to-list 'emms-info-functions 'my-emms-info-ffprobe) ;; emms-info-native is not very useful (delete 'emms-info-native emms-info-functions) (setq emms-source-file-default-directory (locate-user-emacs-file "emms")) @@ -46,6 +47,7 @@ (setq emms-source-file-directory-tree-function 'emms-source-file-directory-tree-find) (setq emms-info-ytdl-using-torsocks t) + (setq emms-info-auto-update nil) (add-hook 'emms-playlist-mode-hook #'hl-line-mode) (add-hook 'emms-metaplaylist-mode-hook #'hl-line-mode) ) @@ -81,8 +83,8 @@ "C-<return>" #'my-emms-playlist-mode-make-current "w" #'my-emms-playlist-kill-track-name-at-point "D" #'my-emms-playlist-delete-at-point - "R" #'my-emms-random-album - "N" #'my-emms-next-track-or-random-album + "R" #'my-emms-playlist-random-group + "N" #'my-emms-next-track-or-random-group ) (add-hook 'emms-player-started-hook 'my-emms-maybe-seek-to-last-played) (my-override emms-mode-line-enable) @@ -92,12 +94,17 @@ 'my-emms-output-current-track-to-i3bar-file) (add-hook 'emms-player-finished-hook 'my-emms-score-up-playing) (add-hook 'emms-player-started-hook 'my-emms-score-up-chosen-bonus) - (setq emms-player-next-function 'my-emms-next-track-or-random-album) + (add-hook 'emms-player-started-hook 'my-emms-playlist-maybe-mark-bounds) + (add-hook 'emms-player-started-hook 'my-emms-maybe-get-duration-for-current-track) + (setq emms-player-next-function 'my-emms-next-track-or-random-group) (setq emms-players-preference-f 'my-emms-players-preference) (my-keybind dired-mode-map "e" #'my-dired-add-to-emms) (my-override emms-track-simple-description) (my-emms-add-all) (my-timer emms-save-scores-timer nil 900 'emms-score-save-hash) + (my-override emms-mode-line-playlist-current) + (my-override emms-score-show-playing) + ;; (my-override emms-playing-time-mode-line) ) (provide 'ycp-emms) diff --git a/emacs/.emacs.d/init/ycp-gnus.el b/emacs/.emacs.d/init/ycp-gnus.el index 9e89ee9..7275363 100644 --- a/emacs/.emacs.d/init/ycp-gnus.el +++ b/emacs/.emacs.d/init/ycp-gnus.el @@ -94,7 +94,7 @@ (my-keybind global-map "C-c n i" #'my-gnus-open-inbox "C-c n n" #'my-gnus-start - "C-c n u" #'gnus-group-get-new-news) + "C-c n u" #'my-gnus-group-refresh) (my-server-timer my-gnus-new-news-timer nil 300 'my-gnus-group-get-new-news-quietly) ;; https://superuser.com/questions/519685/gnus-get-rid-of-mail-and-news-folders @@ -147,6 +147,8 @@ (my-package gnus-group (require 'my-gnus) (my-keybind gnus-group-mode-map + "g" #'my-gnus-group-refresh + "i" #'my-gnus-open-inbox "n" #'next-line "p" #'previous-line "m" #'my-gnus-group-compose diff --git a/emacs/.emacs.d/init/ycp-grep.el b/emacs/.emacs.d/init/ycp-grep.el index 85f15cd..f0ef8ce 100644 --- a/emacs/.emacs.d/init/ycp-grep.el +++ b/emacs/.emacs.d/init/ycp-grep.el @@ -107,6 +107,7 @@ ;;; org-recoll (my-package org-recoll (:delay 60) + (my-override org-recoll-format-results) (my-keybind org-recoll-mode-map "n" #'org-next-visible-heading "p" #'org-previous-visible-heading diff --git a/emacs/.emacs.d/init/ycp-help.el b/emacs/.emacs.d/init/ycp-help.el index 5cbbed0..98fa58c 100644 --- a/emacs/.emacs.d/init/ycp-help.el +++ b/emacs/.emacs.d/init/ycp-help.el @@ -44,7 +44,8 @@ ) (my-package info - ;; TODO consider using `Info-additional-directory-list' instead + ;; Can't `Info-additional-directory-list' - won't be used in + ;; `info-display-manual' somehow (add-to-list 'Info-directory-list (locate-user-emacs-file "info"))) (my-keybind global-map diff --git a/emacs/.emacs.d/init/ycp-markup.el b/emacs/.emacs.d/init/ycp-markup.el index 5f21da7..68b5459 100644 --- a/emacs/.emacs.d/init/ycp-markup.el +++ b/emacs/.emacs.d/init/ycp-markup.el @@ -71,7 +71,7 @@ (my-package wiki (my-keybind wiki-mode-map "C-'" #'my-wiki-grok-wikipedia) - (my-setq-from-local wiki-sites) + (my-setq-from-local wiki-sites wiki-local-dir) (wiki-define-site-commands) (add-to-list 'browse-url-handlers `(wiki-engine-entry-url-p @@ -105,15 +105,26 @@ ;; No fill, so it requires visual line mode to look nice (setq nov-text-width t) (add-hook 'nov-mode-hook 'visual-line-mode) - (add-hook 'nov-mode-hook 'follow-mode) + ;; interfering with dbus + ;; (add-hook 'nov-mode-hook 'follow-mode) (add-hook 'nov-mode-hook (lambda () - (setq next-screen-context-lines 4))) + (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) + "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 @@ -124,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 diff --git a/emacs/.emacs.d/init/ycp-org.el b/emacs/.emacs.d/init/ycp-org.el index 6385a46..77f720d 100644 --- a/emacs/.emacs.d/init/ycp-org.el +++ b/emacs/.emacs.d/init/ycp-org.el @@ -306,6 +306,7 @@ (setq org-clock-idle-time 15) (setq org-clock-mode-line-total 'auto) (setq org-clock-persist 'history) + (setq org-clock-continuously t) (org-clock-persistence-insinuate)) (my-package org-refile @@ -375,7 +376,7 @@ ("i" . my-org-append-subheading) ("^" . org-sort) ("w" . org-refile) - ("a" . org-archive-subtree-default-with-confirmation) + ("a" . org-archive-subtree-default) ("@" . org-mark-subtree) ("#" . org-toggle-comment) ("Clock Commands") @@ -450,7 +451,7 @@ ;; org man links (my-package ol-man (:delay 30) - (setq org-man-command 'woman)) + (setq org-man-command 'man)) (my-package ol (:delay 10) @@ -528,6 +529,9 @@ (require 'my-org-remark) (setq org-remark-notes-display-buffer-action '(display-buffer-reuse-mode-window)) + (setq org-remark-notes-file-name + (locate-user-emacs-file "margin.org")) + (my-override org-remark-highlight-add-or-update-highlight-headline) (require 'nov) (my-keybind nov-mode-map "M-n" #'org-remark-next diff --git a/emacs/.emacs.d/init/ycp-prog.el b/emacs/.emacs.d/init/ycp-prog.el index 3209e81..f74e339 100644 --- a/emacs/.emacs.d/init/ycp-prog.el +++ b/emacs/.emacs.d/init/ycp-prog.el @@ -210,6 +210,7 @@ (my-package my-prog (:delay 10) (my-keybind global-map "C-c 8" #'my-set-tab-width-to-8) + (my-keybind prog-mode-map "C-c M-w" 'my-copy-with-func) (add-hook 'c-mode-hook 'my-c-set-compile-command) (define-key c-mode-map (kbd "C-c s") 'my-c-switch-between-header-and-source) (define-key c++-mode-map (kbd "C-c s") @@ -550,7 +551,8 @@ ;;; nxml (my-package nxml-mode (:delay 60) - (setq nxml-slash-auto-complete-flag t)) + (setq nxml-slash-auto-complete-flag t) + (add-to-list 'auto-mode-alist '("\\.opf\\'" . nxml-mode))) (my-package etags (:delay 60) diff --git a/emacs/.emacs.d/init/ycp-reading.el b/emacs/.emacs.d/init/ycp-reading.el new file mode 100644 index 0000000..5c0284e --- /dev/null +++ b/emacs/.emacs.d/init/ycp-reading.el @@ -0,0 +1,34 @@ +;;; ycp-reading.el -- Reading related customisation -*- lexical-binding: t -*- + +;; Copyright (C) 2025 Free Software Foundation, Inc. + +;; Author: Yuchen Pei <id@ypei.org> +;; Package-Requires: ((emacs "29.4")) + +;; This file is part of dotted. + +;; dotted 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. + +;; dotted 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 dotted. If not, see <https://www.gnu.org/licenses/>. + +;;; Commentary: + +;; Reading related customisation. + +;;; Code: + +(my-package belf + (my-setq-from-local belf-dir belf-locate-dirs) + (add-hook 'find-file-hook 'belf-recent-add-current) + (blink-cursor-mode 0)) + +(provide 'ycp-reading) diff --git a/emacs/.emacs.d/init/ycp-theme.el b/emacs/.emacs.d/init/ycp-theme.el index ee76311..c6721ed 100644 --- a/emacs/.emacs.d/init/ycp-theme.el +++ b/emacs/.emacs.d/init/ycp-theme.el @@ -41,6 +41,7 @@ 'normal :weight 'normal :height 150 :width 'normal) (set-face-attribute 'fixed-pitch nil :family "Ubuntu Mono" :foundry "DAMA" :slant 'normal :weight 'normal :height 150 :width 'normal) +(set-face-attribute 'variable-pitch nil :family "Ubuntu" :foundry "DAMA") (provide 'ycp-theme) ;;; ycp-theme.el ends here diff --git a/emacs/.emacs.d/init/ycp-time.el b/emacs/.emacs.d/init/ycp-time.el index f98a9cd..f21061c 100644 --- a/emacs/.emacs.d/init/ycp-time.el +++ b/emacs/.emacs.d/init/ycp-time.el @@ -83,7 +83,7 @@ (holiday-fixed 1 26 "Australia Day (Vic holiday)") (holiday-float 3 1 2 "Labour Day (Vic holiday)") (holiday-fixed 4 25 "Anzac Day (Vic holiday)") - (holiday-float 6 1 2 "Monarch's Birthday (Vic oliday)") + (holiday-float 6 1 2 "Monarch's Birthday (Vic holiday)") (holiday-fixed 6 30 "End of financial year") (holiday-float 9 5 -1 "(Possibly) Friday before the AFL Grand Final (Vic holiday)") (holiday-float 10 5 1 "(Possibly) Friday before the AFL Grand Final (Vic holiday)") @@ -123,7 +123,7 @@ (setq appt-display-interval 5) ;; dbus notification of appt (require 'my-time) - (setq appt-disp-window-function #'my-app-display-window) + (setq appt-disp-window-function #'my-appt-display-window) ;; with org-agenda-to-appt (require 'org-clock) (require 'my-utils) diff --git a/emacs/.emacs.d/init/ycp-web.el b/emacs/.emacs.d/init/ycp-web.el index 3c033ad..fd16b10 100644 --- a/emacs/.emacs.d/init/ycp-web.el +++ b/emacs/.emacs.d/init/ycp-web.el @@ -187,6 +187,7 @@ (my-override hnreader--print-frontpage-item) (my-override hnreader--print-comments) (my-override hnreader--get-title) + (my-setq-from-local my-hnreader-save-dir) (require 'my-web) (add-to-list 'browse-url-handlers `(my-hacker-news-url-p @@ -252,6 +253,7 @@ (my-package my-web (:delay 60) + (my-setq-from-local my-webpage-incoming-dir) (my-keybind eww-mode-map "N" #'my-eww-next-path "P" #'my-eww-prev-path @@ -260,12 +262,14 @@ "b" #'my-eww-switch-by-title) (my-keybind global-map "\C-c\C-o" #'my-browse-url-at-point) (my-setq-from-local my-newscorp-au-amp-nk) + (my-setq-from-local my-tor-browser-bin) (add-to-list 'browse-url-handlers `(my-newscorp-au-url-p . ,(lambda (url &rest _) (my-open-newscorp-au url)))) (add-to-list 'browse-url-handlers `("^https?://www.spectator.com.au\\>" . - ,(lambda (url &rest _) (my-fetch-browse-as-googlebot url)))) ) + ,(lambda (url &rest _) (my-fetch-browse-as-googlebot url)))) + (my-setq-from-local my-firefox-profile-dir)) (my-package my-gitlab (:delay 60) @@ -337,6 +341,7 @@ (my-package fediorg (:delay 60) + (my-setq-from-local fediorg-dir) (require 'my-web) (add-to-list 'browse-url-handlers `(fediorg-post-url-p @@ -357,6 +362,7 @@ (require 'my-utils) (my-setq-from-local my-libgen-hosts my-libgen-alt-hosts my-libgen-library-hosts my-libgen-onion-host + my-libgen-plus-host ) (setq my-libgen-download-dir my-document-incoming-dir my-libfic-download-dir my-document-incoming-dir) @@ -385,18 +391,26 @@ exitter-oauth-consumer-key exitter-oauth-consumer-secret exitter-access-token exitter-username exitter-password exitter-email exitter-oauth-token exitter-oauth-token-secret exitter-oauth-token-ctime) + (my-setq-from-local exitter-dir) (setq exitter-debug nil) (add-to-list 'browse-url-handlers `(exitter-post-url-p - . ,(lambda (url &rest _) (exitter-open-post url)))) + . ,(lambda (url arg) (exitter-open-post url arg)))) ) (my-package reddio (:delay 60) + (my-setq-from-local reddio-dir) (add-to-list 'browse-url-handlers `(reddio-reddit-url-p . ,(lambda (url &rest _) (reddio-open-url url)))) ) +(my-package ttrss + (:delay 60) + (my-setq-from-local ttrss-address ttrss-user ttrss-password) + (require 'my-ttrss) + (my-setq-from-local my-ttrss-dir)) + (provide 'ycp-web) |