summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <matt@matthewlemon.com>2022-11-17 16:59:54 +0000
committerMatthew Lemon <matt@matthewlemon.com>2022-11-17 16:59:54 +0000
commitade3116cbf271205ba0a45543d6c947e3b2d0e2a (patch)
treee51624618cebea9462dc537351014f62a4923bbc
parent0742efc81ac9a6ac27522b66a9cb7c309fbff86c (diff)
org-roam keymaps and some other tweaks
As I surge towards vanilla config.
-rw-r--r--myinit.org64
1 files changed, 53 insertions, 11 deletions
diff --git a/myinit.org b/myinit.org
index a63d5fe..f314e3c 100644
--- a/myinit.org
+++ b/myinit.org
@@ -43,6 +43,9 @@
(put 'narrow-to-defun 'disabled nil)
(put 'narrow-to-page 'disabled nil)
(put 'narrow-to-region 'disabled nil)
+
+ ;; we don't want the old buffer list!
+ (global-unset-key (kbd "C-x C-b"))
;; Put backups in /tmp where they belong
(setq backup-directory-alist
@@ -543,14 +546,49 @@ If failed try to complete the common part with `company-complete-common'"
(setq recentf-max-saved-items 25)
(recentf-mode t))
#+END_SRC
+** org-roam
+#+BEGIN_SRC emacs-lisp
+ (use-package org-roam
+ :ensure t
+ :custom
+ (org-roam-dailies-directory "daily/")
+ (org-roam-directory "~/org-roam")
+ (org-roam-capture-templates
+ '(("d" "default" plain
+ "%?"
+ :target (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n")
+ :unnarrowed t)
+ ("e" "encrypted" plain
+ "%?"
+ :target (file+head "%<%Y%m%d%H%M%S>-${slug}.org.gpg" "#+title: ${title}\n")
+ :unnarrowed t)))
+ (org-roam-dailies-capture-templates
+ '(("d" "default" entry "* %<%T>: %?"
+ :target (file+head "%<%Y-%m-%d>.org" "#+title: %<%Y-%m-%d>\n")
+ :unnarrowed t)))
+ :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)
+ ("C-c n n" . org-roam-dailies-capture-today)
+ ("C-c n t" . org-roam-dailies-goto-today)
+ :map org-roam-mode-map
+ ("y" . org-roam-dailies-goto-previous-note)
+ ("t" . org-roam-dailies-goto-next-note)
+ ("d" . org-roam-dailies-goto-date)
+ ("D" . org-roam-dailies-capture-date))
+ :bind-keymap ("C-c n D" . org-roam-mode-map)
+ :config
+ (org-roam-db-autosync-mode)
+ ;; Bind this to C-c n I
+ (defun org-roam-node-insert-immediate (arg &rest args)
+ (interactive "P")
+ (let ((args (cons arg args))
+ (org-roam-capture-templates (list (append (car org-roam-capture-templates)
+ '(:immediate-finish t)))))
+ (apply #'org-roam-node-insert args)))
+ :bind (("C-c n I" . org-roam-node-insert-immediate)))
+#+END_SRC
* Keybindings
-** org (links)
-#+begin_src emacs-lisp
-(global-set-key "\C-cl" 'org-store-link)
-(global-set-key "\C-ca" 'org-agenda)
-(global-set-key "\C-cb" 'org-iswitchb)
-(global-set-key "\C-cc" 'org-capture)
-#+end_src
** movement
#+begin_src emacs-lisp
;; some core bindings
@@ -585,16 +623,20 @@ If failed try to complete the common part with `company-complete-common'"
(use-package org
:init
(add-to-list 'org-modules 'org-habit)
+ :bind (("C-c l" . 'org-store-link)
+ ("C-c a" . 'org-agenda)
+ ("C-c b" . 'org-iswitchb)
+ ("C-c c" . 'org-capture))
:config
(setq org-src-tab-acts-natively t)
(setq org-directory "~/org/")
(setq org-highest-priority ?A)
(setq org-default-priority ?C)
(setq org-lowest-priority ?E)
- ;; (setq org-priority-faces
- ;; '((?A . (:foreground "#CC0000" :background "#FFE3E3"))
- ;; (?B . (:foreground "#64992C" :background "#EBF4DD"))
- ;; (?C . (:foreground "#64992C" :background "#FFFFFF"))))
+ (setq org-priority-faces
+ '((?A . (:foreground "#CC0000" :background "#FFE3E3"))
+ (?B . (:foreground "#64992C" :background "#EBF4DD"))
+ (?C . (:foreground "#64992C" :background "#FFFFFF"))))
(setq org-ellipsis "...")
(setq org-startup-indented nil)
(setq org-hide-leading-stars nil)