Move org-brain to org layer

Add condition on Emacs 25
This commit is contained in:
Eivind Fonn 2017-06-13 12:52:20 +02:00
parent 940a72481a
commit 17124e2b8f
5 changed files with 43 additions and 125 deletions

View File

@ -1,52 +0,0 @@
#+TITLE: org-brain layer
# The maximum height of the logo should be 200 pixels.
[[img/org-brain.png]]
# TOC links should be GitHub style anchors.
* Table of Contents :TOC_4_gh:noexport:
- [[#description][Description]]
- [[#install][Install]]
- [[#key-bindings][Key bindings]]
- [[#application-key-bindings][Application key bindings]]
- [[#visualize-mode-keybindings][Visualize-mode keybindings]]
* Description
This layer adds the excellent ~org-brain~ package to spacemacs, which is introduced at https://kungsgeten.github.io/org-brain.html.
For more information, see https://github.com/Kungsgeten/org-brain.
* Install
To use this configuration layer, add it to your =~/.spacemacs=. You will need to
add =org-brain= to the existing =dotspacemacs-configuration-layers= list in this
file.
* Key bindings
** Application key bindings
| Key Binding | Description |
|-------------+------------------------------|
| ~SPC a o b~ | Opens a new org-brain entry |
| ~SPC a o B~ | Visualize an org-brain entry |
** Visualize-mode keybindings
| Key Binding | Description |
|-------------+---------------------------------------|
| ~j / TAB~ | Goto next link |
| ~k / S-TAB~ | Goto previous link |
| ~c~ | Add child |
| ~p~ | Add parent |
| ~l~ | Add resource link |
| ~C-y~ | Paste resource link |
| ~a~ | Add resource [[http://orgmode.org/manual/Attachments.html][attachment]] |
| ~o~ | Open and edit the visualized entry |
| ~f~ | Find/visit another entry to visualize |
| ~r~ | Rename this, or another, entry |
# Use GitHub URLs if you wish to link a Spacemacs documentation file or its heading.
# Examples:
# [[https://github.com/syl20bnr/spacemacs/blob/master/doc/VIMUSERS.org#sessions]]
# [[https://github.com/syl20bnr/spacemacs/blob/master/layers/%2Bfun/emoji/README.org][Link to Emoji layer README.org]]
# If space-doc-mode is enabled, Spacemacs will open a local copy of the linked file.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

View File

@ -1,73 +0,0 @@
;;; packages.el --- org-brain layer packages file for Spacemacs.
;;
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;;
;; Author: Matthías Páll Gissurarson <tritlo@phasma>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
;;; Commentary:
;; See the Spacemacs documentation and FAQs for instructions on how to implement
;; a new layer:
;;
;; SPC h SPC layers RET
;;
;;
;; Briefly, each package to be installed or configured by this layer should be
;; added to `org-brain-packages'. Then, for each package PACKAGE:
;;
;; - If PACKAGE is not referenced by any other Spacemacs layer, define a
;; function `org-brain/init-PACKAGE' to load and initialize the package.
;; - Otherwise, PACKAGE is already referenced by another Spacemacs layer, so
;; define the functions `org-brain/pre-init-PACKAGE' and/or
;; `org-brain/post-init-PACKAGE' to customize the package as it is loaded.
;;; Code:
(defconst org-brain-packages
'(org-brain)
"The list of Lisp packages required by the org-brain layer.
Each entry is either:
1. A symbol, which is interpreted as a package to be installed, or
2. A list of the form (PACKAGE KEYS...), where PACKAGE is the
name of the package to be installed or loaded, and KEYS are
any number of keyword-value-pairs.
The following keys are accepted:
- :excluded (t or nil): Prevent the package from being loaded
if value is non-nil
- :location: Specify a custom installation location.
The following values are legal:
- The symbol `elpa' (default) means PACKAGE will be
installed using the Emacs package manager.
- The symbol `local' directs Spacemacs to load the file at
`./local/PACKAGE/PACKAGE.el'
- A list beginning with the symbol `recipe' is a melpa
recipe. See: https://github.com/milkypostman/melpa#recipe-format")
(defun org-brain/init-org-brain ()
(use-package org-brain
:defer t
:init
(progn
(spacemacs/set-leader-keys
;; org-brain
"aob" 'org-brain-open
"aoB" 'org-brain-visualize)
(evil-set-initial-state 'org-brain-visualize-mode 'emacs))))
;;; packages.el ends here

View File

@ -16,6 +16,7 @@
- [[#org-journal-support][Org-journal support]]
- [[#different-bullets][Different bullets]]
- [[#project-support][Project support]]
- [[#org-brain-support][Org-brain support]]
- [[#mode-line-support][Mode line support]]
- [[#key-bindings][Key bindings]]
- [[#starting-org-mode][Starting org-mode]]
@ -36,6 +37,9 @@
- [[#presentation][Presentation]]
- [[#org-projectile][Org-projectile]]
- [[#org-journal][Org-journal]]
- [[#org-brain][Org-brain]]
- [[#application-bindings][Application bindings]]
- [[#visualization-bindings][Visualization bindings]]
* Description
This layer enables [[http://orgmode.org/][org mode]] for Spacemacs.
@ -235,6 +239,10 @@ the following snippet. Note that this may have unintended consequences until
(push (org-projectile:todo-files) org-agenda-files))
#+END_SRC
** Org-brain support
For Emacs 25 or later, support for [[https://kungsgeten.github.io/org-brain.html][org-brain]] is included. See the [[https://github.com/Kungsgeten/org-brain][org-brain
package documentation]] for more information.
** Mode line support
To temporarily enable mode line display of org clock, press ~SPC t m c~.
@ -600,3 +608,27 @@ are available.
| ~SPC m j~ | New journal entry |
| ~SPC m p~ | Previous journal entry |
| ~SPC m n~ | Next journal entry |
** Org-brain
*** Application bindings
| Key Binding | Description |
|-------------+------------------------------|
| ~SPC a o b~ | Opens a new org-brain entry |
| ~SPC a o B~ | Visualize an org-brain entry |
*** Visualization bindings
| Key Binding | Description |
|-------------+---------------------------------------|
| ~j / TAB~ | Goto next link |
| ~k / S-TAB~ | Goto previous link |
| ~c~ | Add child |
| ~p~ | Add parent |
| ~l~ | Add resource link |
| ~C-y~ | Paste resource link |
| ~a~ | Add resource [[http://orgmode.org/manual/Attachments.html][attachment]] |
| ~o~ | Open and edit the visualized entry |
| ~f~ | Find/visit another entry to visualize |
| ~r~ | Rename this, or another, entry |

View File

@ -22,6 +22,7 @@
(ob :location built-in)
(org :location built-in)
(org-agenda :location built-in)
(org-brain :toggle (version<= "25" emacs-version))
(org-expiry :location built-in)
(org-journal :toggle org-enable-org-journal-support)
org-download
@ -450,6 +451,16 @@ Headline^^ Visit entry^^ Filter^^ Da
(kbd "M-SPC") 'spacemacs/org-agenda-transient-state/body
(kbd "s-M-SPC") 'spacemacs/org-agenda-transient-state/body)))
(defun org/init-org-brain ()
(use-package org-brain
:defer t
:init
(progn
(spacemacs/set-leader-keys
"aob" 'org-brain-open
"aoB" 'org-brain-visualize)
(evil-set-initial-state 'org-brain-visualize-mode 'emacs))))
(defun org/init-org-expiry ()
(use-package org-expiry
:commands (org-expiry-insinuate