• Stars
    star
    100
  • Rank 340,703 (Top 7 %)
  • Language
    Emacs Lisp
  • License
    GNU General Publi...
  • Created about 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A powerful Org configuration

alpha-org

alpha-org is a powerful configuration for org-mode, similar to how Spacemacs and Doom are configurations for Emacs as a whole.

Screenshots

Theming is not included as part of this configuration; this is just an example showing doom-nord.

images/1.png

Usage

This can be used as a package which you install, or, since each feature is configured in its own use-package block, you may copy parts into your own config.

Installation

The easiest way to install the whole thing is with quelpa-use-package (which may be installed from MELPA), like so:

(require 'quelpa-use-package)
(use-package alpha-org
  :quelpa (alpha-org :fetcher github :repo "alphapapa/alpha-org"))

Sandbox

The script emacs-sandbox.sh can be used to try this configuration in a sandbox, separately from your existing Emacs configuration, like this:

$ emacs-sandbox.sh README.org

After Emacs opens this file, follow the instructions in the Installation section above, or load the alpha-org.el library, e.g. with M-x load-file RET alpha-org.el RET.

Key Bindings

To best demonstrate the power of this configuration, it’s necessary to bind some keys by default (because using M-x to access everything is relatively cumbersome). While this config isn’t designed to work with EVIL, similar to Spacemacs and Doom, all keys bound by this config are under a prefix key, which is M-SPC by default.

  • Inserting
    • Links
      • M-SPC ilu Insert link to URL at point or on clipboard with org-web-tools.
    • Timestamps
      • M-SPC it Insert current, inactive timestamp.
      • M-SPC iT Insert current, active timestamp.
  • Headings
    • M-SPC ha Go to heading in agenda files.
    • M-SPC hb Go to heading in current buffer.
    • M-SPC hp Go to parent of current heading.
    • M-SPC hr Go to a recent heading.
    • M-SPC hv Go to a visible heading.
  • Refiling
    • M-SPC rv Refile current heading to any currently visible heading.
  • View
    • M-SPC vs View default sidebars (org-sidebar-toggle).
    • M-SPC vt View tree sidebar (org-sidebar-tree-toggle).

DOING Tutorial / Demo

A step-by-step guide showing the use of some features would probably be helpful. Here’s a start:

  1. Install the alpha-org package.
  2. Open this README.org file.
  3. Press M-SPC vt to show the tree sidebar, and again to hide it.
  4. Press M-SPC vs to show the item sidebar, and again to hide it.
  5. Select the tree sidebar window and press <S-tab> to globally cycle the tree’s outline visibility. Press <tab> or click mouse-2 to cycle individual trees.
  6. Click on a heading (which one?) with mouse-1 in the tree sidebar to show that entry’s contents.
  7. Press M-SPC vt to show the tree sidebar for just that entry.
  8. In the tree sidebar, click and drag the on a heading to show more of its contents. Try clicking and dragging with both mouse-1 and mouse-2.

Requirements

These packages must already be installed:

Code

Header

This header is tangled to alpha-org.el, declaring package dependencies so that they can be installed automatically.

;;; alpha-org.el --- A powerful Org configuration           -*- lexical-binding: t; -*-

;; Author: Adam Porter <[email protected]>
;; Keywords: outlines

;; Package-Requires: ((emacs "26.3") (use-package) (general) (avy) (which-key) (org-bullets) (org-make-toc) (org-sidebar) (org-sticky-header))

;;; License:

;; Copyright (C) 2019  Adam Porter

;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this program.  If not, see <https://www.gnu.org/licenses/>.

;;; Commentary:

;; `alpha-org' is a powerful configuration for `org-mode', similar to
;; how Spacemacs and Doom are configurations for Emacs as a whole.

;;; Code:

;;;; Requirements

(require 'use-package)

(require 'cl-lib)
(require 'subr-x)

Non-Org

Code and packages that aren’t directly Org-related.

General

General is used to ease configuration of key bindings.

(use-package general
  :config
  (global-unset-key (kbd "M-SPC"))
  (general-create-definer alpha-org/general-def
    :prefix "M-SPC"))

Prefix key variable?

Can I use a variable for this prefix key?

which-key

MAYBE Hydra

MAYBE hercules

Org

Code and packages that are directly Org-related.

Configuration

;;;; Configuration

;;  This section includes configuration code for options and packages built-in to Org.

Appearance

(use-package org
  :custom (org-ellipsis "⋯"))

Lists

(use-package org
  :custom
  (org-list-demote-modify-bullet '(("+" . "-") ("-" . "+"))))

Speed commands

Speed commands provide one-key bindings to quickly navigate and manipulate outlines.

(use-package org
  :custom
  (org-use-speed-commands (lambda ()
                            (and (looking-at org-outline-regexp)
                                 (looking-back "^\**")))))
Link to Org documentation for speed command keys

org-indent-mode

This mode displays text indented to match its heading’s indentation. Text is not actually indented in the buffer.

(add-hook 'org-mode-hook 'org-indent-mode)
Comparison screenshot

Packages

These packages are included and configured by default. Each package links to its configuration code later in this file.

;;;; Packages

Contents

Agenda [0/1]

org-super-agenda

Appearance / UI [0/2]

DOING org-sidebar
(use-package org-sidebar
  :general
  (alpha-org/general-def
   "vs" #'org-sidebar-toggle
   "vt" #'org-sidebar-tree-toggle)
  :custom (org-sidebar-tree-side 'left))
yequake

The yequake-org-capture function is used to provide a quick capturing UI with drop-down Emacs windows that disappear automatically when a capture is finalized or canceled.

org-bullets

This mode replaces heading stars with visually appealing ones. Its settings can be customized in the org-bullets group.

(use-package org-bullets
  :hook (org-mode . org-bullets-mode))
Screenshot
org-sticky-header

This package displays in the header-line the Org heading for the node that’s at the top of the window. This way, if the heading for the text at the top of the window is beyond the top of the window, you don’t forget which heading the text belongs to. The display can be customized to show just the heading, the full outline path, or the full outline path in reverse.

(use-package org-sticky-header
  :hook (org-mode . org-sticky-header-mode))
Screenshot

Capture

org-web-tools
(use-package org-web-tools
  :general
  (alpha-org/general-def
    "ilu" #'org-web-tools-link-for-url))

Headings

org-recent-headings
(use-package org-recent-headings
  :general
  (alpha-org/general-def
    "hr" #'org-recent-headings-helm)
  :config
  (org-recent-headings-mode)
  :custom
  (org-recent-headings-reverse-paths t)
  (org-recent-headings-candidate-number-limit 100))
org-bookmark-heading
helm-org
(use-package helm-org
  :general
  (alpha-org/general-def
    "ha" #'helm-org-agenda-files-headings
    "hb" #'helm-org-in-buffer-headings
    "hp" #'helm-org-parent-headings)
  :custom
  (helm-org-format-outline-path t))

Miscellaneous

org-make-toc

This package automates customizeable tables of contents in Org files.

(use-package org-make-toc
  :hook (org-mode . org-make-toc-mode))
MAYBE unpackaged

Not sure if I should use it or move its Org-related code into this.

DOING Avy
(use-package avy
  :general
  (alpha-org/general-def
    "hv" #'alpha-org/goto-visible-heading
    "rv" #'alpha-org/refile-to-visible)

  :config
  (defun alpha-org/refile-to-visible ()
    "Refile current heading as first child of visible heading selected with Avy."
    ;; Inspired by `org-teleport':
    ;; http://kitchingroup.cheme.cmu.edu/blog/2016/03/18/Org-teleport-headlines/
    (interactive)
    ;; NOTE: Use `when-let' so that if avy is aborted with "C-g",
    ;; `org-refile' won't be called with a nil refile location.
    (when-let ((marker (alpha-org/avy-marker)))
      (let* ((filename (buffer-file-name (or (buffer-base-buffer
                                              (marker-buffer marker))
                                             (marker-buffer marker))))
             (heading (org-with-point-at marker
                        (org-get-heading 'no-tags 'no-todo)))
             ;; NOTE: I guess this won't work with target buffers
             ;; whose filename is nil, but I doubt I'll ever want to
             ;; do that.
             (rfloc (list heading filename nil marker))
             (org-after-refile-insert-hook (cons #'org-reveal org-after-refile-insert-hook)))
        (org-refile nil nil rfloc))))

  (defun alpha-org/goto-visible-heading ()
    "Go to visible heading selected with Avy."
    (interactive)
    (when-let* ((marker (alpha-org/avy-marker)))
      (with-current-buffer (marker-buffer marker)
        (goto-char marker))))

  (defun alpha-org/avy-marker ()
    "Return marker at Org heading selected with Avy."
    (save-excursion
      (when-let* ((org-reverse-note-order t)
                  (pos (avy-with avy-goto-line
                         (avy-jump (rx bol (1+ "*") (1+ blank))))))
        (when (integerp (car pos))
          ;; If avy is aborted with "C-g", it returns
          ;; `t', so we know it was NOT aborted when it
          ;; returns an int.  If it doesn't return an
          ;; int, we return nil.
          (copy-marker (car pos)))))))

Searching [0/5]

org-ql

Other Code

Tree-to-indirect-buffer command

My own function that works a bit better than the built-in one.

Demo it

Agenda for subtree command

Demo it

Outline tidying

My function that fixes blank lines between entries.

org-return-dwim

Should demo this too.

Refile within buffer

(defun ap/org-refile-within-buffer ()
  "Call `org-refile' with `org-refile-targets' set to current buffer's headings."
  ;; This works now, but it doesn't fontify the headings/paths like
  ;; Helm does, so it's faster but doesn't look as nice
  (interactive)
  (let ((org-refile-use-cache nil)
        (org-refile-use-outline-path t)
        (org-refile-targets (list (cons (list (buffer-file-name (or (buffer-base-buffer (current-buffer))
                                                                    (current-buffer))))
                                        (cons :maxlevel 20)))))
    (call-interactively 'org-refile)))

Footer

;;;; Footer

(provide 'alpha-org)

;;; alpha-org.el ends here

Ideas

MAYBE Organize code by features rather than packages

Users are more interested in features than what packages implement them. Even if a package were mentioned in more than one use-package form, it would still be helpful, because users could copy features rather than whole packages into their own configs.

Update tree sidebar with idle timer

e.g. to hide text from added entries (unless I can figure another way around that).

MAYBE Use font-locking to hide entry content in tree sidebar

Suggested in a comment on Reddit. I think I noted it in org-sidebar’s notes file.

Dim background of sidebar windows

Maybe something like auto-dim-other-buffers.

Hook to update sidebar item buffers when file is saved

Seems like a natural way to update it, even if not optimal.

With prefix, insert timestamps with calendar prompt

mouse-2 on headings in non-tree buffers to cycle visibility

MAYBE Jump to characters/words with Avy

Include sandbox script for testing and demonstration

Demo org-return-dwim

Demo org-sticky-header

Show how scrolling down past the heading still shows it in the header line.

MAYBE Scripted GIF screencast

Like this script.

Notes

Discussions

{RFC, WIP} alpha-org (a configuration like Spacemacs or Doom, but just for Org) : orgmode

File Configuration

File-local configuration.

More Repositories

1

org-super-agenda

Supercharge your Org daily/weekly agenda by grouping items
Emacs Lisp
1,182
star
2

org-ql

An Org-mode query language, including search commands and saved views
Emacs Lisp
1,159
star
3

emacs-package-dev-handbook

An Emacs package development handbook. Built with Emacs, by Emacs package developers, for Emacs package developers.
JavaScript
987
star
4

magit-todos

Show source files' TODOs (and FIXMEs, etc) in Magit status buffer
Emacs Lisp
601
star
5

org-web-tools

View, capture, and archive Web pages in Org-mode
Emacs Lisp
519
star
6

org-sidebar

A helpful sidebar for Org mode
Shell
492
star
7

org-rifle

Rifle through your Org-mode buffers and acquire your target
Emacs Lisp
488
star
8

org-protocol-capture-html

Capture HTML from the browser selection into Emacs as org-mode content
Emacs Lisp
442
star
9

bufler.el

A butler for your buffers. Group buffers into workspaces with programmable rules, and easily switch to and manipulate them.
Emacs Lisp
378
star
10

ement.el

Matrix client for Emacs
Emacs Lisp
354
star
11

unpackaged.el

A collection of useful Emacs Lisp code that isn't substantial enough to be packaged
Emacs Lisp
345
star
12

solarized-everything-css

A collection of Solarized user-stylesheets for...everything?
CSS
277
star
13

burly.el

Save and restore frames and windows with their buffers in Emacs
Emacs Lisp
252
star
14

matrix-client.el

A Matrix client for Emacs! (deprecated in favor of Ement.el)
Emacs Lisp
242
star
15

prism.el

Disperse Lisp forms (and other languages) into a spectrum of colors by depth
Emacs Lisp
228
star
16

org-graph-view

View Org buffers as a clickable, graphical mind-map
Emacs Lisp
190
star
17

pocket-reader.el

Emacs client for Pocket reading list (getpocket.com)
Emacs Lisp
188
star
18

yequake

Drop-down Emacs frames, like Yakuake
Emacs Lisp
175
star
19

ts.el

Emacs timestamp and date-time library
Emacs Lisp
159
star
20

dogears.el

Never lose your place in Emacs again
Emacs Lisp
154
star
21

with-emacs.sh

Script to easily run Emacs with specified configurations
Shell
142
star
22

makem.sh

Makefile-like script for building and testing Emacs Lisp packages
Shell
128
star
23

plz.el

An HTTP library for Emacs
Emacs Lisp
126
star
24

bucket

A bucket for your shell (like a set of registers, or a clipboard manager)
Shell
118
star
25

restic-runner

Configure and run Restic more easily
Shell
108
star
26

hammy.el

Programmable, interactive interval timers (e.g. for working/resting)
Emacs Lisp
103
star
27

org-sticky-header

Show off-screen Org heading at top of window
Emacs Lisp
103
star
28

org-make-toc

Automatic tables of contents for Org files
Shell
83
star
29

taxy.el

Programmable taxonomical hierarchies for arbitrary objects
Emacs Lisp
82
star
30

transclusion-in-emacs

Resources about implementing transclusion in Emacs
79
star
31

topsy.el

Simple sticky header showing definition beyond top of window
Emacs Lisp
77
star
32

org-bookmark-heading

Emacs bookmark support for Org-mode
Emacs Lisp
75
star
33

snow.el

Let it snow in Emacs!
Emacs Lisp
72
star
34

org-now

Conveniently show current Org tasks in a sidebar window
Emacs Lisp
50
star
35

bashcaster

An actually simple screen recorder for Linux
Shell
48
star
36

org-recent-headings

Go to recently used Org headings
Shell
47
star
37

obvious.el

Who needs comments when the code is so obvious
Emacs Lisp
46
star
38

frame-purpose.el

Purpose-specific frames for Emacs
Emacs Lisp
46
star
39

org-almanac

Almanac for Org mode
43
star
40

mosey.el

Mosey around inside your Emacs buffer
Emacs Lisp
37
star
41

org-html-theme-darksun

A Solarized Dark version of the Bigblow Org HTML export theme
JavaScript
36
star
42

salv.el

Local minor mode to save a buffer when Emacs is idle
Emacs Lisp
33
star
43

sword-to-org

Convert Sword modules to Org-mode outlines
Emacs Lisp
33
star
44

org-auto-expand

Automatically expand certain Org headings
Shell
28
star
45

mangle

Mangle man pages to show just the parts you need (suitable for aliasing to "man")
Shell
26
star
46

magit.sh

Run Magit in a separate Emacs instance
Shell
26
star
47

org-notely

Pop to new Org headings for quick notetaking
Shell
26
star
48

scrollkeeper.el

Configurable scrolling commands with visual guidelines, for Emacs
Emacs Lisp
22
star
49

ap.el

A simple, Emacs Lisp-focused Emacs config
Emacs Lisp
21
star
50

highlight-function-calls

Highlight function/macro calls in Emacs
Emacs Lisp
21
star
51

org-quick-peek

Quick inline peeks at agenda items and linked nodes in Org-mode
Emacs Lisp
21
star
52

defrepeater.el

Easily define repeatable Emacs commands
Emacs Lisp
20
star
53

pocket-lib.el

Emacs library for the getpocket.com API
Emacs Lisp
19
star
54

org-pocket

Tools to use Pocket with Org-mode
Emacs Lisp
16
star
55

elexandria

Alexandria-like library for Emacs Lisp
Emacs Lisp
13
star
56

sword-converter

Convert SWORD modules to JSON and SQLite and search the converted files
Emacs Lisp
13
star
57

frecency.el

Library to sort items by "frecency" in Emacs
Emacs Lisp
11
star
58

chromatext.el

Apply color gradients to lines of text in Emacs (possibly increasing legibility)
Emacs Lisp
9
star
59

plamix

Mix together M3U playlists, optionally with a desired duration, outputting either a list of files to STDOUT, or writing an M3U playlist to a file
Python
9
star
60

pyza

A command-line/terminal/console Songza player, using VLC or MPD to play audio
Python
8
star
61

melpa-stats

Stats tools for MELPA
Emacs Lisp
6
star
62

org-books

Tools for books in Org-mode
Emacs Lisp
5
star
63

rubbish.py

WIP: A CLI to the XDG trash bin in Python
Python
5
star
64

tp.el

Emacs text-property convenience library
Emacs Lisp
5
star
65

org-search-goto

org-search-goto
Emacs Lisp
5
star
66

buffer-groups.el

A lightweight, automatic grouping rule-based buffer grouper and switcher
Emacs Lisp
5
star
67

ibuffer-auto-groups

Automatically make groups for ibuffer
Emacs Lisp
5
star
68

ampd-tools

A small collection of MPD-related tools
Python
4
star
69

reddit-emacs-css

CSS for /r/emacs
CSS
4
star
70

ox-elisp

Export Org buffers to Emacs Lisp comments
Emacs Lisp
3
star
71

dbg.el

Simple debugging macros
Emacs Lisp
3
star
72

tabtint

Firefox extension which tints Firefox tabs to match color of web page
JavaScript
3
star
73

ya-solarized.el

Yet Another Solarized theme for Emacs
Emacs Lisp
2
star
74

overwatch-formula76

A racing custom game type for Overwatch
C
2
star
75

overwatch-custom-games

A collection of custom games for Overwatch
Emacs Lisp
2
star
76

listen.el

Audio/music player for Emacs
Emacs Lisp
2
star
77

unsplash.hy

Hy
1
star
78

helm-swish

Like helm-swoop, but a little bit faster
Emacs Lisp
1
star
79

greek-hebrew-emacs

How to set up Emacs to easily type Greek and Hebrew
1
star
80

source-status-linker

Turns output of Source engine's status command into links to Steam user profiles
Python
1
star
81

pentadactyl-tabmattach

JavaScript
1
star
82

github-solarized

A Solarized user stylesheet for GitHub made with Stylus
CSS
1
star