adding some tweaks to a lot of things
This commit is contained in:
parent
fdb4c2ecc8
commit
0394d80a50
5 changed files with 320 additions and 33 deletions
171
README.org
171
README.org
|
@ -17,6 +17,7 @@ Date: Sat, 27 Apr 2024 22:36:33 -0500
|
|||
- [[#keybindings][Keybindings]]
|
||||
- [[#bluetooth][Bluetooth]]
|
||||
- [[#org-mode][Org Mode]]
|
||||
- [[#frame-commands][Frame Commands]]
|
||||
- [[#ai][AI]]
|
||||
- [[#jinx][Jinx]]
|
||||
- [[#emoji][Emoji]]
|
||||
|
@ -973,7 +974,8 @@ Part of this config includes some special capture templates for my work as a you
|
|||
org-latex-active-timestamp-format "\\textit{%s}"
|
||||
org-enforce-todo-dependencies t
|
||||
org-export-preserve-breaks t
|
||||
org-directory "~/docs/notes")
|
||||
org-directory "~/docs/notes"
|
||||
org-pretty-entities t)
|
||||
|
||||
(add-hook 'org-mode-hook 'chris/org-mode-setup)
|
||||
(setq org-refile-targets '((org-agenda-files :maxlevel . 6) ("/home/chris/docs/todo/archive.org" :maxlevel . 6)))
|
||||
|
@ -1139,6 +1141,39 @@ Part of this config includes some special capture templates for my work as a you
|
|||
(setq org-latex-packages-alist '(("margin=2cm" "geometry" nil)))
|
||||
(setq org-latex-title-command "\\maketitle\\vspace{-4em}")
|
||||
|
||||
(defun chris/org-publish-site ()
|
||||
"Publish my website by pushing files to specific locations"
|
||||
(interactive)
|
||||
|
||||
(let ((notes (directory-files "~/docs/notes" t ".*.org"))
|
||||
(lessons (directory-files "~/docs/notes/lessons" t ".*.org"))
|
||||
(denote-directory "~/docs/notes/site/content"))
|
||||
(cl-loop for file in notes
|
||||
do (let ((filename (f-filename file)))
|
||||
(copy-file file (concat "~/docs/notes/site/content/notes/" filename) t)))
|
||||
(cl-loop for file in lessons
|
||||
do (let ((filename (f-filename file)))
|
||||
(copy-file file (concat "~/docs/notes/site/content/teaching/" filename) t)))
|
||||
(find-file "~/docs/notes/site/content/index.org")
|
||||
(org-update-all-dblocks)
|
||||
(save-buffer)
|
||||
(org-publish "cochrun.xyz")))
|
||||
|
||||
|
||||
(defun chris/website-dynamic-block ()
|
||||
"A function to load up the links on the homepage for the website"
|
||||
(let (files (directory-files "~/docs/notes/site/content/notes/" t ".*.org"))
|
||||
(cl-loop for file in files
|
||||
do (insert (denote--link-get-description file)))))
|
||||
|
||||
(defun org-dblock-write:chris-site-notes ()
|
||||
"A function to load up the links on the homepage for the website"
|
||||
(let (files (directory-files "~/docs/notes/site/content/notes/" t ".*.org"))
|
||||
(cl-loop for file in files
|
||||
do (insert (denote--link-get-description file)))))
|
||||
|
||||
(add-to-list 'org-dynamic-block-alist '("chris-site-notes" . chris/website-dynamic-block))
|
||||
|
||||
(setq org-publish-project-alist
|
||||
`(("home"
|
||||
:base-directory "~/docs/notes/site/content"
|
||||
|
@ -1148,18 +1183,30 @@ Part of this config includes some special capture templates for my work as a you
|
|||
:html-html5-fancy t
|
||||
:html-self-link-headlines t
|
||||
:html-head "<link rel=\"stylesheet\" href=\"pico.css\" type=\"text/css\"/>"
|
||||
:html-head "<link rel=\"stylesheet\" href=\"my.css\" type=\"text/css\"/>"
|
||||
:publishing-directory "~/docs/notes/site/public/"
|
||||
:publishing-function org-html-publish-to-html)
|
||||
("posts"
|
||||
:base-directory "~/docs/notes/site/content/posts"
|
||||
:base-directory "~/docs/notes/site/content/notes"
|
||||
:base-extension "org"
|
||||
:recursive t
|
||||
:recursive nil
|
||||
:html-doctype "html5"
|
||||
:html-html5-fancy t
|
||||
:html-self-link-headlines t
|
||||
:htmlized-source t
|
||||
:html-head "<link rel=\"stylesheet\" href=\"../pico.css\" type=\"text/css\"/>"
|
||||
:publishing-directory "~/docs/notes/site/public/content/"
|
||||
:publishing-directory "~/docs/notes/site/public/notes/"
|
||||
:publishing-function org-html-publish-to-html)
|
||||
("teaching/preaching"
|
||||
:base-directory "~/docs/notes/site/content/teaching"
|
||||
:base-extension "org"
|
||||
:recursive nil
|
||||
:html-doctype "html5"
|
||||
:html-html5-fancy t
|
||||
:html-self-link-headlines t
|
||||
:htmlized-source t
|
||||
:html-head "<link rel=\"stylesheet\" href=\"../pico.css\" type=\"text/css\"/>"
|
||||
:publishing-directory "~/docs/notes/site/public/teaching/"
|
||||
:publishing-function org-html-publish-to-html)
|
||||
("static"
|
||||
:base-directory "~/docs/notes/site/assets/"
|
||||
|
@ -1167,9 +1214,9 @@ Part of this config includes some special capture templates for my work as a you
|
|||
:recursive t
|
||||
:html-doctype "html5"
|
||||
:html-html5-fancy t
|
||||
:publishing-directory "~/docs/notes/site/public/"
|
||||
:publishing-directory "~/docs/notes/site/public/static/"
|
||||
:publishing-function org-publish-attachment)
|
||||
("cochrun.xyz" :components ("home" "posts" "static"))))
|
||||
("cochrun.xyz" :components ("home" "posts" "static" "teaching/preaching"))))
|
||||
|
||||
(setq org-html-postamble t
|
||||
org-html-postamble-format '(("en"
|
||||
|
@ -1538,6 +1585,42 @@ I might try switching to and using denote instead of Org Roam. Denote doesn't us
|
|||
"nl" 'denote-link-or-create))
|
||||
#+end_src
|
||||
|
||||
Let's also setup =consult-denote=.
|
||||
#+begin_src emacs-lisp
|
||||
(use-package consult-denote
|
||||
:config
|
||||
(setq consult-denote-find-command 'consult-fd
|
||||
consult-denote-grep-command 'consult-ripgrep)
|
||||
(consult-denote-mode +1))
|
||||
#+end_src
|
||||
|
||||
Let's also setup a function that we will use in dired to pull out the text of a docx file and convert it to a denote caputed file.
|
||||
#+begin_src emacs-lisp
|
||||
(defun chris/docx-to-denote-lesson ()
|
||||
"Converts the docx file at point in dired to a denote
|
||||
lesson file in my notes/lessons folder"
|
||||
(interactive)
|
||||
(let* ((file (expand-file-name (dired-file-name-at-point)))
|
||||
(filename (f-filename file))
|
||||
(orgname (string-replace "docx" "org" filename))
|
||||
(process (call-process
|
||||
"pandoc" nil nil nil "--wrap=none" "-o" orgname file)))
|
||||
;; (cl-loop while (not (eq 'run (process-status process)))
|
||||
;; do (message ""))
|
||||
(save-excursion
|
||||
(find-file orgname)
|
||||
(revert-buffer t t nil)
|
||||
(with-current-buffer (buffer-name)
|
||||
(goto-char (point-min))
|
||||
(replace-regexp " " " ")
|
||||
(goto-char (point-min))
|
||||
(replace-regexp "\n \n" "")
|
||||
(save-buffer)
|
||||
(goto-char (point-min))
|
||||
(kill-ring-save (point-min) (point-max))
|
||||
(org-capture)))))
|
||||
#+end_src
|
||||
|
||||
*** Org-Superstar
|
||||
Org-Superstar makes the stars at the beginning of the line in =org-mode= a lot prettier.
|
||||
#+begin_src emacs-lisp :tangle no
|
||||
|
@ -2154,6 +2237,35 @@ I'm going to start a website for my own ramblings, tutorials and links. To do th
|
|||
org-hugo-section "blog"))
|
||||
#+end_src
|
||||
|
||||
** Frame Commands
|
||||
With a little help from Prot's popup frame video...
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(defun chris/window-delete-popup-frame (&rest _)
|
||||
"Kill selected selected frame if it has parameter `chris/window-popup-frame'.
|
||||
Use this function via a hook."
|
||||
(when (frame-parameter nil 'chris/window-popup-frame)
|
||||
(delete-frame)))
|
||||
|
||||
(defmacro chris/window-define-with-popup-frame (command)
|
||||
"Define interactive function which calls COMMAND in a new frame.
|
||||
Make the new frame have the `chris/window-popup-frame' parameter."
|
||||
`(defun ,(intern (format "chris/window-popup-%s" command)) ()
|
||||
,(format "Run `%s' in a popup frame with `chris/window-popup-frame' parameter.
|
||||
Also see `chris/window-delete-popup-frame'." command)
|
||||
(interactive)
|
||||
(let ((frame (make-frame '((chris/window-popup-frame . t)))))
|
||||
(select-frame frame)
|
||||
(switch-to-buffer " chris/window-hidden-buffer-for-popup-frame")
|
||||
(condition-case nil
|
||||
(call-interactively ',command)
|
||||
((quit error user-error)
|
||||
(delete-frame frame))))))
|
||||
|
||||
(chris/window-define-with-popup-frame org-capture)
|
||||
(add-hook 'org-capture-after-finalize-hook #'chris/window-delete-popup-frame)
|
||||
#+end_src
|
||||
|
||||
** AI
|
||||
GPTEL is a package that uses chatGPT to get some text generation in org-mode
|
||||
*** gptel
|
||||
|
@ -2427,7 +2539,7 @@ I'm going to find all kinds of uses for posframe
|
|||
(use-package vertico-posframe
|
||||
:after vertico
|
||||
:config
|
||||
(setq vertico-posframe-min-height 30)
|
||||
(setq vertico-posframe-min-height 15)
|
||||
(vertico-posframe-mode +1))
|
||||
#+end_src
|
||||
|
||||
|
@ -2624,7 +2736,7 @@ Vertico is an alternative to Selectrum. Maybe using it will give me an even bett
|
|||
;; (setq vertico-scroll-margin 0)
|
||||
|
||||
;; Show more candidates
|
||||
(setq vertico-count 30)
|
||||
(setq vertico-count 15)
|
||||
|
||||
;; Grow and shrink the Vertico minibuffer
|
||||
(setq vertico-resize t)
|
||||
|
@ -3083,6 +3195,7 @@ I'm going to use projectile to keep my projects inline.
|
|||
** Project
|
||||
Here are project specific commands
|
||||
#+begin_src emacs-lisp
|
||||
|
||||
(chris/leader-keys
|
||||
:states 'normal
|
||||
:keymaps 'override
|
||||
|
@ -3372,6 +3485,9 @@ Let's also set =hl-line-mode= to be on for comint and prog modes
|
|||
#+END_SRC
|
||||
|
||||
*** Lisp
|
||||
:PROPERTIES:
|
||||
:ID: 20250107T125200.695450
|
||||
:END:
|
||||
Also here are some lisp specific stuff
|
||||
#+begin_src emacs-lisp
|
||||
(use-package smartparens
|
||||
|
@ -3424,36 +3540,50 @@ Also here are some lisp specific stuff
|
|||
('normal lisp-mode-map
|
||||
"gl" 'paredit-forward-slurp-sexp
|
||||
"gh" 'paredit-backward-slurp-sexp
|
||||
"C-M-l" 'paredit-forward-barf-sexp
|
||||
"C-M-h" 'paredit-backward-barf-sexp
|
||||
"C-l" 'paredit-forward
|
||||
"C-h" 'paredit-backward)
|
||||
('normal emacs-lisp-mode-map
|
||||
"gl" 'paredit-forward-slurp-sexp
|
||||
"gh" 'paredit-backward-slurp-sexp
|
||||
"C-M-l" 'paredit-forward-barf-sexp
|
||||
"C-M-h" 'paredit-backward-barf-sexp
|
||||
"C-l" 'paredit-forward
|
||||
"C-h" 'paredit-backward)
|
||||
('normal lisp-shared-mode-map
|
||||
"gl" 'paredit-forward-slurp-sexp
|
||||
"gh" 'paredit-backward-slurp-sexp
|
||||
"C-M-l" 'paredit-forward-barf-sexp
|
||||
"C-M-h" 'paredit-backward-barf-sexp
|
||||
"C-l" 'paredit-forward
|
||||
"C-h" 'paredit-backward)
|
||||
('normal sly-mrepl-mode-map
|
||||
"gl" 'paredit-forward-slurp-sexp
|
||||
"gh" 'paredit-backward-slurp-sexp
|
||||
"C-M-l" 'paredit-forward-barf-sexp
|
||||
"C-M-h" 'paredit-backward-barf-sexp
|
||||
"C-l" 'paredit-forward
|
||||
"C-h" 'paredit-backward)
|
||||
('normal scheme-mode-map
|
||||
"gl" 'paredit-forward-slurp-sexp
|
||||
"gh" 'paredit-backward-slurp-sexp
|
||||
"C-M-l" 'paredit-forward-barf-sexp
|
||||
"C-M-h" 'paredit-backward-barf-sexp
|
||||
"C-l" 'paredit-forward
|
||||
"C-h" 'paredit-backward)
|
||||
('normal geiser-mode-map
|
||||
"gl" 'paredit-forward-slurp-sexp
|
||||
"gh" 'paredit-backward-slurp-sexp
|
||||
"C-M-l" 'paredit-forward-barf-sexp
|
||||
"C-M-h" 'paredit-backward-barf-sexp
|
||||
"C-l" 'paredit-forward
|
||||
"C-h" 'paredit-backward)
|
||||
('normal cider-repl-mode-map
|
||||
"gl" 'paredit-forward-slurp-sexp
|
||||
"gh" 'paredit-backward-slurp-sexp
|
||||
"C-M-l" 'paredit-forward-barf-sexp
|
||||
"C-M-h" 'paredit-backward-barf-sexp
|
||||
"C-l" 'paredit-forward
|
||||
"C-h" 'paredit-backward))
|
||||
;; (remove-hook 'prog-mode-hook 'enable-paredit-mode)
|
||||
|
@ -3747,6 +3877,8 @@ Let's give eglot a try.
|
|||
(rustic-mode . eglot-ensure)
|
||||
(rust-ts-mode . eglot-ensure)
|
||||
:config
|
||||
|
||||
(setq eglot-autoshutdown t)
|
||||
|
||||
(defun chris/eglot-capf ()
|
||||
(setq-local completion-at-point-functions
|
||||
|
@ -4018,6 +4150,8 @@ I'm making a small function in here to open files in the appropriate program usi
|
|||
dired-kill-when-opening-new-dired-buffer t)
|
||||
(add-hook 'dired-mode-hook 'chris/setup-dired)
|
||||
|
||||
(custom-set-faces '(dired-directory ((t :foreground "#57c7ff" :inherit dired-header))))
|
||||
|
||||
:general
|
||||
(chris/leader-keys
|
||||
:states 'normal
|
||||
|
@ -4104,10 +4238,10 @@ We need a function to copy the full filename to kill-ring
|
|||
(dired-rainbow-define log (:inherit default :italic t) ".*\\.log"))
|
||||
#+end_src
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
#+begin_src emacs-lisp :tangle no
|
||||
(use-package diredfl
|
||||
:after dired
|
||||
:config (diredfl-global-mode +1))
|
||||
:config (diredfl-global-mode -1))
|
||||
#+end_src
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
|
@ -4835,14 +4969,15 @@ Let's use pdf-tools for a lot better interaction with pdfs.
|
|||
(use-package nov
|
||||
:mode ("\\.epub\\'" . nov-mode)
|
||||
:config
|
||||
(setq nov-text-width 80)
|
||||
|
||||
(defun chris/setup-nov-mode
|
||||
(defun chris/setup-nov-mode ()
|
||||
(interactive)
|
||||
(setq visual-fill-column-width 90
|
||||
visual-fill-column-center-text t)
|
||||
(visual-fill-column-mode +1)
|
||||
(display-line-numbers-mode -1)
|
||||
(variable-pitch-mode +1)
|
||||
(setq visual-fill-column-width 130
|
||||
visual-fill-column-center-text t))
|
||||
(variable-pitch-mode +1))
|
||||
|
||||
(add-hook 'nov-mode-hook 'chris/setup-nov-mode))
|
||||
#+end_src
|
||||
|
@ -4932,6 +5067,11 @@ With empv we can perhaps control mpv much more fine grainly and even search yout
|
|||
(let* ((file (dired-get-filename)))
|
||||
(empv-play-or-enqueue file)))
|
||||
|
||||
(defun chris/empv-seek-forward ()
|
||||
"Seek forward 20 seconds"
|
||||
(interactive)
|
||||
(empv-seek "20"))
|
||||
|
||||
:general
|
||||
(chris/leader-keys
|
||||
:states 'normal
|
||||
|
@ -4943,7 +5083,8 @@ With empv we can perhaps control mpv much more fine grainly and even search yout
|
|||
"vy" 'empv-youtube-tabulated
|
||||
"vn" 'empv-playlist-next
|
||||
"vp" 'empv-playlist-prev
|
||||
"vs" 'empv-playlist-select)
|
||||
"vs" 'empv-playlist-select
|
||||
"vS" 'chris/empv-seek-forward)
|
||||
(general-def
|
||||
:states 'normal
|
||||
:keymaps 'empv-youtube-results-mode-map
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue