From 8b954419fe17d0a32093d7b1b72eefbb555a5e68 Mon Sep 17 00:00:00 2001 From: SqrtMinusOne Date: Wed, 8 Feb 2023 13:02:08 +0300 Subject: [PATCH 1/3] feat(emacs): fix org-contacts, add calfw --- .emacs.d/init.el | 47 ++++++++++++++++++++++++++++++----------------- Emacs.org | 19 ++++++++++++++++++- 2 files changed, 48 insertions(+), 18 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 5a5038a..e35636c 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -545,6 +545,7 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer." (global-undo-tree-mode) (setq undo-tree-visualizer-diff t) (setq undo-tree-visualizer-timestamps t) + (setq undo-tree-auto-save-history nil) (my-leader-def "u" 'undo-tree-visualize) (fset 'undo-auto-amalgamate 'ignore) @@ -1832,9 +1833,9 @@ Returns ( . ) or nil." ("c" . "\\chi") ("v" . "\\psi") ("g" . "\\omega"))) - + (setq my/latex-greek-prefix "'") - + ;; The same for capitalized letters (dolist (elem my/greek-alphabet) (let ((key (car elem)) @@ -1847,7 +1848,7 @@ Returns ( . ) or nil." (substring value 0 1) (capitalize (substring value 1 2)) (substring value 2))))))) - + (yas-define-snippets 'latex-mode (mapcar @@ -1856,13 +1857,13 @@ Returns ( . ) or nil." my/greek-alphabet)) (setq my/english-alphabet '("a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q" "r" "s" "t" "u" "v" "w" "x" "y" "z")) - + (dolist (elem my/english-alphabet) (when (string-equal elem (downcase elem)) (add-to-list 'my/english-alphabet (upcase elem)))) - + (setq my/latex-mathbb-prefix "`") - + (yas-define-snippets 'latex-mode (mapcar @@ -1886,9 +1887,9 @@ Returns ( . ) or nil." ("~" . "\\sim") ("|" . "\\mid") ("_|" . "\\perp"))) - + (setq my/latex-math-prefix ";") - + (yas-define-snippets 'latex-mode (mapcar @@ -1903,7 +1904,7 @@ Returns ( . ) or nil." ("ssec" . "\\subsection{$1}") ("sssec" . "\\subsubsection{$1}") ("par" . "\\paragraph{$1}}"))) - + (setq my/latex-section-snippets (mapcar (lambda (elem) @@ -1913,7 +1914,7 @@ Returns ( . ) or nil." (string-match "[a-z]+" (cdr elem)) (match-string 0 (cdr elem))))) my/latex-section-snippets)) - + (dolist (elem my/latex-section-snippets) (let* ((key (nth 0 elem)) (value (nth 1 elem)) @@ -1930,10 +1931,10 @@ Returns ( . ) or nil." `(,(concat key "l") ,(concat value "%\n\\label{sec:$2}") ,(concat desc " with label"))))) - + (dolist (elem my/latex-section-snippets) (setf (nth 1 elem) (concat (nth 1 elem) "\n$0"))) - + (yas-define-snippets 'latex-mode my/latex-section-snippets)) @@ -3627,11 +3628,23 @@ skip exactly those headlines that do not match." (use-package org-contacts :straight (:type git :repo "https://repo.or.cz/org-contacts.git") :if (not my/remote-server) - :commands (org-contacts org-contacts-db) + :after (org) :config (setq org-contacts-files (list (concat org-directory "/contacts.org")))) +(defun my/calfw-setup-buffer () + (display-line-numbers-mode -1)) + +(use-package calfw + :straight t + :config + (add-hook 'cfw:calendar-mode-hook #'my/calfw-setup-buffer)) + +(use-package calfw-org + :after (calfw org) + :straight t) + (use-package org-latex-impatient :straight (:repo "yangsheng6810/org-latex-impatient" :branch "master" @@ -5088,17 +5101,17 @@ ENTRY is an instance of `elfeed-entry'." '("bestvideo[height<=720]+bestaudio/best[height<=720]" "bestvideo[height<=480]+bestaudio/best[height<=480]" "bestvideo[height<=1080]+bestaudio/best[height<=1080]")) - + (setq my/default-emms-player-mpv-parameters '("--quiet" "--really-quiet" "--no-audio-display")) - + (defun my/set-emms-mpd-youtube-quality (quality) (interactive "P") (unless quality (setq quality (completing-read "Quality: " my/youtube-dl-quality-list nil t))) (setq emms-player-mpv-parameters `(,@my/default-emms-player-mpv-parameters ,(format "--ytdl-format=%s" quality)))) - + (my/set-emms-mpd-youtube-quality (car my/youtube-dl-quality-list)) ;; evil-lion and evil-commentary shadow some gX bindings ;; (add-hook 'emms-browser-mode-hook @@ -5132,7 +5145,7 @@ ENTRY is an instance of `elfeed-entry'." (emms-track-set track name value))))) (defun emms-player-mpd-get-alists (info) "Turn the given parsed INFO from MusicPD into an list of alists. - + The list will be in reverse order." (when (and info (null (car info)) ; no error has occurred diff --git a/Emacs.org b/Emacs.org index efb4c2b..8ed58a8 100644 --- a/Emacs.org +++ b/Emacs.org @@ -934,6 +934,7 @@ References: (global-undo-tree-mode) (setq undo-tree-visualizer-diff t) (setq undo-tree-visualizer-timestamps t) + (setq undo-tree-auto-save-history nil) (my-leader-def "u" 'undo-tree-visualize) (fset 'undo-auto-amalgamate 'ignore) @@ -5081,7 +5082,7 @@ It seems the package has been somewhat revived in the recent months. It used thi (use-package org-contacts :straight (:type git :repo "https://repo.or.cz/org-contacts.git") :if (not my/remote-server) - :commands (org-contacts org-contacts-db) + :after (org) :config (setq org-contacts-files (list (concat org-directory "/contacts.org")))) @@ -5097,6 +5098,22 @@ An example contact entry can look like this: :BIRTHDAY: [1998-08-14] :END: #+end_example +*** Calendar view +[[https://github.com/kiwanami/emacs-calfw][calfw]] is a nice package that displays calendars in Emacs. + +#+begin_src emacs-lisp +(defun my/calfw-setup-buffer () + (display-line-numbers-mode -1)) + +(use-package calfw + :straight t + :config + (add-hook 'cfw:calendar-mode-hook #'my/calfw-setup-buffer)) + +(use-package calfw-org + :after (calfw org) + :straight t) +#+end_src ** UI *** OFF (OFF) Instant equations preview Instant math previews for org mode. From b96a7f62fb09f662336676cbcb40430ea91ac95f Mon Sep 17 00:00:00 2001 From: SqrtMinusOne Date: Wed, 8 Feb 2023 13:02:35 +0300 Subject: [PATCH 2/3] feat(exwm): Nyxt settings --- .emacs.d/desktop.el | 8 ++++++++ Desktop.org | 12 ++++++++++++ 2 files changed, 20 insertions(+) diff --git a/.emacs.d/desktop.el b/.emacs.d/desktop.el index 7c34047..ebfc0e2 100644 --- a/.emacs.d/desktop.el +++ b/.emacs.d/desktop.el @@ -143,6 +143,10 @@ _=_: Balance " (perspective-exwm-assign-window :workspace-index 2 :persp-name "browser")) + ("Nyxt" + (perspective-exwm-assign-window + :workspace-index 2 + :persp-name "browser")) ("Alacritty" (perspective-exwm-assign-window :persp-name "term")) @@ -380,6 +384,10 @@ _d_: Discord (add-hook 'exwm-floating-setup-hook #'my/fix-exwm-floating-windows) +(setq exwm-manage-configurations + '(((member exwm-class-name '("Nyxt")) + char-mode t))) + (defun my/exwm-init () (exwm-workspace-switch 1) diff --git a/Desktop.org b/Desktop.org index a48ed2f..c8cab49 100644 --- a/Desktop.org +++ b/Desktop.org @@ -439,6 +439,10 @@ For EXWM windows, the =perspective-exwm= package provides a function called =per (perspective-exwm-assign-window :workspace-index 2 :persp-name "browser")) + ("Nyxt" + (perspective-exwm-assign-window + :workspace-index 2 + :persp-name "browser")) ("Alacritty" (perspective-exwm-assign-window :persp-name "term")) @@ -932,6 +936,14 @@ These 3 settings seem to cause particular trouble with floating windows. Setting (add-hook 'exwm-floating-setup-hook #'my/fix-exwm-floating-windows) #+end_src +** Application-specific settings +Start Nyxt in =char-mode=. + +#+begin_src emacs-lisp +(setq exwm-manage-configurations + '(((member exwm-class-name '("Nyxt")) + char-mode t))) +#+end_src ** EXWM config And the EXWM config itself. From a1b77e233021fe22c6fcf1c2bc33da13586fe0c3 Mon Sep 17 00:00:00 2001 From: SqrtMinusOne Date: Wed, 8 Feb 2023 13:08:16 +0300 Subject: [PATCH 3/3] feat(console): add quote --- Console.org | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Console.org b/Console.org index 7751131..d1c0ecb 100644 --- a/Console.org +++ b/Console.org @@ -7,6 +7,11 @@ #+PROPERTY: header-args:bash :tangle-mode (identity #o755) :comments link :shebang "#!/usr/bin/env bash" #+OPTIONS: broken-links:auto h:6 toc:nil +#+begin_quote +No matter from which side you approach penguins, more of them always come from behind +#+end_quote +- A friend of mine + * =.profile= :PROPERTIES: :header-args+: :tangle ./.profile