Added lexical scoping and org-roam file selection

This commit is contained in:
Seth Morabito 2023-07-31 10:12:15 -07:00
parent d7bf2a478b
commit 70419c25e7
1 changed files with 53 additions and 33 deletions

View File

@ -40,6 +40,15 @@ file. The only thing needed in the main Emacs init file is this line:
:CUSTOM_ID: basic-setup
:END:
** Lexical Scoping
By default, Emacs uses dynamic binding. Some aspects of my configuration
rely on /lexical binding/, so that gets turned on first!
#+BEGIN_SRC emacs-lisp
;; -*- lexical-binding: t; -*-
#+END_SRC
** Native Compilation
If (and only if) Emacs has native compilation available, set it up to
@ -995,40 +1004,51 @@ collapsed.
** Org Roam
Choose the best directory for org-roam: In my Nextcloud directory,
if it exists, otherwise in Documents.
#+BEGIN_SRC emacs-lisp
(when (file-directory-p (expand-file-name "~/Nextcloud/org-roam/"))
(use-package org-roam
:ensure t
:init
(setq org-roam-v2-ack t
org-roam-dailies-directory "journal/")
:custom
(org-roam-directory (expand-file-name "~/Nextcloud/org-roam/"))
(org-roam-completion-everywhere t)
(org-roam-capture-templates
'(("d" "default" plain
"%?"
:if-new (file+head "%<%Y%m%d>-${slug}.org"
"#+TITLE: ${title}\n")
:unnarrowed t)))
(org-roam-dailies-capture-templates
'(("d" "default" entry "\n* %?"
:target (file+head "%<%Y-%m-%d>.org" "#+TITLE: %u\n#+STARTUP: showall\n\n")
:unnarrowed nil ; Show only the current note on entry
:empty-lines 1)))
:bind (("C-c n l" . org-roam-buffer-toggle)
("C-c n f" . org-roam-node-find)
("C-c n i" . org-roam-node-insert)
:map org-mode-map
("C-M-i" . completion-at-point)
:map org-roam-dailies-map
("Y" . org-roam-dailies-capture-yesterday)
("T" . org-roam-dailies-capture-tomorrow))
:bind-keymap ("C-c n d" . org-roam-dailies-map)
:config
(require 'org-roam-dailies)
(org-roam-db-autosync-mode)
(org-roam-setup)))
(setq my-org-roam-directory
(if (file-directory-p (expand-file-name "~/Nextcloud/org-roam/"))
"~/Nextcloud/org-roam/"
"~/Documents/org-roam/"))
#+END_SRC
Next, ensure ~org-roam~ is installed and configured.
#+BEGIN_SRC emacs-lisp
(use-package org-roam
:ensure t
:init
(setq org-roam-v2-ack t
org-roam-dailies-directory "journal/")
:custom
(org-roam-directory (expand-file-name my-org-roam-directory))
(org-roam-completion-everywhere t)
(org-roam-capture-templates
'(("d" "default" plain
"%?"
:if-new (file+head "%<%Y%m%d>-${slug}.org"
"#+TITLE: ${title}\n")
:unnarrowed t)))
(org-roam-dailies-capture-templates
'(("d" "default" entry "\n* %?"
:target (file+head "%<%Y-%m-%d>.org" "#+TITLE: %u\n#+STARTUP: showall\n\n")
:unnarrowed nil ; Show only the current note on entry
:empty-lines 1)))
:bind (("C-c n l" . org-roam-buffer-toggle)
("C-c n f" . org-roam-node-find)
("C-c n i" . org-roam-node-insert)
:map org-mode-map
("C-M-i" . completion-at-point)
:map org-roam-dailies-map
("Y" . org-roam-dailies-capture-yesterday)
("T" . org-roam-dailies-capture-tomorrow))
:bind-keymap ("C-c n d" . org-roam-dailies-map)
:config
(require 'org-roam-dailies)
(org-roam-db-autosync-mode)
(org-roam-setup))
#+END_SRC
** Org Superstar