new layer: outshine (with outorg support)

outshine layer: Add "Features:" section to the README

outorg: use `a O` instead of `a o o` as a prefix

outshine: add transient state

outshine layer: (re)document keybindings, add imenu keybinding

outshine layer: fix outorg mode keybinding documentation

address review comments
This commit is contained in:
Langston Barrett 2019-02-09 14:44:30 -08:00 committed by duianto
parent 04b80d610a
commit af6b1479f3
5 changed files with 131 additions and 1 deletions

View File

@ -397,6 +397,7 @@ sane way, here is the complete list of changed key bindings
**** Music
- pianobar (thanks to Leo Littlebook)
- tidalcycles (thanks to rbino)
- outshine (thanks to Langston Barrett)
**** Readers
- epub (thanks to Jeremy Dormitzer and André Peric Tavares)
**** Spacemacs

View File

@ -365,6 +365,7 @@ Will work on both org-mode and any mode that accepts plain html."
"ao#" 'org-agenda-list-stuck-projects
"ao/" 'org-occur-in-agenda-files
"aoa" 'org-agenda-list
"aoo" 'org-agenda
"aoc" 'org-capture
"aoe" 'org-store-agenda-views
"aofi" 'org-feed-goto-inbox
@ -382,7 +383,6 @@ Will work on both org-mode and any mode that accepts plain html."
"aol" 'org-store-link
"aom" 'org-tags-view
"aoo" 'org-agenda
"aos" 'org-search-view
"aot" 'org-todo-list
;; SPC C- capture/colors

View File

@ -0,0 +1,41 @@
#+TITLE: outshine layer
#+TAGS: emacs|layer
* Table of Contents :TOC_4_gh:noexport:
- [[#description][Description]]
- [[#features][Features:]]
- [[#install][Install]]
- [[#key-bindings][Key bindings]]
* Description
This layer adds support for [[https://github.com/alphapapa/outshine][outshine]] and [[https://github.com/alphapapa/outorg][outorg]]. They will be enabled in all
programming modes.
** Features:
- Navigate through code buffers via headings like you do with org buffers
- Edit comments under outline headings in separate org-mode buffers
* Install
To use this configuration layer, add it to your =~/.spacemacs=. You will need to
add =outshine= to the existing =dotspacemacs-configuration-layers= list in this
file.
* Key bindings
| Key Binding | Description |
|---------------+------------------------------------------------------------|
| ~SPC a O S~ | Show the contents of all outline sections |
| ~SPC a O .~ | Structural navigation/editing transient state |
| ~SPC a O c~ | Save the edits back to the original file |
| ~SPC a O e~ | Edit the current heading as org |
| ~SPC a O g u~ | Navigate up an outline heading |
| ~SPC a O g n~ | Navigate to the next outline heading |
| ~SPC a O g j~ | Navigate to the next outline heading at the same level |
| ~SPC a O g j~ | Navigate to the previous outline heading at the same level |
| ~SPC a O i h~ | Insert an outline heading |
| ~SPC a O I~ | imenu of outshine headlines |
| ~SPC a O J~ | Move the current outline subtree down |
| ~SPC a O K~ | Move the current outline subtree up |
| ~SPC a O >~ | Demote the current outline subtree |
| ~SPC a O <~ | Promote the current outline subtree |

View File

@ -0,0 +1,12 @@
;;; layers.el --- Outshine layers File for Spacemacs
;;
;; Copyright (c) 2012-2019 Sylvain Benner & Contributors
;;
;; Author: Langston Barrett <langston.barrett@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
(configuration-layer/declare-layers '(org))

View File

@ -0,0 +1,76 @@
;;; packages.el --- Outshine layer packages file for Spacemacs.
;;
;; Copyright (c) 2012-2019 Sylvain Benner & Contributors
;;
;; Author: Langston Barrett <langston.barrett@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
(defconst outshine-packages
'(outshine
outorg))
(defun outshine/init-outshine ()
(use-package outshine
:defer t
:init
(progn
(add-hook 'prog-mode-hook 'outline-minor-mode)
(add-hook 'outline-minor-mode-hook 'outshine-mode))
:config
(progn
(spacemacs|hide-lighter outline-minor-mode)
(spacemacs|hide-lighter outshine-mode)
(spacemacs/declare-prefix "aO" "out(line/org/shine)")
(spacemacs/declare-prefix "aOg" "goto")
(spacemacs/declare-prefix "aOi" "insert")
(spacemacs/set-leader-keys
"aO." 'spacemacs/outshine-transient-state/body
"aOS" 'outline-show-all
"aOgu" 'outline-up-heading
"aOgn" 'outline-next-heading
"aOgj" 'outline-forward-same-level
"aOgk" 'outline-backward-same-level
"aOih" 'outline-insert-heading
"aOI" 'outshine-imenu
"aOK" 'outline-move-subtree-up
"aOJ" 'outline-move-subtree-down
"aO>" 'outline-demote
"aO<" 'outline-promote))
(spacemacs|define-transient-state outshine
:title "Outshine Transient State"
:doc "
Navigate headings^^^^ Move subtrees^^^^ Other^^
^^^^ ^^^^ ^^
[_j_/_k_] down/up [_J_/_K_] move subtree down/up [_q_] quit
[_n_/_N_] next/up heading [_>_/_<_] demote/promote [_i_] insert heading
[_I_]^^ heading imenu"
:bindings
("q" nil :exit t)
("i" outline-insert-heading :exit t)
("I" outshine-imenu :exit t)
;; Navigate headings
("n" outline-next-heading)
("N" outline-up-heading)
("j" outline-forward-same-level)
("k" outline-backward-same-level)
;; Move headings
("J" outline-move-subtree-down)
("K" outline-move-subtree-up)
;; Move headings
(">" outline-demote)
("<" outline-promote))))
(defun outshine/init-outorg ()
(use-package outorg
:defer t
:config
(progn
(spacemacs/set-leader-keys
"aOc" 'outorg-copy-edits-and-exit
"aOe" 'outorg-edit-as-org))))
;;; packages.el ends here