From b54475ab0aa68270c541fcbb17b0630e3e49bcf4 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Fri, 10 Jun 2022 23:07:40 +0300 Subject: [PATCH] Some config updates --- .emacs.d/esy.org | 193 ++++++++++++++++++++++++++++++++--------------- .zshenv | 1 + 2 files changed, 133 insertions(+), 61 deletions(-) create mode 100644 .zshenv diff --git a/.emacs.d/esy.org b/.emacs.d/esy.org index d45eb5c..8e55b5d 100644 --- a/.emacs.d/esy.org +++ b/.emacs.d/esy.org @@ -134,7 +134,7 @@ For further information about Elisp headers, see [[info:elisp#Library (setq package-selected-packages '(academic-phrases avy ace-window alert all-the-icons all-the-icons-completion anzu - auctex-latexmk benchmark-init browse-at-remote + auctex-latexmk bbdb benchmark-init browse-at-remote browse-kill-ring cape corfu command-log-mode dabbrev define-word diff-hl diminish disable-mouse dockerfile-mode elfeed embark-consult erlang exec-path-from-shell @@ -275,7 +275,6 @@ For a list of available frame parameters, see [[info:elisp#Frame Parameters][eli (require 'which-key) (require 'whitespace-cleanup-mode) (setq show-paren-context-when-offscreen t) - (add-to-list 'lin-mode-hooks 'package-menu-mode-hook) (add-to-list 'lin-mode-hooks 'gnus-summary-mode-hook) (add-to-list 'lin-mode-hooks 'gnus-group-mode-hook) (add-to-list 'lin-mode-hooks 'gnus-server-mode-hook) @@ -328,13 +327,16 @@ For a list of available frame parameters, see [[info:elisp#Frame Parameters][eli :END: #+begin_src emacs-lisp - (defconst esy/inbox-path "~/inbox.org" + (defconst esy/inbox-path (expand-file-name "inbox.org" "~/org") "Path to my Org mode inbox file.") + (defconst esy/journal-path (expand-file-name "journal.org" "~/org") + "Path to my Org mode journal file.") + (with-eval-after-load 'org (require 'ob) (require 'ob-prolog) - (setq org-agenda-files `(,esy/inbox-path) + (setq org-agenda-files `(,esy/inbox-path ,esy/journal-path) org-default-notes-file esy/inbox-path org-agenda-start-on-weekday 0 org-ellipsis "…" @@ -357,6 +359,18 @@ For a list of available frame parameters, see [[info:elisp#Frame Parameters][eli (keymap-unset org-mode-map "C-," t)) #+end_src +*** Always open files with =C-c C-o= inside Emacs +:PROPERTIES: +:CUSTOM_ID: org-file-apps-t-emacs +:CreatedAt: <2022-06-10 Fri> +:CapturedAt: +:CapturedAs: Emacs configuration fragment +:END: + +#+begin_src emacs-lisp + (setq org-file-apps '((t . emacs))) +#+end_src + ** Refile targets :PROPERTIES: :CUSTOM_ID: org-refile-targets @@ -368,7 +382,9 @@ refiling directly into deeper headings as well. #+begin_src emacs-lisp (with-eval-after-load 'org-refile - (setq org-refile-targets '((nil . (:maxlevel . 3))) + (setq org-refile-targets '((org-agenda-files . (:maxlevel . 5)) + (nil . (:maxlevel . 3))) + org-archive-location "~/org/journal.org::datetree/* Finished Tasks :ARCHIVE" org-refile-use-outline-path t)) #+end_src @@ -460,12 +476,11 @@ refiling directly into deeper headings as well. (setq org-capture-templates '(("t" "Todo [inbox]" entry (file+headline esy/inbox-path "Tasks") "** TODO %^{Task} %^g - :PROPERTIES: - :CreatedAt: %t - :CapturedAt: %a - :CapturedAs: Inbox Task - :END: - " + :PROPERTIES: + :CreatedAt: %t + :CapturedAt: %a + :CapturedAs: Inbox Task + :END:" :prepend t :empty-lines 1 :immediate-finish t) @@ -473,38 +488,35 @@ refiling directly into deeper headings as well. (file+headline esy/source-path "Misc. settings") "** %^{Fragment} %^g - :PROPERTIES: - :CUSTOM_ID: %^{CUSTOM_ID} - :CreatedAt: %t - :CapturedAt: %a - :CapturedAs: Emacs configuration fragment - :END:\n\n#+begin_src emacs-lisp\n %i\n#+end_src - " + :PROPERTIES: + :CUSTOM_ID: %^{CUSTOM_ID} + :CreatedAt: %t + :CapturedAt: %a + :CapturedAs: Emacs configuration fragment + :END:\n\n#+begin_src emacs-lisp\n %i\n#+end_src" :empty-lines 1) ("n" "New Project" entry (file+headline esy/inbox-path "Projects") "** %^{Name} %^g - :PROPERTIES: - :CreatedAt: %t - :CapturedAt: %a - :CapturedAs: New Project - :SCM: file:%(project-prompt-project-dir) - :END: - " + :PROPERTIES: + :CreatedAt: %t + :CapturedAt: %a + :CapturedAs: New Project + :SCM: file:%(project-prompt-project-dir) + :END:" :prepend t :empty-lines 1 :immediate-finish t) ("c" "New Calendar Event" entry (file+headline esy/inbox-path "Calendar") "** %^{Title} %^g - :PROPERTIES: - :CreatedAt: %t - :CapturedAt: %a - :CapturedAs: Calendar Event - :END: - %(format-time-string \"<%Y-%m-%d %H:%M\" (org-read-date t t))-%(format-time-string \"%H:%M>\" (org-read-date t t)) - %i - " + :PROPERTIES: + :CreatedAt: %t + :CapturedAt: %a + :CapturedAs: Calendar Event + :END: + %(format-time-string \"<%Y-%m-%d %H:%M\" (org-read-date t t))-%(format-time-string \"%H:%M>\" (org-read-date t t)) + %i" :prepend t :empty-lines 1 :immediate-finish t) @@ -513,25 +525,23 @@ refiling directly into deeper headings as well. esy/org-capture-to-project-heading) "*** TODO %? :PROPERTIES: - :CreatedAt: %t - :CapturedAt: %a - :CapturedAs: Project Task - :END: - %i - " + :CreatedAt: %t + :CapturedAt: %a + :CapturedAs: Project Task + :END: + %i" :prepend t :empty-lines 1) ("Q" "Quick Project Task" entry (file+function esy/inbox-path esy/org-capture-to-project-heading) "*** TODO %^{Task} - :PROPERTIES: - :CreatedAt: %t - :CapturedAt: %a - :CaptuerdAs: Quick Project Task - :END: - %i - " + :PROPERTIES: + :CreatedAt: %t + :CapturedAt: %a + :CaptuerdAs: Quick Project Task + :END: + %i" :prepend t :empty-lines 1 :immediate-finish t) @@ -539,16 +549,25 @@ refiling directly into deeper headings as well. (file+function esy/inbox-path esy/org-capture-to-current-project) "*** TODO %^{Task} - :PROPERTIES: - :CreatedAt: %t - :CapturedAt: %a - :CaptuerdAs: Current Project Task - :END: - %i - " + :PROPERTIES: + :CreatedAt: %t + :CapturedAt: %a + :CaptuerdAs: Current Project Task + :END: + %i" :prepend t :empty-lines 1 - :immediate-finish t))) + :immediate-finish t) + ("j" "Journal" entry + (file+datetree esy/journal-path) + "* %? + :PROPERTIES: + :CreatedAt: %t + :CapturedAt: %a + :CaptuerdAs: Journal entry + :END: + %i" + :empty-lines 1))) (setq org-capture-templates-contexts '(("P" (list project-current)))) @@ -639,7 +658,7 @@ refiling directly into deeper headings as well. "Configure Gnus specific customizations." (require 'gnus) (require 'gnus-icalendar) - (setq + (setq gnus-article-treat-types '("text/plain" "text/x-verbatim" "text/x-patch" @@ -696,7 +715,6 @@ refiling directly into deeper headings as well. (pulse-momentary-highlight-one-line)) #+end_src - ** Misc. keybindings :PROPERTIES: :CUSTOM_ID: misc-keybindings @@ -735,8 +753,7 @@ refiling directly into deeper headings as well. (global-set-key (kbd "C-.") #'embark-act) (global-set-key (kbd "C-;") #'avy-goto-char-timer) (global-set-key (kbd "C-s-f") #'toggle-frame-fullscreen) - (global-set-key (kbd "C-s-l") #'esy/pulse-line) - (global-set-key [remap just-one-space] #'cycle-spacing)) + (global-set-key (kbd "C-s-l") #'esy/pulse-line)) (add-hook 'after-init-hook #'esy/customize-global-keymap) #+end_src @@ -890,6 +907,16 @@ does in the shell. (add-hook 'proced-mode-hook #'esy/setup-proced) #+end_src +** BBDB +:PROPERTIES: +:CUSTOM_ID: bbdb-phone-style-nil +:END: + +#+begin_src emacs-lisp + (with-eval-after-load 'bbdb + (setq bbdb-phone-style nil)) +#+end_src + * Display weekly agenda on startup :PROPERTIES: :CUSTOM_ID: agenda-on-startup @@ -921,7 +948,7 @@ does in the shell. (require 'mb-depth) (setq enable-recursive-minibuffers t) (minibuffer-depth-indicate-mode)) - + (add-hook 'after-init-hook #'esy/setup-recursive-minibuffers) #+end_src @@ -1187,7 +1214,24 @@ include =emacs-lisp-mode= and =lisp-interaction-mode=. (setq TeX-view-program-selection '((output-pdf "PDF Tools")) TeX-source-correlate-start-server t) (add-hook 'TeX-after-compilation-finished-functions - #'TeX-revert-document-buffer)) + #'TeX-revert-document-buffer) + (add-to-list 'auto-mode-alist '("\\.pdf\\'" . pdf-view-mode))) +#+end_src + +* =vc= customizations +:PROPERTIES: +:CUSTOM_ID: vc-follow-symlinks-t +:END: + +By default, Emacs asks for confirmation when visiting a path that +points to symlink to a file committed to version control. I often +visit this file with =C-x C-f ~/.emacs.d/esy.org=, which is a symlink +to the actual source of this file which is managed by git and Stow, so +in this cases I prefer Emacs to trust me that I know what I'm doing +without asking each time. + +#+begin_src emacs-lisp + (setq vc-follow-symlinks t) #+end_src * Project switch commands @@ -1215,7 +1259,7 @@ include =emacs-lisp-mode= and =lisp-interaction-mode=. auto-revert-verbose nil) (global-auto-revert-mode) (which-key-mode) - (global-whitespace-cleanup-mode)) + (global-whitespace-cleanup-mode 1)) (add-hook 'after-init-hook #'esy/setup-misc) #+end_src @@ -1236,6 +1280,33 @@ Add the timezones of places of interest to the list of clocks shown by (add-to-list 'zoneinfo-style-world-list '("Europe/Amsterdam" "Amsterdam"))) #+end_src +** =shell= customizations +:PROPERTIES: +:CUSTOM_ID: shell +:CreatedAt: <2022-06-10 Fri> +:CapturedAt: [[file:~/inbox.org::*Followup on this mail from Adam][Followup on this mail from Adam]] +:CapturedAs: Emacs configuration fragment +:END: + +Kill =M-x shell= buffers automatically when the shell process +terminates, e.g. when pressing =C-d=. + +#+begin_src emacs-lisp + (setq shell-kill-buffer-on-exit t) +#+end_src + +** Open files (with =C-c C-o=) in Emacs + :PROPERTIES: + :CUSTOM_ID: org-file-apps-t-emacs + :CreatedAt: <2022-06-10 Fri> + :CapturedAt: + :CapturedAs: Emacs configuration fragment + :END: + +#+begin_src emacs-lisp + (setq org-file-apps '((t . emacs))) +#+end_src + * Elisp Footer :PROPERTIES: :CUSTOM_ID: footer diff --git a/.zshenv b/.zshenv new file mode 100644 index 0000000..0983380 --- /dev/null +++ b/.zshenv @@ -0,0 +1 @@ +export PATH=/Applications/Emacs.app/Contents/MacOS:/Applications/Emacs.app/Contents/MacOS/bin/:$PATH -- 2.39.5