dotfiles

feels like ${HOME}
Log | Files | Refs | README

commit 42fd9153deef2a02f21e62d8d7d03cd26b0459ab
parent c2e04333a6ef7fb456ff164159ffa2442935a000
Author: Yohanes Bandung Bondowoso <hi@ybbond.dev>
Date:   Thu, 25 Jun 2020 14:23:46 +0700

update Doom Emacs setting

Diffstat:
A.doom.d/+org.el | 94+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.doom.d/+ui.el | 35+++++++++++++++++++++++++++++++++++
M.doom.d/config.el | 13+++++--------
M.doom.d/init.el | 6+++---

4 files changed, 137 insertions(+), 11 deletions(-)

diff --git a/.doom.d/+org.el b/.doom.d/+org.el
@@ -0,0 +1,94 @@
+;;; ~/.doom.d/+org.el -*- lexical-binding: t; -*-
+
+;; source https://github.com/theianjones/dotfiles/blob/master/.doom.d/+org.el
+
+;; (setq org_notes "~/Library/Mobile Documents/com\~apple\~CloudDocs/Notes"
+(setq org_notes "~/Notes"
+      org-directory org_notes
+      org-ellipsis " ▼ "
+      deft-directory org_notes)
+
+;; I use C-c c to start capture mode
+(global-set-key (kbd "C-c c") 'org-capture)
+
+(setq org-todo-state-tags-triggers
+      (quote (("CANCELLED" ("CANCELLED" . t))
+              ("WAITING" ("WAITING" . t))
+              ("HOLD" ("WAITING") ("HOLD" . t))
+              (done ("WAITING") ("HOLD"))
+              ("TODO" ("WAITING") ("CANCELLED") ("HOLD"))
+              ("NEXT" ("WAITING") ("CANCELLED") ("HOLD"))
+              ("DONE" ("WAITING") ("CANCELLED") ("HOLD")))))
+
+;; Org roam
+(after! org-roam
+  (setq org-roam-directory org_notes)
+  (add-hook 'after-init-hook 'org-roam-mode)
+  (setq org-roam-graph-viewer "/usr/bin/open")
+  (setq org-roam-capture-ref-templates
+        '(("r" "ref" plain (function org-roam-capture--get-point)
+           "%?"
+           :file-name "websites/${slug}"
+           :head "#+TITLE: ${title}\n#+ROAM_KEY: ${ref}\n- SOURCE :: ${ref}"
+           :unnarrowed t))))
+  (setq org-roam-dailies-capture-templates
+    '(("d" "daily" plain (function org-roam-capture--get-point)
+      "%?"
+      :immediate-finish t
+      :file-name "journals/%<%Y-%m-%d>"
+      :head "#+TITLE: %<%A>, %<%d> %<%B> %<%Y>"
+      :unnarrowed t)))
+  (setq org-roam-capture-templates
+        '(("d" "default" plain (function org-roam-capture--get-point)
+           "%?"
+           :file-name "%<%Y%m%d%H%M%S>-${slug}"
+           :head "#+TITLE: ${title}\n"
+           :unnarrowed t)))
+
+(use-package deft
+  :after org
+  :bind
+  ("C-c n d" . deft)
+  :config
+  (setq deft-recursive t)
+  (setq deft-use-filter-string-for-filename t)
+  (setq deft-incremental-search t))
+
+(use-package org-journal
+  :bind
+  ("C-c n j" . org-journal-new-entry)
+  :config
+  (setq org-journal-dir "~/Notes/journals/")
+  (setq org-journal-date-prefix "#+TITLE: ")
+  (setq org-journal-file-format "%Y-%m-%d.org")
+  (setq org-journal-date-format "%A, %d %B %Y"))
+(setq org-journal-enable-agenda-integration t)
+
+(after! org
+  (map! :map org-mode-map
+        :n "M-j" #'org-metadown
+        :n "M-k" #'orge-metaup))
+
+;; (use-package org-roam-server
+;;     :ensure t)
+
+;; (add-hook 'org-roam-server-mode (lambda () (browse-url-chrome "http://localhost:3001")))
+
+;; Refile a heading to another buffer
+;; Allows you to refile into different files - specifically to
+;; create new 'parent' headings
+(setq org-refile-use-outline-path 'file)
+;; makes org-refile outline working with helm/ivy
+(setq org-outline-path-complete-in-steps nil)
+(setq org-refile-allow-creating-parent-nodes 'confirm)
+(defun +org/opened-buffer-files ()
+  "Return the list of files currently opened in emacs"
+  (delq nil
+        (mapcar (lambda (x)
+                  (if (and (buffer-file-name x)
+                           (string-match "\\.org$"
+                                         (buffer-file-name x)))
+                      (buffer-file-name x)))
+                (buffer-list))))
+
+(setq org-refile-targets '((+org/opened-buffer-files :maxlevel . 9)))
diff --git a/.doom.d/+ui.el b/.doom.d/+ui.el
@@ -0,0 +1,35 @@
+;;; ~/.doom.d/+ui.el -*- lexical-binding: t; -*-
+
+;; source https://github.com/theianjones/dotfiles/blob/master/.doom.d/+ui.el
+
+;; Doom exposes five (optional) variables for controlling fonts in Doom. Here
+;; are the three important ones:
+;;
+;; + `doom-font'
+;; + `doom-variable-pitch-font'
+;; + `doom-big-font' -- used for `doom-big-font-mode'; use this for
+;;   presentations or streaming.
+;;
+;; They all accept either a font-spec, font string ("Input Mono-12"), or xlfd
+;; font string. You generally only need these two:
+;; (setq doom-font (font-spec :family "IBM Plex Mono" :size 14))
+
+;; (use-package mixed-pitch
+;;   :hook
+;;   ;; If you want it in all text modes:
+;;   (text-mode . mixed-pitch-mode))
+
+;; There are two ways to load a theme. Both assume the theme is installed and
+;; available. You can either set `doom-theme' or manually load a theme with the
+;; `load-theme' function. This is the default:
+;; light theme: white
+(setq doom-theme 'doom-one)
+
+
+;; This determines the style of line numbers in effect. If set to `nil', line
+;; numbers are disabled. For relative line numbers, set this to `relative'.
+(setq display-line-numbers-type 'relative)
+
+;; Disable clipboard altogether.
+;; Use clipboard register to copy-paste with system clipboard!
+(setq select-enable-clipboard nil)
diff --git a/.doom.d/config.el b/.doom.d/config.el
@@ -14,15 +14,10 @@
 ;;       doom-variable-pitch-font (font-spec :family "sans" :size 13))
 
 (setq user-full-name "Yohanes Bandung Bondowoso"
-      user-mail-address "hi@ybbond.dev"
-
-      display-line-numbers-type 'relative
-      select-enable-clipboard nil
-      doom-theme 'doom-one)
-
-(setq org-directory "~/org/"
-      org-ellipsis " ▼ ")
+      user-mail-address "hi@ybbond.dev")
 
+(load! "+ui")
+(load! "+org")
 
 ;; Here are some additional functions/macros that could help you configure Doom:
 ;;
@@ -40,3 +35,5 @@
 ;;
 ;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how
 ;; they are implemented.
+
+(map! :iv "s-v" (lambda! (evil-paste-from-register ?+)))
diff --git a/.doom.d/init.el b/.doom.d/init.el
@@ -19,13 +19,13 @@
        ;;japanese
 
        :completion
-       company           ; the ultimate code completion backend
+       (company +childframe)           ; the ultimate code completion backend
        ;;helm              ; the *other* search engine for love and life
        ;;ido               ; the other *other* search engine...
        ivy               ; a search engine for love and life
 
        :ui
-       ;;deft              ; notational velocity for Emacs
+       deft              ; notational velocity for Emacs
        doom              ; what makes DOOM look the way it does
        doom-dashboard    ; a nifty splash screen for Emacs
        doom-quit         ; DOOM quit-message prompts when you quit Emacs
@@ -141,7 +141,7 @@
        ;;nim               ; python + lisp at the speed of c
        ;;nix               ; I hereby declare "nix geht mehr!"
        ;;ocaml             ; an objective camel
-       org               ; organize your plain life in plain text
+       (org +roam)               ; organize your plain life in plain text
        ;;php               ; perl's insecure younger brother
        ;;plantuml          ; diagrams for confusing people more
        ;;purescript        ; javascript, but functional