diff --git a/README.org b/README.org index f1e6efce..73b8d2f6 100644 --- a/README.org +++ b/README.org @@ -272,7 +272,7 @@ Probably the prettiest and best modeline I've found. doom-modeline-buffer-file-name-style 'file-name doom-modeline-buffer-encoding nil doom-modeline-mu4e t - doom-modeline-enable-word-count t) + doom-modeline-enable-word-count nil) (if (daemonp) (add-hook 'after-make-frame-functions (lambda (frame) @@ -346,7 +346,9 @@ I am currently using NixOS. In order for emacs to have access to certain program Also due to using greetd, emacs isn't started with the environment from the system, so let's make sure it knows which wayland display we are using #+begin_src emacs-lisp -(setenv "WAYLAND_DISPLAY" "wayland-0") +(setenv "WAYLAND_DISPLAY" (if (string= (getenv "XDG_CURRENT_DESKTOP") "Hyprland") + "wayland-1" + "wayland-0")) #+end_src #+RESULTS: @@ -500,6 +502,7 @@ This evil-collection package includes a lot of other evil based things. "ss" '(consult-line :which-key "consult search") "sr" '(consult-ripgrep :which-key "consult ripgrep") "sd" '(dictionary-search :which-key "search the dictionary") + "sv" '(imenu :which-key "imenu") "oP" '(proced :which-key "proced") "ov" '(vterm :which-key "vterm") "wo" '(other-window :which-key "other window") @@ -616,6 +619,43 @@ Let's start by creating a self contained function of what I'd like started on ev (interactive (list (mark) (point))) (org-table-convert-region beg end ",")) +(defun chris/org-cycle-hide-drawers (state) + "Re-hide all drawers after a visibility state change." + (interactive) + (when (and (derived-mode-p 'org-mode) + (not (memq state '(overview folded contents)))) + (save-excursion + (let* ((globalp (memq state '(contents all))) + (beg (if globalp + (point-min) + (point))) + (end (if globalp + (point-max) + (if (eq state 'children) + (save-excursion + (outline-next-heading) + (point)) + (org-end-of-subtree t))))) + (goto-char beg) + (while (re-search-forward org-drawer-regexp end t) + (save-excursion + (beginning-of-line 1) + (when (looking-at org-drawer-regexp) + (let* ((start (1- (match-beginning 0))) + (limit + (save-excursion + (outline-next-heading) + (point))) + (msg (format + (concat + "org-cycle-hide-drawers: " + "`:END:`" + " line missing at position %s") + (1+ start)))) + (if (re-search-forward "^[ \t]*:END:" limit t) + (outline-flag-region start (point-at-eol) t) + (user-error msg)))))))))) + (defun chris/org-agenda-setup () (interactive) (org-indent-mode +1) @@ -808,7 +848,8 @@ Part of this config includes some special capture templates for my work as a you (chris/leader-keys :states 'normal :keymaps 'org-mode-map - "is" 'org-time-stamp) + "is" 'org-time-stamp + "tp" (chris/org-cycle-hide-drawers 'children)) (chris/leader-keys :states 'visual :keymaps 'override @@ -833,6 +874,7 @@ Part of this config includes some special capture templates for my work as a you "zn" 'org-narrow-to-subtree "zw" 'widen "zp" 'org-set-property + "zh" (chris/org-cycle-hide-drawers 'subtree) "S" 'org-schedule "t" 'org-todo "gf" 'org-footnote-action @@ -1586,9 +1628,12 @@ Consult has a lot of nice functions like Ivy's Counsel functions (enhanced searc (use-package consult :after vertico :config - (setq consult-narrow-key "'" + (setq consult-narrow-key (kbd "C-n") consult-project-root-function 'projectile-project-root) + (consult-customize + consult-org-heading :preview-key nil) + (defun chris/consult-ripgrep-for-stepdata () "Make ripgrep search hidden files for stepdata" (interactive) @@ -2239,6 +2284,8 @@ LSP is useful... :server-id 'qml)) :general (general-def 'normal c++-mode-map + "gf" 'lsp-clangd-find-other-file) + (general-def 'normal c++-ts-mode-map "gf" 'lsp-clangd-find-other-file)) (use-package lsp-ui @@ -2260,7 +2307,9 @@ Let's give eglot a try. :commands eglot :hook (c++-mode . eglot-ensure) - (rust-mode . eglot-ensure)) + (c++-ts-mode . eglot-ensure) + (rust-mode . eglot-ensure) + (rust-ts-mode . eglot-ensure)) #+end_src #+begin_src emacs-lisp @@ -2758,7 +2807,7 @@ Let's add org-msg to write emails in org-mode (setq mail-user-agent 'mu4e-user-agent org-msg-options "html-postamble:nil H:5 num:nil ^:{} toc:nil author:nil email:nil \\n:t" org-msg-startup "hidestars indent inlineimages" - org-msg-greeting-fmt "\nHi%s,\n\n" + org-msg-greeting-fmt "\n%s\n" org-msg-recipient-names '(("chris@tfcconnection.org" . "Chris Cochrun")) org-msg-greeting-name-limit 3 org-msg-default-alternatives '((new . (text html)) @@ -2767,8 +2816,6 @@ Let's add org-msg to write emails in org-mode org-msg-convert-citation t org-msg-signature " - Regards, - #+begin_signature -- *Chris* @@ -3508,10 +3555,13 @@ I am going to try and use LanguageTool to fix grammatical issues. #+end_src ** MyBible -MyBible is going to be my minor mode for creating and using a bible app within Emacs. Let's see if we can't make it work. +MyBible is going to be set of functions for creating and using a bible app within Emacs. Let's see if we can't make it work. #+begin_src emacs-lisp :tangle no -(defun chris/find-translation-tag () +(defun chris/find-verse () (interactive) + (find-buffer-visiting "/home/chris/org/bibles/esv.org") + (set-buffer ) + (org-node-if match) ) #+end_src diff --git a/init.el b/init.el index 948822d3..9ee06a2f 100644 --- a/init.el +++ b/init.el @@ -115,7 +115,7 @@ doom-modeline-buffer-file-name-style 'file-name doom-modeline-buffer-encoding nil doom-modeline-mu4e t - doom-modeline-enable-word-count t) + doom-modeline-enable-word-count nil) (if (daemonp) (add-hook 'after-make-frame-functions (lambda (frame) @@ -148,7 +148,9 @@ (which-key-mode) :defer 1) -(setenv "WAYLAND_DISPLAY" "wayland-0") +(setenv "WAYLAND_DISPLAY" (if (string= (getenv "XDG_CURRENT_DESKTOP") "Hyprland") + "wayland-1" + "wayland-0")) (executable-find "ssh") (setq ispell-program-name "hunspell" @@ -242,6 +244,7 @@ "ss" '(consult-line :which-key "consult search") "sr" '(consult-ripgrep :which-key "consult ripgrep") "sd" '(dictionary-search :which-key "search the dictionary") + "sv" '(imenu :which-key "imenu") "oP" '(proced :which-key "proced") "ov" '(vterm :which-key "vterm") "wo" '(other-window :which-key "other window") @@ -348,6 +351,43 @@ (interactive (list (mark) (point))) (org-table-convert-region beg end ",")) +(defun chris/org-cycle-hide-drawers (state) + "Re-hide all drawers after a visibility state change." + (interactive) + (when (and (derived-mode-p 'org-mode) + (not (memq state '(overview folded contents)))) + (save-excursion + (let* ((globalp (memq state '(contents all))) + (beg (if globalp + (point-min) + (point))) + (end (if globalp + (point-max) + (if (eq state 'children) + (save-excursion + (outline-next-heading) + (point)) + (org-end-of-subtree t))))) + (goto-char beg) + (while (re-search-forward org-drawer-regexp end t) + (save-excursion + (beginning-of-line 1) + (when (looking-at org-drawer-regexp) + (let* ((start (1- (match-beginning 0))) + (limit + (save-excursion + (outline-next-heading) + (point))) + (msg (format + (concat + "org-cycle-hide-drawers: " + "`:END:`" + " line missing at position %s") + (1+ start)))) + (if (re-search-forward "^[ \t]*:END:" limit t) + (outline-flag-region start (point-at-eol) t) + (user-error msg)))))))))) + (defun chris/org-agenda-setup () (interactive) (org-indent-mode +1) @@ -535,7 +575,8 @@ (chris/leader-keys :states 'normal :keymaps 'org-mode-map - "is" 'org-time-stamp) + "is" 'org-time-stamp + "tp" (chris/org-cycle-hide-drawers 'children)) (chris/leader-keys :states 'visual :keymaps 'override @@ -560,6 +601,7 @@ "zn" 'org-narrow-to-subtree "zw" 'widen "zp" 'org-set-property + "zh" (chris/org-cycle-hide-drawers 'subtree) "S" 'org-schedule "t" 'org-todo "gf" 'org-footnote-action @@ -1047,9 +1089,12 @@ If on a: (use-package consult :after vertico :config - (setq consult-narrow-key "'" + (setq consult-narrow-key (kbd "C-n") consult-project-root-function 'projectile-project-root) + (consult-customize + consult-org-heading :preview-key nil) + (defun chris/consult-ripgrep-for-stepdata () "Make ripgrep search hidden files for stepdata" (interactive) @@ -1547,7 +1592,9 @@ targets." :commands eglot :hook (c++-mode . eglot-ensure) - (rust-mode . eglot-ensure)) + (c++-ts-mode . eglot-ensure) + (rust-mode . eglot-ensure) + (rust-ts-mode . eglot-ensure)) (use-package consult-eglot :general @@ -1894,7 +1941,7 @@ targets." (setq mail-user-agent 'mu4e-user-agent org-msg-options "html-postamble:nil H:5 num:nil ^:{} toc:nil author:nil email:nil \\n:t" org-msg-startup "hidestars indent inlineimages" - org-msg-greeting-fmt "\nHi%s,\n\n" + org-msg-greeting-fmt "\n%s\n" org-msg-recipient-names '(("chris@tfcconnection.org" . "Chris Cochrun")) org-msg-greeting-name-limit 3 org-msg-default-alternatives '((new . (text html)) @@ -1903,8 +1950,6 @@ targets." org-msg-convert-citation t org-msg-signature " - Regards, - #+begin_signature -- *Chris* diff --git a/recentf b/recentf index 62b12074..84a34f54 100644 --- a/recentf +++ b/recentf @@ -1,4 +1,4 @@ -;;; Automatically generated by ‘recentf’ on Fri Jan 20 09:38:48 2023. +;;; Automatically generated by ‘recentf’ on Sun Feb 5 05:55:12 2023. (setq recentf-list 'nil)