Compare commits

...

2 Commits

Author SHA1 Message Date
J S
b55495cf0c
feat[date] Simplified date commands
I simplified and added an extra date command.
I also fixed the eval-confirmation for elisp and shell links.
2024-04-12 12:21:45 -04:00
J S
85556a13c0
feat[snip] Added APA snippet 2024-04-08 12:05:10 -04:00
2 changed files with 37 additions and 13 deletions

View File

@ -157,14 +157,17 @@ I want to grab the current date and put it in the buffer.
Because I sometimes use Fish or another shell, it's good to make sure bash is running the command using the src_bash{`-c`} flag. Because I sometimes use Fish or another shell, it's good to make sure bash is running the command using the src_bash{`-c`} flag.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(defun current-date () (interactive) (defun current-date () (interactive)
(shell-command-to-string " bash -c 'echo -n $(date +%Y-%m-%d)'")) (shell-command-to-string "date '+%Y-%m-%d'"))
(defun insert-current-date () (interactive) (defun insert-current-date () (interactive)
(insert (current-date))) (insert (string-trim (current-date))))
(map! :leader (map! :leader
:desc "Insert the current date into the buffer" :desc "Insert the current date into the buffer"
"i d" #'insert-current-date) "i d" #'insert-current-date)
#+end_src #+end_src
#+RESULTS:
** Convert regex strings to rx ** Convert regex strings to rx
#+begin_src elisp :tangle packages.el #+begin_src elisp :tangle packages.el
(package! xr) (package! xr)
@ -227,11 +230,15 @@ The final two lines concern local variables, which may try to evaluate code.
Emacs has better default values now, so it will ask to evaluate local variables. Emacs has better default values now, so it will ask to evaluate local variables.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq org-confirm-babel-evaluate t) (setq org-confirm-babel-evaluate t)
(setq org-link-shell-confirm-function t) (setq org-link-shell-confirm-function 'yes-or-no-p)
(setq org-link-elisp-confirm-function t) (setq org-link-elisp-confirm-function 'yes-or-no-p)
(setq enable-local-variables t) (setq enable-local-variables t)
(setq enable-local-eval 'maybe) (setq enable-local-eval 'maybe)
#+end_src #+end_src
#+RESULTS:
: maybe
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq templates/post-capture-props "#+date: [%<%Y-%m-%d %a>]\n#+lastmod:\n#+categories[]:\n#+tags[]:\n#+images[]: ") (setq templates/post-capture-props "#+date: [%<%Y-%m-%d %a>]\n#+lastmod:\n#+categories[]:\n#+tags[]:\n#+images[]: ")
(setq templates/post-capture-title "#+TITLE: ${title}\n") (setq templates/post-capture-title "#+TITLE: ${title}\n")
@ -317,23 +324,25 @@ Super-agenda allows many nice configurations to the agenda buffer.
#+begin_src emacs-lisp :tangle "packages.el" #+begin_src emacs-lisp :tangle "packages.el"
(package! org-super-agenda) (package! org-super-agenda)
#+end_src #+end_src
Is it working now? It sure seems to be, so IDK what was up with it earlier.
#+begin_src emacs-lisp
(use-package! org-super-agenda
:after org-roam)
#+end_src
Configure the Super Agenda to neatly organize everything. Configure the Super Agenda to neatly organize everything.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq org-super-agenda-groups (setq org-super-agenda-groups
'(;; Each group has an implicit boolean OR operator between its selectors. '(;; Each group has an implicit boolean OR operator between its selectors.
(:name "Calendar" (:name "Calendar"
:and (:todo nil :not (:scheduled (before "2024-03-17")) :not (:deadline (before "2024-03-17"))) :and (:todo nil :not (:scheduled (before "2024-03-17")) :not (:deadline (before "2024-03-17")))
:order 10) :order 10)
(:name "Today" ; Optionally specify section name (:name "Today" ; Optionally specify section name
:time-grid t ; Items that appear on the time grid :time-grid t ; Items that appear on the time grid
:todo "TODAY") ; Items that have this TODO keyword :todo "TODAY") ; Items that have this TODO keyword
(:name "Important" (:name "Important"
;; Single arguments given alone ;; Single arguments given alone
:tag "bills" :tag "bills"
@ -343,7 +352,6 @@ Configure the Super Agenda to neatly organize everything.
:not (:scheduled (after "2024-03-17")) :not (:scheduled (after "2024-03-17"))
:deadline (after "2024-03-17"))) :deadline (after "2024-03-17")))
(:name "School" (:name "School"
:tag "school" ) :tag "school" )
@ -375,10 +383,7 @@ Configure the Super Agenda to neatly organize everything.
;; Show this section after "Today" and "Important", because ;; Show this section after "Today" and "Important", because
;; their order is unspecified, defaulting to 0. Sections ;; their order is unspecified, defaulting to 0. Sections
;; are displayed lowest-number-first. ;; are displayed lowest-number-first.
:order 1) :order 1)))
;; After the last group, the agenda will display items that didn't
;; match any of these groups, with the default order position of 99
))
#+end_src #+end_src
** org-edna ** org-edna

19
snippets/org-mode/#+APA Normal file
View File

@ -0,0 +1,19 @@
# -*- mode: snippet -*-
# name: APA Configuration
# uuid: apa-configuration-block
# key: #+APA
# condition: t
# --
:CONFIG:
#+EXPORT_FILE_NAME: ~/Documents/$1
#+LATEX_CLASS: student-apa7
#+LATEX_OPTIONS: stu
#+LATEX_HEADER: \course{$2}
#+LATEX_HEADER: \authorsnames{Judah Sotomayor}
#+LATEX_HEADER: \authorsaffiliations{}
#+LATEX_HEADER: \professor{$3}
#+LATEX_HEADER: \usepackage{times}
#+LATEX_HEADER: \duedate{${4:`(format-time-string "%B %d, %Y")`}}
#+OPTIONS: toc:nil
:END: