Skip to content

Instantly share code, notes, and snippets.

@improve100
Forked from cjp/.el
Created November 1, 2020 06:44
Show Gist options
  • Save improve100/87ff490325343285d11d967158e5ad7d to your computer and use it in GitHub Desktop.
Save improve100/87ff490325343285d11d967158e5ad7d to your computer and use it in GitHub Desktop.
How to get org-protocol to work with spacemacs
;; I have no idea why it works. This is the product of 4 hours of trial-and-error.
(defun dotspacemacs/user-init ()
"Initialization function for user code.
It is called immediately after `dotspacemacs/init'. You are free to put almost
any user code here. The exception is org related code, which should be placed
in `dotspacemacs/user-config'."
(server-start)
(require 'org-protocol)
)
(defun dotspacemacs/user-config ()
"Configuration function for user code.
This function is called at the very end of Spacemacs initialization after
layers configuration. You are free to put any user code."
(with-eval-after-load 'org
(add-to-list 'org-modules 'org-protocol)
(setq org-capture-templates '(
("p" "Protocol" entry (file+headline "~/org/notes.org" "Inbox")
"* %^{Title}\nSource: %u, %c\n #+BEGIN_QUOTE\n%i\n#+END_QUOTE\n\n\n%?")
("L" "Protocol Link" entry (file+headline "~/org/notes.org" "Inbox")
"* %? [[%:link][%:description]] \nCaptured On: %U")))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment