From e98754a1e0540cae5343fdd5a05faf37893e407b Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Wed, 22 Jun 2022 18:29:30 +0200 Subject: [PATCH] config/doom: improve for ruby and emacsclient usage --- .config/doom/config.el | 15 ++++++++++++--- .config/doom/init.el | 2 +- .config/doom/packages.el | 2 ++ .config/doom/user.el##user.janek | 12 ++++++++---- 4 files changed, 23 insertions(+), 8 deletions(-) diff --git a/.config/doom/config.el b/.config/doom/config.el index 7131292..6395b2d 100644 --- a/.config/doom/config.el +++ b/.config/doom/config.el @@ -18,10 +18,13 @@ ;; There are two ways to load a theme. Both assume the theme is installed and ;; available. You can either set `doom-theme' or manually load a theme with the ;; `load-theme' function. This is the default: -(setq doom-theme 'doom-one +(setq doom-theme (if (equal (getenv "THEME") "light") 'doom-one-light 'doom-one) doom-font (font-spec :family "monospace" :size 24 :weight 'semi-light) doom-variable-pitch-font (font-spec :family "sans" :size 24)) +; TODO how to treat sequencep as string? - theme toggle +;(s-chop-suffixes '("-light" "-dark") doom-theme) + (setq display-line-numbers-type 'relative scroll-margin 6 hscroll-margin 20 @@ -123,7 +126,12 @@ Version 2019-11-04 2021-02-16" (setq initial-major-mode 'org-mode) (add-to-list 'auto-mode-alist '("/journal/" . org-mode)) +(add-to-list 'auto-mode-alist '("\\.jrnl\\'" . org-mode)) + (add-to-list 'auto-mode-alist '("\\.el##" . emacs-lisp-mode)) +(add-to-list 'auto-mode-alist `(,(getenv "CONFIG_SHELLS") . sh-mode)) +(add-to-list 'auto-mode-alist `(,(getenv "CONFIG_ZSH") . sh-mode)) +(add-to-list 'auto-mode-alist `("\\.local/bin" . sh-mode)) (add-to-list 'auto-mode-alist '("\\.twee\\'" . twee-chapbook-mode)) (add-hook 'twee-chapbook-mode-hook 'twee-mode) @@ -285,8 +293,9 @@ Version 2019-11-04 2021-02-16" (substring id 0 2) (if (> (seq-length id) 2) (substring id 2) id)) ) - (setq org-attach-id-dir (expand-file-name "attach" (xdg-user-dir "DOCUMENTS")) - org-attach-method 'mv + (unless (file-exists-p org-attach-id-dir) + (setq org-attach-id-dir (expand-file-name "attach" (xdg-user-dir "DOCUMENTS")))) + (setq org-attach-method 'mv org-attach-preferred-new-method nil org-attach-id-to-path-function-list '(xf/org-attach-id-folder-format) ) diff --git a/.config/doom/init.el b/.config/doom/init.el index 1762bce..72a5c0b 100644 --- a/.config/doom/init.el +++ b/.config/doom/init.el @@ -155,7 +155,7 @@ ;;raku ; the artist formerly known as perl6 ;;rest ; Emacs as a REST client rst ; ReST in peace - (ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"} + (ruby +rails +lsp) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"} ;;rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap() ;;scala ; java, but good ;;scheme ; a fully conniving family of lisps diff --git a/.config/doom/packages.el b/.config/doom/packages.el index 3abdbe0..7beab03 100644 --- a/.config/doom/packages.el +++ b/.config/doom/packages.el @@ -68,6 +68,8 @@ (package! togetherly) ; Collaborative editing (package! direnv) ; directory-local environment for haskell-nix things +(package! haml-mode) + (package! adoc-mode) ; Asciidoc, a md alternative (package! nov) ; epub reader (package! pkgbuild-mode) ; AUR PKGBUILDs diff --git a/.config/doom/user.el##user.janek b/.config/doom/user.el##user.janek index 6e52898..a02fe11 100644 --- a/.config/doom/user.el##user.janek +++ b/.config/doom/user.el##user.janek @@ -11,12 +11,16 @@ org-roam-directory org-directory )) ) +(setq org-attach-id-dir (expand-file-name "3-dox/attach" user-data-dir)) (if (and org-directory (file-exists-p org-directory)) - (setq default-directory org-directory - org-agenda-files (append - (directory-files-recursively (expand-file-name "project/") "\\`[^.]*\\'" 't) + (progn + (if (file-equal-p command-line-default-directory "~") + (setq default-directory org-directory)) + (setq org-agenda-files (append + (directory-files-recursively (expand-file-name "project/" org-directory) "\\`[^.]*\\'" 't) (list (expand-file-name "inbox/")) - ))) + )) + )) (use-package! recentf :config