From c13453153999c441c45768260a22bca8a1d8aa10 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Wed, 10 Mar 2021 14:07:52 -0600 Subject: [PATCH 1/2] Hoping to fix elfeed and org modes weirdoness --- README.org | 2 +- init.el | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.org b/README.org index 3df9be50..74f1c085 100644 --- a/README.org +++ b/README.org @@ -128,6 +128,7 @@ Let's also turn on =recentf-mode=. #+end_src ** Let's bootstrap straight.el #+begin_src emacs-lisp +(setq straight-fix-org t) (defvar bootstrap-version) (let ((bootstrap-file (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) @@ -603,7 +604,6 @@ This is the use-package definition with a lot of customization. Need to setup au Part of this config includes some special capture templates for my work as a youth minister. I create lessons through both org-mode and org-roam capture templates. The first part comes from org-roam, then the next is org-mode. #+begin_src emacs-lisp (use-package org - :straight (:type built-in) :config (setq org-startup-indented t org-edit-src-content-indentation 0 diff --git a/init.el b/init.el index 414baa26..2d0ab5a2 100644 --- a/init.el +++ b/init.el @@ -50,6 +50,7 @@ (recentf-mode +1) +(setq straight-fix-org t) (defvar bootstrap-version) (let ((bootstrap-file (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) @@ -351,7 +352,6 @@ vertically." (variable-pitch-mode +1)) (use-package org - :straight (:type built-in) :config (setq org-startup-indented t org-edit-src-content-indentation 0 From aa13c8e774c5b244c5fe6a1326d3a0b0ef3465d4 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Wed, 17 Mar 2021 13:43:35 -0500 Subject: [PATCH 2/2] add the ability to open external apps from dired --- README.org | 14 +++++++++++--- eshell/history | 1 + init.el | 13 ++++++++++--- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/README.org b/README.org index a8b5dd83..dfd6392d 100644 --- a/README.org +++ b/README.org @@ -537,17 +537,25 @@ I do a lot of docker management so having yaml is necessary ** File Management *** Dired +I'm making a small function in here to open files in the appropriate program using XDG defaults. This is like opening odt files in Libreoffice or mp4 files in MPV. #+begin_src emacs-lisp (use-package dired :ensure nil :straight nil + :config + (defun chris/dired-open-xdg () + "Open the file-at-point in the appropriate program" + (interactive) + (let ((file (ignore-errors (dired-get-file-for-visit)))) + (browse-url (file-truename file)))) :general (chris/leader-keys :states 'normal :keymaps 'override "od" '(dired-jump :which-key "open dired here")) (general-def 'normal dired-mode-map - "q" 'kill-this-buffer)) + "q" 'kill-this-buffer + "C-" 'chris/dired-open-xdg)) #+end_src We need a function to copy the full filename to kill-ring @@ -1304,12 +1312,12 @@ Let's add our own eshell prompt. and set the password cache to a significantly h (propertize path 'face `(:inherit org-level-1)))) (when chris/eshell-status-p (propertize (or (chris/eshell-status-display) "") 'face font-lock-comment-face)) - (propertize "\n" 'face '(:inherit org-todo :weight ultra-bold)) + (propertize "\n" 'face '(:inherit org-todo :weight ultra-bold)) " ")))) ;;; If the prompt spans over multiple lines, the regexp should match ;;; last line only. - (setq-default eshell-prompt-regexp "^ ") + (setq-default eshell-prompt-regexp "^ ") (setq eshell-destroy-buffer-when-process-dies t) (defun chris/pop-eshell () diff --git a/eshell/history b/eshell/history index 344dd00e..f52c7cde 100644 --- a/eshell/history +++ b/eshell/history @@ -109,3 +109,4 @@ ls /tmp cat /tmp/bongo-mpv.socket youtube-dl --list-formats youtube-dl --list-formats https://www.youtube.com/watch?v=ry8T67AgbUM +ls diff --git a/init.el b/init.el index b363f019..a29575b9 100644 --- a/init.el +++ b/init.el @@ -315,13 +315,20 @@ vertically." (use-package dired :ensure nil :straight nil + :config + (defun chris/dired-open-xdg () + "Open the file-at-point in the appropriate program" + (interactive) + (let ((file (ignore-errors (dired-get-file-for-visit)))) + (browse-url (file-truename file)))) :general (chris/leader-keys :states 'normal :keymaps 'override "od" '(dired-jump :which-key "open dired here")) (general-def 'normal dired-mode-map - "q" 'kill-this-buffer)) + "q" 'kill-this-buffer + "C-" 'chris/dired-open-xdg)) (defun chris/dired-yank-filename () "Get the full filename from file at point and put into kill-ring" @@ -995,12 +1002,12 @@ If on a: (propertize path 'face `(:inherit org-level-1)))) (when chris/eshell-status-p (propertize (or (chris/eshell-status-display) "") 'face font-lock-comment-face)) - (propertize "\n" 'face '(:inherit org-todo :weight ultra-bold)) + (propertize "\n" 'face '(:inherit org-todo :weight ultra-bold)) " ")))) ;;; If the prompt spans over multiple lines, the regexp should match ;;; last line only. - (setq-default eshell-prompt-regexp "^ ") + (setq-default eshell-prompt-regexp "^ ") (setq eshell-destroy-buffer-when-process-dies t) (defun chris/pop-eshell ()