fixing a lot of little things

This commit is contained in:
Chris Cochrun 2023-12-28 14:16:03 -06:00
parent 5a28d75a20
commit e8048fa548
2 changed files with 137 additions and 178 deletions

View file

@ -208,7 +208,12 @@ I will also add my personal scripts to emacs' PATH
Let's also set org-mode as the scratch buffer mode
#+begin_src emacs-lisp
(setq initial-major-mode 'org-mode)
(setq initial-scratch-message "#+TITLE: SCRATCH\n#+DESCRIPTION: This buffer is for temporary things")
(setq initial-scratch-message "#+TITLE: SCRATCH\n#+DESCRIPTION: This buffer is for temporary things\n")
#+end_src
This is to make sure Emacs doesn't add a newline in files that I don't want it to. A lot of major modes change this which is fine since this mostly only applies to some small specific files that mostly only open in =fundamental-mode=.
#+begin_src emacs-lisp
(setq require-final-newline nil)
#+end_src
** Let's bootstrap straight.el
@ -598,6 +603,11 @@ This evil-collection package includes a lot of other evil based things.
"open the emacs config to edit"
(interactive)
(find-file (expand-file-name "README.org" user-emacs-directory)))
(defun chris/find-videos ()
(interactive)
(find-file (expand-file-name "vids" "~")))
(defun chris/open-bible ()
"find a bible to open"
(interactive)
@ -677,6 +687,7 @@ This evil-collection package includes a lot of other evil based things.
"tl" '(toggle-truncate-lines :which-key "truncate lines")
"ts" '(ispell :which-key "spell check")
"ff" '(find-file :which-key "find file")
"fv" '(chris/find-videos :which-key "find file")
"fb" '(chris/open-bible :which-key "find bible book")
"fr" '(consult-recent-file :which-key "recent file")
"fs" '(save-buffer :which-key "save")
@ -930,7 +941,7 @@ Part of this config includes some special capture templates for my work as a you
:jump-to-captured t
:empty-lines 1)
("l" "TFC Lesson" plain
(function chris/org-caputre-denote-file-path)
(function chris/org-capture-denote-file-path)
(file ".templates/lessontemplate.org")
:prepend nil
:jump-to-captured t
@ -981,7 +992,6 @@ Part of this config includes some special capture templates for my work as a you
(sequence "[ ](T)" "[-](S)" "[?](W)" "|" "[X](D)"))
org-agenda-files
'("~/docs/todo/todo.org"
"~/docs/notes/nvtfc_social_media.org"
"~/dev/lumina/TODO.org"
"~/dev/tfcconnection/TODO.org"
"~/docs/notes/lessons/")
@ -1157,7 +1167,7 @@ Part of this config includes some special capture templates for my work as a you
"q" 'org-edit-src-abort))
#+end_src
We need to create a lesson capture function to find our lesson files differently each time we run our TFC plan capture. This is the most unique part of my capture template. This function uses =org-roam-node-read= to pick the lesson file that I need to add my lesson plan to. This way the lesson itself is created before the plan.
We need to create a lesson capture function to find our lesson files differently each time we run our TFC plan capture. This is the most unique part of my capture template. This function uses =denote= to pick the lesson file that I need to add my lesson plan to. This way the lesson itself is created before the plan.
#+begin_src emacs-lisp
(defun chris/denote-capture-lesson-file ()
"Function to return the lesson file that is needed for TFC plan capture and move to correct position for plan insertion"
@ -1172,7 +1182,7 @@ We need to create a lesson capture function to find our lesson files differently
(goto-char (point-min))
(search-forward "* PLAN")))
(defun chris/org-caputre-denote-file-path ()
(defun chris/org-capture-denote-file-path ()
"Function returning the file placement using denote for capture"
(interactive)
(denote-subdirectory)
@ -1249,7 +1259,7 @@ Here we are going to add org-roam. This is a note-takers paradise by adding an a
Basic Org-Roam setup. We select the directory and the basic width of the Org-Roam buffer so that it doesn't take too much space on my laptop. We also want to exclude certain files from Org-Roam. All files are synced between machines using syncthing and kept in a version history. I'd like to exclude the version history from Org-Roam using =org-roam-file-exclude-regexp=.
We also need to setup some capture templates to use some specific setups with my journalling. These include a space for my [[file:../../org/homework_for_life.org][Homework For Life]], tasks for the day, and how I can love on my family.
#+BEGIN_SRC emacs-lisp
#+BEGIN_SRC emacs-lisp :tangle no
(use-package org-roam
:after org
:ensure t
@ -1396,6 +1406,9 @@ In order to use it, I need to go to http://localhost:8080
#+END_SRC
*** Denote
:PROPERTIES:
:ID: 20231224T062442.525926
:END:
I might try switching to and using denote instead of Org Roam. Denote doesn't use a DB and instead uses a clever naming scheme to make sure that all files are connectable. The one downside of denote is that the links are specific to denote instead of plain org links.
#+begin_src emacs-lisp
(use-package denote
@ -1406,19 +1419,49 @@ I might try switching to and using denote instead of Org Roam. Denote doesn't us
denote-modules '(project xref ffap)
denote-known-keywords '("emacs" "bible" "jesus" "tfc" "lesson" "it" "dev"))
(defun chris/denote-rename-buffer-with-prefix (&optional buffer)
"Rename denote buffers with title and then with the prefix D>."
(if (denote-file-is-note-p (buffer-file-name))
(progn (denote-rename-buffer-with-title)
(rename-buffer (concat "D> " (buffer-name (or buffer (current-buffer) title :unique)))))))
(denote-rename-buffer-mode +1)
(setq denote-rename-buffer-function 'chris/denote-rename-buffer-with-prefix)
(setq denote-org-front-matter
"#+TITLE: %1$s
#+AUTHOR: Chris Cochrun
#+CREATED: %2$s
#+filetags: %3$s
#+identifier: %4$s
")
"#+TITLE: %1$s\n#+AUTHOR: Chris Cochrun\n#+CREATED: %2$s\n#+filetags: %3$s\n#+identifier: %4$s\n")
(add-hook 'dired-mode-hook 'denote-dired-mode)
(defvar denote-faces--file-name-regexp
(concat "\\(?1:[0-9]\\{8\\}\\)\\(?2:T[0-9]\\{6\\}\\)"
"\\(?:\\(?3:==\\)\\(?4:[[:alnum:][:nonascii:]=]*?\\)\\)?"
"\\(?:\\(?5:--\\)\\(?6:[[:alnum:][:nonascii:]-]*?\\)\\)?"
"\\(?:\\(?7:__\\)\\(?8:[[:alnum:][:nonascii:]_-]*?\\)\\)?"
"\\(?9:\\..*\\)?$")
"Regexp of file names for fontification.")
(defconst denote-faces-file-name-keywords
`((,(concat "[\t\s]+" denote-faces--file-name-regexp)
(1 'denote-faces-date)
(2 'denote-faces-time)
(3 'denote-faces-delimiter nil t)
(4 'denote-faces-signature nil t)
(5 'denote-faces-delimiter nil t)
(6 'denote-faces-title nil t)
(7 'denote-faces-delimiter nil t)
(8 'denote-faces-keywords nil t)
(9 'denote-faces-extension nil t )))
"Keywords for fontification of file names.")
:general
(chris/leader-keys
:states 'normal
:keymaps 'override
"nf" 'denote-open-or-create
"nb" 'denote-backlinks))
"nb" 'denote-backlinks
"nk" 'denote-keywords-add))
#+end_src
*** Org-Superstar
@ -2025,15 +2068,6 @@ Optional BACKEND must be `re-reveal' or a backend derived from it."
file)))
#+end_src
*** Ox-Spectacle
Spectacle.js is another beautiful slideshow builder that org can export to using ox-spectacle.
#+begin_src emacs-lisp :tangle no
(use-package ox-spectacle
:config
)
#+end_src
*** ox-zola
I'm going to start a website for my own ramblings, tutorials and links. To do this I'll likely use Zola since it's built in Rust.
#+begin_src emacs-lisp :tangle no
@ -2046,16 +2080,6 @@ I'm going to start a website for my own ramblings, tutorials and links. To do th
** AI
GPTEL is a package that uses chatGPT to get some text generation in org-mode
#+begin_src emacs-lisp :tangle no
(use-package gptel
:ensure t
:commands (gptel-send
gptel)
:config
(setq gptel-default-mode 'org-mode
gptel-api-key "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"))
#+end_src
*** Ellama
Idk, let's try this i guess
@ -4387,7 +4411,7 @@ Let's use pdf-tools for a lot better interaction with pdfs.
(defun chris/setup-nov-mode
(interactive)
(visual-fill-column-mode)
(visual-fill-column-mode +1)
(display-line-numbers-mode -1)
(variable-pitch-mode +1)
(setq visual-fill-column-width 130
@ -5018,14 +5042,29 @@ I am going to try and use LanguageTool to fix grammatical issues.
#+end_src
** MyBible
:PROPERTIES:
:ID: 20231221T141041.368526
:END:
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
(defvar bible-books '(genesis exodus leviticus numbers dueteronomy joshua judges ruth 1-samuel 2-samuel 1-kings 2-kings 1-chronicles 2-chronicles ezra nehemiah esther job psalms proverbs ecclesiastes song-of-solomon isaiah jeremiah lamentations ezekiel daniel hosea joel amos obadiah jonah micah nahum habakkuk zephaniah haggai zechariah malachi matthew mark luke john acts romans 1-corinthians 2-corinthians galatians ephesians phillipians colossians 1-thessalonians 2-thessalonians 1-timothy 2-timothy titus philemon hebrews james 1-peter 2-peter 1-john 2-john 3-john jude revelation))
(defun chris/org-get-tree (&optional file)
"Get the tree of the current org buffer or optionally a file."
(interactive)
(let ((list nil))))
(defun chris/make-chapters ()
(interactive)
(org-narrow-to-element)
(search-forward "chapter")
(beginning-of-line)
(insert "** "))
(defun chris/find-verse ()
(interactive)
(find-file "/home/chris/docs/bibles/esv.org")
(list (imenu-choose-buffer-index)))
(org-ql-select "/home/chris/docs/bibles/esv.org" "Jesus")
(goto-char (cdr (imenu-choose-buffer-index))))
#+end_src
** Performance