├── .gitignore ├── Makefile ├── README.md ├── bin ├── byte-compile ├── emacsclient ├── g ├── lss ├── nocaps ├── open-browser ├── pg ├── stream ├── tangle ├── up └── ydl ├── eos-appearance.org ├── eos-clojure.org ├── eos-completion.org ├── eos-core.org ├── eos-develop.org ├── eos-dired.org ├── eos-distributed.org ├── eos-es.org ├── eos-git.org ├── eos-gtd.org ├── eos-helm.org ├── eos-ido.org ├── eos-irc.org ├── eos-ivy.org ├── eos-java.org ├── eos-leisure.org ├── eos-mail.org ├── eos-music.org ├── eos-navigation.org ├── eos-notify.org ├── eos-org.org ├── eos-remote.org ├── eos-rss.org ├── eos-shell.org ├── eos-twitter.org ├── eos-vertico.org ├── eos-web.org ├── eos-writing.org ├── eos.org ├── index.html ├── out ├── README ├── bashrc.d │ └── README └── zsh.d │ └── README ├── setupfiles ├── default-wide.setup ├── default.setup ├── eos.setup ├── et-book │ ├── et-book-bold-line-figures │ │ ├── et-book-bold-line-figures.eot │ │ ├── et-book-bold-line-figures.svg │ │ ├── et-book-bold-line-figures.ttf │ │ └── et-book-bold-line-figures.woff │ ├── et-book-display-italic-old-style-figures │ │ ├── et-book-display-italic-old-style-figures.eot │ │ ├── et-book-display-italic-old-style-figures.svg │ │ ├── et-book-display-italic-old-style-figures.ttf │ │ └── et-book-display-italic-old-style-figures.woff │ ├── et-book-roman-line-figures │ │ ├── et-book-roman-line-figures.eot │ │ ├── et-book-roman-line-figures.svg │ │ ├── et-book-roman-line-figures.ttf │ │ └── et-book-roman-line-figures.woff │ ├── et-book-roman-old-style-figures │ │ ├── et-book-roman-old-style-figures.eot │ │ ├── et-book-roman-old-style-figures.svg │ │ ├── et-book-roman-old-style-figures.ttf │ │ └── et-book-roman-old-style-figures.woff │ └── et-book-semi-bold-old-style-figures │ │ ├── et-book-semi-bold-old-style-figures.eot │ │ ├── et-book-semi-bold-old-style-figures.svg │ │ ├── et-book-semi-bold-old-style-figures.ttf │ │ └── et-book-semi-bold-old-style-figures.woff ├── org-spec.css ├── org-spec.setup ├── org.css ├── org2.css ├── org3.css ├── tufte.css ├── tufte.setup └── vertical.setup ├── sh └── README ├── site-lisp ├── bookmark+ │ ├── bookmark+-1.el │ ├── bookmark+-bmu.el │ ├── bookmark+-chg.el │ ├── bookmark+-doc.el │ ├── bookmark+-key.el │ ├── bookmark+-lit.el │ ├── bookmark+-mac.el │ ├── bookmark+.el │ ├── bookmark-add.el │ └── bookmark-iterator.el ├── snippets │ └── snippets │ │ ├── clojure-mode │ │ ├── defn │ │ └── ns │ │ ├── es-mode │ │ └── new-index │ │ └── org-mode │ │ ├── bgd │ │ ├── els │ │ ├── gnup │ │ ├── header │ │ ├── mki │ │ ├── nex │ │ ├── ses │ │ ├── shellorg │ │ └── shs └── so-long.el └── zsh.org /.gitignore: -------------------------------------------------------------------------------- 1 | initialize.sh 2 | *.sh 3 | *.el 4 | *.el~ 5 | *.elc 6 | out/ 7 | sh/ 8 | images/ 9 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # Directory where this Makefile exists (the dotfiles directory) 2 | EOS_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) 3 | 4 | el-modules = eos-core.el \ 5 | eos-helm.el \ 6 | eos-vertico.el \ 7 | eos-ido.el \ 8 | eos-ivy.el \ 9 | eos-appearance.el \ 10 | eos-navigation.el \ 11 | eos-notify.el \ 12 | eos-develop.el \ 13 | eos-git.el \ 14 | eos-completion.el \ 15 | eos-es.el \ 16 | eos-org.el \ 17 | eos-writing.el \ 18 | eos-dired.el \ 19 | eos-remote.el \ 20 | eos-java.el \ 21 | eos-clojure.el \ 22 | eos-web.el \ 23 | eos-shell.el \ 24 | eos-mail.el \ 25 | eos-irc.el \ 26 | eos-distributed.el \ 27 | eos-rss.el \ 28 | eos-twitter.el \ 29 | eos-leisure.el \ 30 | eos-music.el \ 31 | eos.el 32 | 33 | sh-modules = out/zshrc \ 34 | out/zshenv 35 | 36 | all: init $(el-modules) $(sh-modules) 37 | 38 | clean: 39 | rm -fv *.el 40 | rm -fv *.elc 41 | rm -fv sh/*.sh 42 | 43 | init: initialize.sh 44 | initialize.sh: eos.org 45 | bin/tangle eos.org 46 | 47 | install.sh: eos.org 48 | bin/tangle eos.org 49 | 50 | run-init: init 51 | zsh initialize.sh 52 | 53 | out/zshrc: zsh.org 54 | bin/tangle zsh.org 55 | 56 | out/zshenv: zsh.org 57 | bin/tangle zsh.org 58 | 59 | %.el: %.org 60 | bin/tangle $< 61 | 62 | byte-compile-site-lisp: all 63 | find site-lisp -name "*.el" -exec bin/byte-compile {} \; 64 | 65 | byte-compile-all: all 66 | for f in *.el; do \ 67 | bin/byte-compile $$f; \ 68 | done 69 | 70 | run: all 71 | for f in sh/*.sh; do \ 72 | echo "Running: $$f"; \ 73 | zsh -l $$f; \ 74 | done 75 | 76 | install: run-init run install.sh 77 | zsh -l install.sh 78 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # EOS 2 | 3 | Welcome to the _Emacs Of Things_. Wait no, I meant the **Emacs Operating 4 | System**. 5 | 6 | This is not ready for consumption yet. 7 | 8 | See [eos.org](eos.org) for the intro. 9 | 10 | You can see a preliminary version of this at 11 | [http://writequit.org/eos/eos.html](http://writequit.org/eos/eos.html) 12 | -------------------------------------------------------------------------------- /bin/byte-compile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # -*- mode: shell-script -*- 3 | # 4 | # Byte compile .el file with emacs 5 | # Example usage: 6 | # ∴ byte-compile thing.el 7 | # Byte-compiling: thing.el 8 | 9 | # Set this to the location of your emacs executable 10 | EMACSCMD="emacs" 11 | 12 | # wrap each argument in the code required to byte-compile it 13 | DIR=`pwd` 14 | FILES="" 15 | for file in $@; do 16 | echo "Byte-compiling: $file" 17 | $EMACSCMD -nw --batch --eval " 18 | (progn 19 | (byte-compile-file (expand-file-name \"$file\" \"$DIR\")))" 2>&1 20 | done 21 | -------------------------------------------------------------------------------- /bin/emacsclient: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Script that looks in a number of different of different places for 4 | # `emacsclient`, and uses it if found. Otherwise it falls back to `emacsclient` 5 | # in the path. 6 | 7 | TERM=xterm-256color 8 | EC=emacsclient 9 | 10 | if [ -s /usr/local/bin/emacsclient ]; then 11 | EC=/usr/local/bin/emacsclient 12 | elif [ -s $EMACS_HOME/emacsclient ]; then 13 | EC=$EMACS_HOME/emacsclient 14 | elif [ -s /usr/local/Cellar/emacs/HEAD/bin/emacsclient ]; then 15 | EC=/usr/local/Cellar/emacs/HEAD/bin/emacsclient 16 | elif [ -s /usr/bin/emacsclient ]; then 17 | EC=/bin/emacsclient 18 | else 19 | echo "Unable to find emacsclient!" 20 | exit 1 21 | fi 22 | 23 | $EC -t "$@" 24 | -------------------------------------------------------------------------------- /bin/g: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | fgrep -i --color=auto $@ 4 | -------------------------------------------------------------------------------- /bin/lss: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -eou pipefail 4 | 5 | URL=$1 6 | 7 | streamlink -p mpv $1 best 8 | -------------------------------------------------------------------------------- /bin/nocaps: -------------------------------------------------------------------------------- 1 | #!/usr/bin/sh 2 | 3 | setxkbmap -option ctrl:nocaps 4 | -------------------------------------------------------------------------------- /bin/open-browser: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | open $1 $2 $3 4 | -------------------------------------------------------------------------------- /bin/pg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ps aux | grep -F --color=auto -i $1 | grep -F -v $0 | grep -F -v grep | grep -F --color=auto -i $1 4 | -------------------------------------------------------------------------------- /bin/stream: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Stream a video to VLC 4 | 5 | set -eou pipefail 6 | 7 | echo "Streaming..." 8 | youtube-dl "$1" -o - | vlc - 9 | -------------------------------------------------------------------------------- /bin/tangle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # -*- mode: shell-script -*- 3 | # 4 | # Tangle .org files with org-mode 5 | # Example usage: 6 | # ∴ tangle nested-in-all.org 7 | # Files: "nested-in-all.org", Dir: /Users/hinmanm/es-scripts 8 | # Tangled 6 code blocks from nested-in-all.org 9 | 10 | # Set this to the location of your emacs executable 11 | EMACSCMD="emacs" 12 | 13 | # wrap each argument in the code required to call tangle on it 14 | DIR=`pwd` 15 | FILES="" 16 | for file in $@; do 17 | echo "File: $file" 18 | $EMACSCMD -nw --batch --eval " 19 | (progn 20 | (find-file (expand-file-name \"$file\" \"$DIR\")) 21 | (org-babel-tangle) 22 | (kill-buffer))" 2>&1 | grep "Tangled" 23 | done 24 | -------------------------------------------------------------------------------- /bin/up: -------------------------------------------------------------------------------- 1 | uptime | sed 's/.*average.*: \(.*\) \(.*\) \(.*\)/\1 \2 \3/' 2 | -------------------------------------------------------------------------------- /bin/ydl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -eou pipefail 4 | 5 | URL=$1 6 | shift 7 | # youtube-dl --restrict-filenames --force-ipv4 --format best -o '%(uploader)s_%(title)s.%(ext)s' "$URL" $@ 8 | youtube-dl --no-mtime --restrict-filenames --force-ipv4 -o '%(uploader)s_%(title)s.%(ext)s' "$URL" $@ 9 | # youtube-dl --restrict-filenames \ 10 | # --force-ipv4 \ 11 | # --prefer-ffmpeg \ 12 | # --external-downloader aria2c \ 13 | # --external-downloader-args "-x 8 -j 8 -s 8 --summary-interval=10" \ 14 | # -o '%(uploader)s_%(title)s.%(ext)s' \ 15 | # "$URL" \ 16 | # $@ 17 | -------------------------------------------------------------------------------- /eos-clojure.org: -------------------------------------------------------------------------------- 1 | #+TITLE: EOS: Clojure Development Module 2 | #+AUTHOR: Lee Hinman 3 | #+EMAIL: lee@writequit.org 4 | #+SETUPFILE: ~/eos/setupfiles/eos.setup 5 | 6 | #+BEGIN_SRC emacs-lisp 7 | (provide 'eos-clojure) 8 | #+END_SRC 9 | 10 | * Clojure 11 | :PROPERTIES: 12 | :CUSTOM_ID: clojure 13 | :END: 14 | Things for Clojure development, which I do a lot of. 15 | 16 | #+BEGIN_SRC emacs-lisp 17 | (defun eos/clojure-things-hook () 18 | "Set up clojure-y things" 19 | (eldoc-mode 1) 20 | (subword-mode t) 21 | (paredit-mode 1) 22 | (global-set-key (kbd "C-c t") 'clojure-jump-between-tests-and-code)) 23 | 24 | (use-package clojure-mode 25 | :ensure t 26 | :init 27 | (add-hook #'clojure-mode-hook #'eos/clojure-things-hook)) 28 | #+END_SRC 29 | 30 | Let's define a couple of helper functions for setting up the cider: 31 | 32 | #+BEGIN_SRC emacs-lisp 33 | (defun eos/setup-cider () 34 | (interactive) 35 | (setq cider-history-file "~/.nrepl-history" 36 | cider-hide-special-buffers t 37 | cider-repl-history-size 10000 38 | cider-prefer-local-resources t 39 | cider-popup-stacktraces-in-repl t) 40 | (paredit-mode 1) 41 | (eldoc-mode 1)) 42 | #+END_SRC 43 | 44 | And then finally use them if cider and ac-nrepl packages are available: 45 | 46 | #+BEGIN_SRC emacs-lisp 47 | (use-package cider 48 | :ensure t 49 | :defer 30 50 | :init 51 | (add-hook #'cider-mode-hook #'eos/setup-cider) 52 | (add-hook #'cider-repl-mode-hook #'eos/setup-cider) 53 | (add-hook #'cider-mode-hook #'eos/clojure-things-hook) 54 | (add-hook #'cider-repl-mode-hook #'eos/clojure-things-hook)) 55 | #+END_SRC 56 | 57 | For looking up documentation, =helm-clojuredocs= is neat and handy 58 | #+BEGIN_SRC emacs-lisp 59 | (use-package helm-clojuredocs 60 | :disabled t 61 | :ensure t) 62 | #+END_SRC 63 | -------------------------------------------------------------------------------- /eos-completion.org: -------------------------------------------------------------------------------- 1 | #+TITLE: EOS: Completion Module 2 | #+AUTHOR: Lee Hinman 3 | #+EMAIL: lee@writequit.org 4 | #+SETUPFILE: ~/eos/setupfiles/eos.setup 5 | 6 | #+BEGIN_SRC emacs-lisp 7 | (provide 'eos-completion) 8 | #+END_SRC 9 | 10 | * EOS Completion Module 11 | 12 | This contains all the code that I use for things like completion. Right now this 13 | is mostly company-mode as well as other things I've been trying out... 14 | 15 | * Dabbrev 16 | 17 | Dabbrev is built in to Emacs, being something that is great at greedy 18 | completion. 19 | 20 | #+BEGIN_SRC emacs-lisp 21 | ;; Use Dabbrev with Corfu! 22 | (use-package dabbrev 23 | ;; Swap M-/ and C-M-/ 24 | :bind (("M-/" . dabbrev-completion) 25 | ("C-M-/" . dabbrev-expand)) 26 | ;; Other useful Dabbrev configurations. 27 | :custom 28 | (dabbrev-ignored-buffer-regexps '("\\.\\(?:pdf\\|jpe?g\\|png\\)\\'")) 29 | (setq dabbrev-case-fold-search nil)) 30 | #+END_SRC 31 | 32 | * Hippie-expand 33 | 34 | #+BEGIN_SRC emacs-lisp 35 | (use-package hippie-exp 36 | :init 37 | ;; force hippie-expand completions to be case-sensitive 38 | (defadvice hippie-expand (around hippie-expand-case-fold activate) 39 | "Try to do case-sensitive matching (not effective with all functions)." 40 | (let ((case-fold-search nil)) 41 | ad-do-it)) 42 | 43 | :config 44 | (setq hippie-expand-try-functions-list 45 | '(;; Try to expand word "dynamically", searching the current buffer. 46 | try-expand-dabbrev 47 | ;; Try to expand word "dynamically", searching all other buffers. 48 | try-expand-dabbrev-all-buffers 49 | ;; Try to expand word "dynamically", searching the kill ring. 50 | try-expand-dabbrev-from-kill 51 | ;; Try to complete text as a file name, as many characters as unique. 52 | try-complete-file-name-partially 53 | ;; Try to complete text as a file name. 54 | try-complete-file-name 55 | ;; Try to expand word before point according to all abbrev tables. 56 | try-expand-all-abbrevs 57 | ;; Try to complete the current line to an entire line in the buffer. 58 | try-expand-list 59 | ;; Try to complete the current line to an entire line in the buffer. 60 | try-expand-line 61 | ;; Try to complete the current line to an entire line in a different 62 | ;; buffer. 63 | try-expand-line-all-buffers 64 | ;; Try to complete as an Emacs Lisp symbol, as many characters as 65 | ;; unique. 66 | try-complete-lisp-symbol-partially 67 | ;; Try to complete word as an Emacs Lisp symbol. 68 | try-complete-lisp-symbol))) 69 | #+END_SRC 70 | 71 | * Autocomplete with Company 72 | :PROPERTIES: 73 | :CUSTOM_ID: autocomplete 74 | :END: 75 | 76 | I use =company= for a lot of things, so let's just enable it everywhere. 77 | 78 | #+BEGIN_SRC emacs-lisp :tangle yes 79 | (use-package company 80 | :ensure t 81 | :disabled t 82 | :diminish company-mode 83 | ;; stupid flyspell steals the binding I really want, `C-.` 84 | :bind (("C-c ." . company-complete) 85 | ("C-." . company-complete)) 86 | :init 87 | (add-hook 'after-init-hook #'global-company-mode) 88 | (use-package company-quickhelp 89 | :ensure t 90 | :init (add-hook 'company-mode-hook #'company-quickhelp-mode) 91 | :config (setq company-quickhelp-delay 2)) 92 | ;; Set up statistics for company completions 93 | (use-package company-statistics 94 | :ensure t 95 | :init (add-hook 'after-init-hook #'company-statistics-mode)) 96 | :config 97 | (setq company-selection-wrap-around t 98 | ;; do or don't automatically start completion after 99 | company-idle-delay 1.0 100 | ;; at least 3 letters need to be there though 101 | company-minimum-prefix-length 3 102 | ;; show completion numbers for hotkeys 103 | company-show-numbers t 104 | ;; align annotations to the right 105 | company-tooltip-align-annotations t 106 | company-search-regexp-function #'company-search-flex-regexp) 107 | (bind-keys :map company-active-map 108 | ("C-n" . company-select-next) 109 | ("C-p" . company-select-previous) 110 | ("C-d" . company-show-doc-buffer) 111 | ("C-l" . company-show-location) 112 | ("" . company-complete))) 113 | #+END_SRC 114 | 115 | There are also a few things to configure for Company's dabbrev completion: 116 | 117 | #+BEGIN_SRC emacs-lisp 118 | (use-package company-dabbrev 119 | :disabled t 120 | :init 121 | (setq company-dabbrev-ignore-case nil 122 | ;; don't downcase dabbrev suggestions 123 | company-dabbrev-downcase nil 124 | company-dabbrev-downcase nil)) 125 | 126 | (use-package company-dabbrev-code 127 | :disabled t 128 | :init 129 | (setq company-dabbrev-code-modes t 130 | company-dabbrev-code-ignore-case nil)) 131 | #+END_SRC 132 | 133 | * Smart-tab 134 | 135 | Used smart-tab to complete everywhere except for ERC, shell and mu4e. 136 | 137 | #+BEGIN_SRC emacs-lisp 138 | (use-package smart-tab 139 | :ensure t 140 | :defer t 141 | :diminish "" 142 | :init 143 | (global-smart-tab-mode 1) 144 | (setq smart-tab-using-hippie-expand t) 145 | :config 146 | (add-to-list 'smart-tab-disabled-major-modes 'mu4e-compose-mode) 147 | (add-to-list 'smart-tab-disabled-major-modes 'erc-mode) 148 | (add-to-list 'smart-tab-disabled-major-modes 'shell-mode)) 149 | #+END_SRC 150 | -------------------------------------------------------------------------------- /eos-dired.org: -------------------------------------------------------------------------------- 1 | #+TITLE: EOS: Dired Module 2 | #+AUTHOR: Lee Hinman 3 | #+EMAIL: lee@writequit.org 4 | #+SETUPFILE: ~/eos/setupfiles/eos.setup 5 | 6 | #+BEGIN_SRC emacs-lisp 7 | (provide 'eos-dired) 8 | #+END_SRC 9 | 10 | * Directory Editing and Navigation with Dired 11 | :PROPERTIES: 12 | :CUSTOM_ID: dired 13 | :END: 14 | 15 | Dired is sweet, I require =dired-x= also so I can hit =C-x C-j= 16 | and go directly to a dired buffer. 17 | 18 | Setting =ls-lisp-dirs-first= means directories are always at the 19 | top. Always copy and delete recursively. Also enable 20 | =hl-line-mode= in dired, since it's easier to see the cursor then. 21 | 22 | And then some other things to setup when dired runs. =C-x C-q= to edit 23 | writable-dired mode is aawwweeeesssoooommee, it makes renames super easy. 24 | 25 | #+BEGIN_SRC emacs-lisp 26 | (defun eos/dired-mode-hook () 27 | (setq-local truncate-lines t)) 28 | 29 | (use-package dired 30 | :bind ("C-x C-j" . dired-jump) 31 | :config 32 | (use-package dired-x 33 | :init (setq-default dired-omit-files-p t) 34 | :config 35 | (add-to-list 'dired-omit-extensions ".DS_Store")) 36 | (customize-set-variable 'diredp-hide-details-initially-flag nil) 37 | (use-package dired+ 38 | :ensure nil) 39 | (use-package dired-aux 40 | :init 41 | (use-package dired-async 42 | :ensure async)) 43 | (put 'dired-find-alternate-file 'disabled nil) 44 | (setq ls-lisp-dirs-first t 45 | dired-recursive-copies 'always 46 | dired-recursive-deletes 'always 47 | dired-dwim-target t 48 | ;; -F marks links with @ 49 | dired-ls-F-marks-symlinks t 50 | delete-by-moving-to-trash t 51 | ;; Don't auto refresh dired 52 | global-auto-revert-non-file-buffers nil 53 | wdired-allow-to-change-permissions t) 54 | (define-key dired-mode-map (kbd "C-M-u") #'dired-up-directory) 55 | (define-key dired-mode-map (kbd "M-o") #'my/dired-open) 56 | (define-key dired-mode-map (kbd "C-x C-q") #'wdired-change-to-wdired-mode) 57 | (bind-key "l" #'dired-up-directory dired-mode-map) 58 | (bind-key "M-!" #'async-shell-command dired-mode-map) 59 | (add-hook 'dired-mode-hook 'eos/turn-on-hl-line) 60 | (add-hook 'dired-mode-hook #'eos/dired-mode-hook)) 61 | #+END_SRC 62 | 63 | Quick-preview provides a nice preview of the thing at point for files, great 64 | when using dired. 65 | 66 | #+BEGIN_SRC emacs-lisp 67 | (use-package quick-preview 68 | :ensure t 69 | :init 70 | (global-set-key (kbd "C-c q") 'quick-preview-at-point) 71 | (define-key dired-mode-map (kbd "Q") 'quick-preview-at-point)) 72 | #+END_SRC 73 | 74 | Let's also use async everything in dired 75 | 76 | #+BEGIN_SRC emacs-lisp 77 | (use-package async :ensure t) 78 | (autoload 'dired-async-mode "dired-async.el" nil t) 79 | (dired-async-mode 1) 80 | #+END_SRC 81 | 82 | Dired narrowing allows filtering dired results dynamically with a filter. Very 83 | cool. 84 | 85 | #+BEGIN_SRC emacs-lisp 86 | (use-package dired-narrow 87 | :ensure t 88 | :bind (:map dired-mode-map 89 | ("/" . dired-narrow))) 90 | #+END_SRC 91 | 92 | * Icons in Dired buffers (and other buffers) 93 | 94 | #+BEGIN_SRC emacs-lisp 95 | (use-package all-the-icons 96 | :ensure t) 97 | 98 | (use-package all-the-icons-dired 99 | :ensure t 100 | :diminish all-the-icons-dired-mode 101 | :init 102 | (add-hook 'dired-mode-hook 'all-the-icons-dired-mode)) 103 | #+END_SRC 104 | 105 | * Collapsing multiple directories in Dired 106 | 107 | Fuco1 has a nice blog post about this, 108 | https://fuco1.github.io/2017-07-15-Collapse-unique-nested-paths-in-dired-with-dired-collapse-mode.html 109 | 110 | #+BEGIN_SRC emacs-lisp 111 | (use-package dired-collapse 112 | :ensure t 113 | :init 114 | (add-hook 'dired-mode-hook 'dired-collapse-mode)) 115 | #+END_SRC 116 | -------------------------------------------------------------------------------- /eos-distributed.org: -------------------------------------------------------------------------------- 1 | #+TITLE: EOS: Distributed Networking Module 2 | #+AUTHOR: Lee Hinman 3 | #+EMAIL: lee@writequit.org 4 | #+SETUPFILE: ~/eos/setupfiles/eos.setup 5 | 6 | #+BEGIN_SRC emacs-lisp 7 | (provide 'eos-distributed) 8 | #+END_SRC 9 | 10 | This module provides hooks for various distributed services. 11 | 12 | * EOS Matrix communication and synchronization module 13 | :PROPERTIES: 14 | :CUSTOM_ID: h:52bae8b6-47c4-4a8c-b4c3-7096436dd9fa 15 | :END: 16 | 17 | [[http://matrix.org][Matrix]] is a decentralized way to "join" different communication platforms. Kind 18 | of like XMPP, but sane. 19 | 20 | I recently set up a [[https://github.com/matrix-org/synapse][Synapse]] (Matrix's homeserver) server on writequit so that I 21 | could join my own things. Thankfully, [[https://twitter.com/rrrrrrrix][@real_rrix]] wrote an elisp client for 22 | matrix, so I can join from my Emacs instance. 23 | 24 | #+BEGIN_SRC emacs-lisp 25 | (use-package matrix-client 26 | :disabled t 27 | :init 28 | (setq matrix-homeserver-base-url "https://writequit.org" 29 | matrix-client-render-html nil) 30 | (defun eos/matrix-jack-in () 31 | (interactive) 32 | (matrix-client "dakrone"))) 33 | #+END_SRC 34 | 35 | Add Matrix sauron support (for notifications) 36 | 37 | #+BEGIN_SRC emacs-lisp 38 | (use-package matrix-client 39 | :disabled t 40 | :config 41 | (require 'matrix-sauron) 42 | (add-to-list 'sauron-modules 'matrix-sauron) 43 | (when (and sr-running-p (and (boundp 'sauron-matrix-running) 44 | (not sauron-matrix-running))) 45 | (matrix-sauron-start))) 46 | #+END_SRC 47 | 48 | * IPFS - Distributed file-system 49 | :PROPERTIES: 50 | :CUSTOM_ID: h:f14e0e8e-cd20-49b8-bd70-d0be9c5c2a0a 51 | :END: 52 | ** Running the IPFS daemon 53 | :PROPERTIES: 54 | :CUSTOM_ID: h:05f91eba-02fa-47bf-8ca8-8dd129384517 55 | :END: 56 | 57 | I'd like the run the IPFS daemon as my local user, after installing and 58 | initializing it. Notice that this requires installing IPFS, and then already 59 | running =ipfs init= as your user, before running this service 60 | 61 | #+BEGIN_SRC conf :tangle out/ipfs.service 62 | [Unit] 63 | Description=IPFS Daemon 64 | 65 | [Service] 66 | Type=simple 67 | ExecStart=/usr/local/bin/ipfs daemon 68 | ExecStop=/usr/bin/pkill ipfs 69 | Restart=always 70 | 71 | [Install] 72 | WantedBy=default.target 73 | #+END_SRC 74 | 75 | #+BEGIN_SRC sh :tangle sh/install-ipfs-service.sh 76 | cp -fv $PWD/out/ipfs.service ~/.config/systemd/user/ipfs.service 77 | systemctl --user daemon-reload 78 | systemctl --user enable ipfs 79 | systemctl --user start ipfs 80 | #+END_SRC 81 | -------------------------------------------------------------------------------- /eos-es.org: -------------------------------------------------------------------------------- 1 | #+TITLE: EOS: Elasticsearch Module 2 | #+AUTHOR: Lee Hinman 3 | #+EMAIL: lee@writequit.org 4 | #+SETUPFILE: ~/eos/setupfiles/eos.setup 5 | 6 | #+BEGIN_SRC emacs-lisp 7 | (provide 'eos-es) 8 | #+END_SRC 9 | 10 | * Elasticsearch 11 | :PROPERTIES: 12 | :CUSTOM_ID: elasticsearch 13 | :END: 14 | 15 | #+BEGIN_SRC emacs-lisp 16 | (use-package es-mode 17 | :ensure t 18 | :init 19 | (add-to-list 'auto-mode-alist '("\\.es$" . es-mode)) 20 | (add-hook 'es-result-mode-hook 'hs-minor-mode) 21 | (defun eos/turn-off-visual-fill () 22 | (visual-fill-column-mode -1)) 23 | (add-hook 'es-result-mode-hook #'eos/turn-off-visual-fill) 24 | :config 25 | (setq es-warn-on-delete-query nil 26 | es-always-pretty-print t)) 27 | #+END_SRC 28 | 29 | Some setup for the Java-specific ES project, with EDE 30 | 31 | #+BEGIN_SRC emacs-lisp 32 | ;; Enable EDE globally 33 | (global-ede-mode 1) 34 | (when (fboundp 'ede-java-root-project) 35 | (ede-java-root-project "elasticsearch" 36 | :file "/home/hinmanm/es/elasticsearch/build.gradle" 37 | :srcroot '("core/src"))) 38 | #+END_SRC 39 | 40 | * Logstash 41 | :PROPERTIES: 42 | :CUSTOM_ID: logstash 43 | :END: 44 | 45 | There's a nice mode for logstash configurations that seems to work pretty well, 46 | so I install that 47 | 48 | #+BEGIN_SRC emacs-lisp 49 | (use-package logstash-conf 50 | :ensure t) 51 | #+END_SRC 52 | 53 | * ES Services started and Run from Emacs (prodigy) 54 | :PROPERTIES: 55 | :CUSTOM_ID: prodigy 56 | :END: 57 | 58 | I basically use this to start up ES when I need to test something really quickly 59 | 60 | I have been trying out [[https://www.npmjs.com/package/esvm][esvm]] for this lately also, check out my ESVM 61 | configuration elsewhere in my dotfiles 62 | 63 | So I configure prodigy like so: 64 | 65 | #+BEGIN_SRC emacs-lisp 66 | (use-package prodigy 67 | :ensure t 68 | :defer t 69 | :config 70 | (setq prodigy-services '()) 71 | (prodigy-define-service 72 | :name "Elasticsearch 1.7.6" 73 | :cwd "~/ies/elasticsearch-1.7.6" 74 | :command "~/ies/elasticsearch-1.7.6/bin/elasticsearch" 75 | :tags '(work test es) 76 | :port 9200) 77 | (prodigy-define-service 78 | :name "Elasticsearch 2.3.5" 79 | :cwd "~/ies/elasticsearch-2.3.5" 80 | :command "~/ies/elasticsearch-2.3.5/bin/elasticsearch" 81 | :tags '(work test es) 82 | :port 9200) 83 | (prodigy-define-service 84 | :name "Elasticsearch 2.4.6" 85 | :cwd "~/ies/elasticsearch-2.4.6" 86 | :command "~/ies/elasticsearch-2.4.6/bin/elasticsearch" 87 | :tags '(work test es) 88 | :port 9200) 89 | (prodigy-define-service 90 | :name "Elasticsearch 5.0.1" 91 | :cwd "~/ies/elasticsearch-5.0.1" 92 | :command "~/ies/elasticsearch-5.0.1/bin/elasticsearch" 93 | :tags '(work test es) 94 | :port 9200) 95 | (prodigy-define-service 96 | :name "Elasticsearch 5.1.2" 97 | :cwd "~/ies/elasticsearch-5.1.2" 98 | :command "~/ies/elasticsearch-5.1.2/bin/elasticsearch" 99 | :tags '(work test es) 100 | :port 9200) 101 | (prodigy-define-service 102 | :name "Elasticsearch 5.2.2" 103 | :cwd "~/ies/elasticsearch-5.2.2" 104 | :command "~/ies/elasticsearch-5.2.2/bin/elasticsearch" 105 | :tags '(work test es) 106 | :port 9200) 107 | (prodigy-define-service 108 | :name "Elasticsearch 5.3.3" 109 | :cwd "~/ies/elasticsearch-5.3.3" 110 | :command "~/ies/elasticsearch-5.3.3/bin/elasticsearch" 111 | :tags '(work test es) 112 | :port 9200) 113 | (prodigy-define-service 114 | :name "Elasticsearch 5.4.3" 115 | :cwd "~/ies/elasticsearch-5.4.3" 116 | :command "~/ies/elasticsearch-5.4.3/bin/elasticsearch" 117 | :tags '(work test es) 118 | :port 9200) 119 | (prodigy-define-service 120 | :name "Elasticsearch 5.5.3" 121 | :cwd "~/ies/elasticsearch-5.5.3" 122 | :command "~/ies/elasticsearch-5.5.3/bin/elasticsearch" 123 | :tags '(work test es) 124 | :port 9200) 125 | (prodigy-define-service 126 | :name "Elasticsearch 5.6.9" 127 | :cwd "~/ies/elasticsearch-5.6.9" 128 | :command "~/ies/elasticsearch-5.6.9/bin/elasticsearch" 129 | :tags '(work test es) 130 | :port 9200) 131 | (prodigy-define-service 132 | :name "Elasticsearch 6.0.1" 133 | :cwd "~/ies/elasticsearch-6.0.1" 134 | :command "~/ies/elasticsearch-6.0.1/bin/elasticsearch" 135 | :tags '(work test es) 136 | :port 9200) 137 | (prodigy-define-service 138 | :name "Elasticsearch 6.1.4" 139 | :cwd "~/ies/elasticsearch-6.1.4" 140 | :command "~/ies/elasticsearch-6.1.4/bin/elasticsearch" 141 | :tags '(work test es) 142 | :port 9200) 143 | (prodigy-define-service 144 | :name "Elasticsearch 6.2.4" 145 | :cwd "~/ies/elasticsearch-6.2.4" 146 | :command "~/ies/elasticsearch-6.2.4/bin/elasticsearch" 147 | :tags '(work test es) 148 | :port 9200) 149 | (prodigy-define-service 150 | :name "Elasticsearch 6.3.0" 151 | :cwd "~/ies/elasticsearch-6.3.0" 152 | :command "~/ies/elasticsearch-6.3.0/bin/elasticsearch" 153 | :tags '(work test es) 154 | :port 9200) 155 | (prodigy-define-service 156 | :name "Elasticsearch 6.3.0 OSS" 157 | :cwd "~/ies/elasticsearch-6.3.0-oss" 158 | :command "~/ies/elasticsearch-6.3.0-oss/bin/elasticsearch" 159 | :tags '(work test es) 160 | :port 9200) 161 | (prodigy-define-service 162 | :name "ES gradle run" 163 | :cwd "~/es/elasticsearch" 164 | :command "gradlew" 165 | :args '("run") 166 | :tags '(work es) 167 | :port 9200) 168 | (prodigy-define-service 169 | :name "ES x-pack gradle run" 170 | :cwd "~/es/elasticsearch-extra/x-pack-elasticsearch" 171 | :command "gradle" 172 | :args '("run") 173 | :tags '(work es) 174 | :port 9200) 175 | (prodigy-define-service 176 | :name "Simple HTTP server" 177 | :cwd "~/" 178 | :command "python" 179 | :args '("-m" "SimpleHTTPServer" "8000") 180 | :port 8000 181 | :tags '(http))) 182 | #+END_SRC 183 | 184 | * ESVM configuration 185 | :PROPERTIES: 186 | :CUSTOM_ID: esvm 187 | :END: 188 | 189 | I've been using [[https://github.com/simianhacker/esvm][esvm]] for managing starting up multiple ES nodes when I need to 190 | test something using the rest API. Here's my configuration for it that tangles 191 | and installs into =~/.esvmrc= 192 | 193 | Here is the branch with the latest release I use: 194 | 195 | #+NAME: es-branch 196 | #+BEGIN_SRC js :tangle no 197 | 5.x 198 | #+END_SRC 199 | 200 | #+BEGIN_SRC js :tangle out/esvmrc 201 | { 202 | "clusters": { 203 | "<>": { 204 | "branch": "<>", 205 | "nodes": 1 206 | }, 207 | "2node": { 208 | "branch": "<>", 209 | "nodes": 2 210 | }, 211 | "3node": { 212 | "branch": "<>", 213 | "nodes": 3 214 | }, 215 | "master": { 216 | "branch": "master", 217 | "nodes": 1 218 | } 219 | }, 220 | "defaults": { 221 | "config": { 222 | "cluster.name": "es-lee", 223 | "node.add_id_to_custom_path": false, 224 | "path.repo": "/tmp", 225 | "path.shared_data": "/tmp", 226 | "script.indexed": "on", 227 | "script.inline": "on" 228 | }, 229 | "plugins": [] 230 | } 231 | } 232 | #+END_SRC 233 | 234 | And to install it: 235 | 236 | #+BEGIN_SRC sh :tangle sh/install-esvmrc.sh 237 | ln -sfv $PWD/out/esvmrc ~/.esvmrc 238 | #+END_SRC 239 | 240 | And, unfortunately, esvm needs node, so I have been using nvm for that 241 | 242 | #+BEGIN_SRC emacs-lisp 243 | (when (file-exists-p "~/.nvm") 244 | (use-package nvm 245 | :ensure t 246 | :disabled t 247 | :commands (nvm-use nvm-use-for) 248 | :init (nvm-use "v6.4.0"))) 249 | #+END_SRC 250 | -------------------------------------------------------------------------------- /eos-git.org: -------------------------------------------------------------------------------- 1 | #+TITLE: EOS: Git Module 2 | #+AUTHOR: Lee Hinman 3 | #+EMAIL: lee@writequit.org 4 | #+SETUPFILE: ~/eos/setupfiles/eos.setup 5 | 6 | #+BEGIN_SRC emacs-lisp 7 | (provide 'eos-git) 8 | #+END_SRC 9 | 10 | * Git magic with Magit 11 | :PROPERTIES: 12 | :CUSTOM_ID: magit 13 | :END: 14 | I use =C-x g= everywhere to go directly to Magit. 15 | 16 | #+BEGIN_SRC emacs-lisp 17 | (use-package magit 18 | :ensure t 19 | :bind (("C-x g" . magit-status)) 20 | :init (add-hook 'magit-mode-hook 'eos/turn-on-hl-line) 21 | :config 22 | (setq git-commit-summary-max-length 70) 23 | (setenv "GIT_PAGER" "") 24 | (if (file-exists-p "/usr/local/bin/emacsclient") 25 | (setq magit-emacsclient-executable "/usr/local/bin/emacsclient") 26 | (setq magit-emacsclient-executable (executable-find "emacsclient"))) 27 | (defun eos/magit-browse () 28 | "Browse to the project's github URL, if available" 29 | (interactive) 30 | (let ((url (with-temp-buffer 31 | (unless (zerop (call-process-shell-command 32 | "git remote -v" nil t)) 33 | (error "Failed: 'git remote -v'")) 34 | (goto-char (point-min)) 35 | (when (re-search-forward 36 | "github\\.com[:/]\\(.+?\\)\\.git" nil t) 37 | (format "https://github.com/%s" (match-string 1)))))) 38 | (unless url 39 | (error "Can't find repository URL")) 40 | (browse-url url))) 41 | 42 | (define-key magit-mode-map (kbd "C-c C-b") #'eos/magit-browse) 43 | ;; Magit has its own binding, so re-bind them 44 | (bind-key "M-1" #'eos/create-or-switch-to-eshell-1 magit-mode-map) 45 | (bind-key "M-2" #'eos/create-or-switch-to-eshell-2 magit-mode-map) 46 | (bind-key "M-3" #'eos/create-or-switch-to-eshell-3 magit-mode-map) 47 | (bind-key "M-4" #'eos/create-or-switch-to-eshell-4 magit-mode-map) 48 | 49 | ;; Allow gpg signing merge commits 50 | ;; (magit-define-popup-option 'magit-merge-popup 51 | ;; ?S "Sign using gpg" "--gpg-sign=" 52 | ;; #'magit-read-gpg-secret-key)) 53 | ) 54 | #+END_SRC 55 | 56 | * Visualizing git changes in a buffer 57 | Quite useful, as well as the =C-x N= and =C-x P= bindings. 58 | 59 | #+BEGIN_SRC emacs-lisp 60 | (use-package git-gutter 61 | :ensure t 62 | :when window-system 63 | :defer t 64 | :bind (("C-x P" . git-gutter:previous-hunk) 65 | ("C-x N" . git-gutter:next-hunk) 66 | ("C-c G" . git-gutter:popup-hunk)) 67 | :diminish "" 68 | :init 69 | (add-hook 'prog-mode-hook #'git-gutter-mode) 70 | (add-hook 'text-mode-hook #'git-gutter-mode) 71 | :config 72 | (use-package git-gutter-fringe 73 | :ensure t 74 | :init 75 | (require 'git-gutter-fringe) 76 | (when (fboundp 'define-fringe-bitmap) 77 | (define-fringe-bitmap 'git-gutter-fr:added 78 | [224 224 224 224 224 224 224 224 224 224 224 224 224 79 | 224 224 224 224 224 224 224 224 224 224 224 224] 80 | nil nil 'center) 81 | (define-fringe-bitmap 'git-gutter-fr:modified 82 | [224 224 224 224 224 224 224 224 224 224 224 224 224 83 | 224 224 224 224 224 224 224 224 224 224 224 224] 84 | nil nil 'center) 85 | (define-fringe-bitmap 'git-gutter-fr:deleted 86 | [0 0 0 0 0 0 0 0 0 0 0 0 0 128 192 224 240 248] 87 | nil nil 'center)))) 88 | #+END_SRC 89 | 90 | Git-messenger allows you to look up the commit message for the last commit that 91 | touched the line wherever your current cursor is. 92 | 93 | #+BEGIN_SRC emacs-lisp 94 | (use-package git-messenger 95 | :ensure t 96 | :commands git-messenger:popup-message 97 | :bind (("C-c M" . git-messenger:popup-message)) 98 | :config 99 | (setq git-messenger:show-detail t)) 100 | #+END_SRC 101 | 102 | A nice helper to browse code whenever it remotely may be, 103 | =browse-at-remote= 104 | 105 | #+BEGIN_SRC emacs-lisp 106 | (use-package browse-at-remote 107 | :ensure t 108 | :commands browse-at-remote 109 | :bind ("C-c g g" . browse-at-remote)) 110 | #+END_SRC 111 | 112 | Another nice thing is looking at the file through different revisions by checking out the same 113 | thing, but with git-timemachine. 114 | 115 | #+BEGIN_SRC emacs-lisp 116 | (use-package git-timemachine 117 | :ensure t) 118 | #+END_SRC 119 | 120 | * Git-annex integration 121 | 122 | I've been back and forth on git-annex, but when I want to use it, I want to have 123 | it integrated into Emacs/magit when possible. 124 | 125 | #+BEGIN_SRC emacs-lisp 126 | (use-package git-annex 127 | :ensure t) 128 | 129 | (use-package magit-annex 130 | :ensure t) 131 | #+END_SRC 132 | 133 | * Ediff 134 | 135 | Ediff is fantastic for looking through diffs, and it's what magit can invoke on 136 | merge conflicts. 137 | 138 | #+BEGIN_SRC emacs-lisp 139 | (use-package ediff 140 | :init 141 | (setq 142 | ;; Always split nicely for wide screens 143 | ediff-split-window-function 'split-window-horizontally) 144 | (defun ediff-copy-both-to-C () 145 | (interactive) 146 | (ediff-copy-diff 147 | ediff-current-difference nil 'C nil 148 | (concat 149 | (ediff-get-region-contents 150 | ediff-current-difference 'A ediff-control-buffer) 151 | (ediff-get-region-contents 152 | ediff-current-difference 'B ediff-control-buffer)))) 153 | (defun add-d-to-ediff-mode-map () 154 | (define-key ediff-mode-map "d" 'ediff-copy-both-to-C)) 155 | (add-hook 'ediff-keymap-setup-hook 'add-d-to-ediff-mode-map)) 156 | #+END_SRC 157 | 158 | * Smerge 159 | 160 | Emacs has a nice built-in way of handling git conflicts, =smerge-mode=. There's a nice hydra I 161 | borrowed that allows you to run through conflicts pretty easily 162 | 163 | #+BEGIN_SRC emacs-lisp 164 | (defhydra eos/hydra-smerge 165 | (:color red :hint nil 166 | :pre (smerge-mode 1)) 167 | " 168 | ^Move^ ^Keep^ ^Diff^ ^Pair^ 169 | ------------------------------------------------------ 170 | _n_ext _b_ase _R_efine _<_: base-mine 171 | _p_rev _m_ine _E_diff _=_: mine-other 172 | ^ ^ _o_ther _C_ombine _>_: base-other 173 | ^ ^ _a_ll _r_esolve 174 | _q_uit _RET_: current 175 | " 176 | ("RET" smerge-keep-current) 177 | ("C" smerge-combine-with-next) 178 | ("E" smerge-ediff) 179 | ("R" smerge-refine) 180 | ("a" smerge-keep-all) 181 | ("b" smerge-keep-base) 182 | ("m" smerge-keep-mine) 183 | ("n" smerge-next) 184 | ("o" smerge-keep-other) 185 | ("p" smerge-prev) 186 | ("r" smerge-resolve) 187 | ("<" smerge-diff-base-mine) 188 | ("=" smerge-diff-mine-other) 189 | (">" smerge-diff-base-other) 190 | ("q" nil :color blue)) 191 | #+END_SRC 192 | -------------------------------------------------------------------------------- /eos-gtd.org: -------------------------------------------------------------------------------- 1 | #+TITLE: EOS: Getting To Done Module 2 | #+AUTHOR: Lee Hinman 3 | #+EMAIL: leehinman@fastmail.com 4 | #+SETUPFILE: ~/eos/setupfiles/eos.setup 5 | 6 | #+BEGIN_SRC emacs-lisp 7 | (provide 'eos-gtd) 8 | #+END_SRC 9 | 10 | * Task tracking, daily notes, and etc 11 | :PROPERTIES: 12 | :CUSTOM_ID: h:c1d59507-dcdf-48b6-b28b-1d09a409e55f 13 | :END: 14 | 15 | #+BEGIN_SRC emacs-lisp 16 | (defvar eos/gtd-location "~/org/track") 17 | 18 | (setq eos/today-text 19 | "#+TITLE: Daytrack - %Y-%m-%d 20 | ,#+AUTHOR: Lee Hinman 21 | ,#+EMAIL: lee@writequit.org 22 | ,#+LANGUAGE: en 23 | ,#+PROPERTY: header-args:emacs-lisp :tangle yes 24 | ,#+HTML_HEAD: 25 | ,#+EXPORT_EXCLUDE_TAGS: noexport 26 | ,#+OPTIONS: H:4 num:nil toc:t \\n:nil @:t ::t |:t ^:{} -:t f:t *:t 27 | ,#+OPTIONS: skip:nil d:(HIDE) tags:not-in-toc 28 | ,#+STARTUP: fold nodlcheck lognotestate showall 29 | 30 | ,* Things 31 | 32 | ,* Notes") 33 | 34 | (defun eos/maybe-insert-today-text () 35 | (interactive) 36 | ;; TODO: insert nice text for tracking "today" things if it doesn't already 37 | ;; exist 38 | (save-mark-and-excursion 39 | (goto-char (point-min)) 40 | (when (not (search-forward "#+TITLE:" (point-max) t)) 41 | (insert-string (format-time-string eos/today-text)) 42 | (save-buffer)))) 43 | 44 | (defun eos/today () 45 | (interactive) 46 | (let* ((todays-file (format-time-string 47 | (format "%s/%%Y/history-%%m-%%d.org" eos/gtd-location))) 48 | (todays-dir (file-name-directory todays-file)) 49 | (today-filename (file-name-nondirectory todays-file))) 50 | ;; if we already have a buffer, just pop it up 51 | (if-let ((today-buffer (get-buffer today-filename))) 52 | (progn 53 | (set-window-buffer nil today-buffer) 54 | (eos/maybe-insert-today-text)) 55 | (progn 56 | ;; otherwise make the directory and then pop it up 57 | (make-directory todays-dir t) 58 | (find-file todays-file) 59 | (eos/maybe-insert-today-text))))) 60 | #+END_SRC 61 | -------------------------------------------------------------------------------- /eos-ido.org: -------------------------------------------------------------------------------- 1 | #+TITLE: EOS: IDO Module 2 | #+AUTHOR: Lee Hinman 3 | #+EMAIL: lee@writequit.org 4 | #+SETUPFILE: ~/eos/setupfiles/eos.setup 5 | 6 | #+BEGIN_SRC emacs-lisp 7 | (provide 'eos-org) 8 | #+END_SRC 9 | 10 | * IDO-mode configuration 11 | :PROPERTIES: 12 | :CUSTOM_ID: h:a6e9ee11-5915-4a6b-b89f-a8ebcfe16040 13 | :END: 14 | 15 | #+BEGIN_SRC emacs-lisp 16 | (use-package ido 17 | :init 18 | (ido-mode 1) 19 | (use-package ido-ubiquitous 20 | :ensure t 21 | :init (ido-ubiquitous 1)) 22 | (use-package ido-vertical-mode 23 | :ensure t 24 | :init (ido-vertical-mode 1)) 25 | (use-package flx-ido 26 | :ensure t 27 | :init (flx-ido-mode 1)) 28 | (use-package smex 29 | :ensure t 30 | :init 31 | (smex-initialize) 32 | (global-set-key (kbd "M-x") 'smex) 33 | (global-set-key (kbd "M-X") 'smex-major-mode-commands) 34 | (global-set-key (kbd "C-c C-c M-x") 'execute-extended-command))) 35 | #+END_SRC 36 | -------------------------------------------------------------------------------- /eos-irc.org: -------------------------------------------------------------------------------- 1 | #+TITLE: EOS: IRC Module 2 | #+AUTHOR: Lee Hinman 3 | #+EMAIL: lee@writequit.org 4 | #+SETUPFILE: ~/eos/setupfiles/eos.setup 5 | 6 | #+BEGIN_SRC emacs-lisp 7 | (provide 'eos-irc) 8 | #+END_SRC 9 | 10 | * IRC With ZNC and ERC 11 | :PROPERTIES: 12 | :CUSTOM_ID: irc 13 | :END: 14 | IRC in Emacs 15 | 16 | #+BEGIN_SRC emacs-lisp 17 | (defun start-erc () 18 | (interactive) 19 | (load-file "~/.ercpass") 20 | (use-package erc 21 | :init 22 | (setq erc-nick "dakrone" 23 | erc-keywords '("clj-http") 24 | erc-pals '("hiredman" 25 | "technomancy" 26 | "leathekd" 27 | "joegallo" 28 | "danlarkin" 29 | "yazirian" 30 | "pjstadig" 31 | "scgilardi" 32 | "drewr") 33 | erc-hide-list '("JOIN" "PART" "QUIT") 34 | erc-fill-column 100 35 | erc-server-reconnect-timeout 5 36 | erc-server-reconnect-attempts 3 37 | erc-autojoin-channels-alist 38 | '(("irc.genevairc.net" "#prosapologian") 39 | ("writequit.org" "#elasticsearch" "#84115"))) 40 | (defun eos/disable-font-lock () 41 | (font-lock-mode -1)) 42 | ;; ERC is crazy, for some reason it doesn't like font-lock... 43 | (add-hook 'erc-mode-hook #'eos/disable-font-lock)) 44 | (use-package erc-hl-nicks :ensure t) 45 | (use-package ercn 46 | :ensure t 47 | :init 48 | (setq ercn-notify-rules 49 | '((current-nick . all) 50 | (keyword . all) 51 | (pal . ("#elasticsearch")) 52 | (query-buffer . all))) 53 | 54 | (use-package s :ensure t) 55 | (when (fboundp 'alert) 56 | (defun do-notify (nickname message) 57 | (interactive) 58 | ;; Alert not needed, Sauron handles this now 59 | ;; (alert (concat nickname ": " 60 | ;; (s-trim (s-collapse-whitespace message))) 61 | ;; :title (buffer-name)) 62 | (message "[%s] %s: %s" 63 | (buffer-name) nickname (s-trim (s-collapse-whitespace message)))) 64 | (add-hook 'ercn-notify-hook 'do-notify))) 65 | 66 | (defun erc-cmd-UNTRACK (&optional target) 67 | "Add TARGET to the list of target to be tracked." 68 | (if target 69 | (erc-with-server-buffer 70 | (let ((untracked (car (erc-member-ignore-case target erc-track-exclude)))) 71 | (if untracked 72 | (erc-display-line 73 | (erc-make-notice (format "%s is not currently tracked!" target)) 74 | 'active) 75 | (add-to-list 'erc-track-exclude target) 76 | (erc-display-line 77 | (erc-make-notice (format "Now not tracking %s" target)) 78 | 'active)))) 79 | 80 | (if (null erc-track-exclude) 81 | (erc-display-line (erc-make-notice "Untracked targets list is empty") 'active) 82 | 83 | (erc-display-line (erc-make-notice "Untracked targets list:") 'active) 84 | (mapc #'(lambda (item) 85 | (erc-display-line (erc-make-notice item) 'active)) 86 | (erc-with-server-buffer erc-track-exclude)))) 87 | t) 88 | 89 | 90 | (defun erc-cmd-TRACK (target) 91 | "Remove TARGET of the list of targets which they should not be tracked. 92 | If no TARGET argument is specified, list the contents of `erc-track-exclude'." 93 | (when target 94 | (erc-with-server-buffer 95 | (let ((tracked (not (car (erc-member-ignore-case target erc-track-exclude))))) 96 | (if tracked 97 | (erc-display-line 98 | (erc-make-notice (format "%s is currently tracked!" target)) 99 | 'active) 100 | (setq erc-track-exclude (remove target erc-track-exclude)) 101 | (erc-display-line 102 | (erc-make-notice (format "Now tracking %s" target)) 103 | 'active))))) 104 | t) 105 | 106 | (defun eos/add-server-to-chan-name (orig-fun server port target) 107 | (let ((generated-name (funcall orig-fun server port target))) 108 | (concat (cl-subseq server 0 2) "-" generated-name))) 109 | 110 | ;;(advice-add 'erc-generate-new-buffer-name :around #'eos/add-server-to-chan-name) 111 | 112 | (let ((tls-program 113 | '("gnutls-cli --priority secure256 --x509certfile ~/host.pem -p %p %h" 114 | "openssl s_client -connect %h:%p -no_ssl2 -ign_eof -cert ~/host.pem"))) 115 | (erc-tls :server "writequit.org" 116 | :port 31425 117 | :nick "dakrone" 118 | :password freenode-znc-pass) 119 | ;; (erc :server "irc.genevairc.net" 120 | ;; :port 6667 121 | ;; :nick "dakrone") 122 | ;; (erc-tls :server "elastic.irc.slack.com" 123 | ;; :port 6697 124 | ;; :nick "dakrone" 125 | ;; :password (format "%s-novoice" elastic-slack-pass)) 126 | )) 127 | #+END_SRC 128 | 129 | * Slack 130 | 131 | I use Slack for work, not because it's better than IRC (it isn't), but because 132 | we have to :) 133 | 134 | #+BEGIN_SRC emacs-lisp 135 | (use-package slack 136 | :ensure t 137 | :disabled t 138 | :commands (slack-start) 139 | :init 140 | (require 'slack) 141 | (require 'slack-message-formatter) 142 | ;; No Emoji (sorry internet) 143 | (setq slack-buffer-emojify nil) 144 | (setq slack-prefer-current-team t) 145 | ;; The `slack-register-team' goes into ~/.slackpass 146 | (when (file-exists-p "~/.slackpass") 147 | (load-file "~/.slackpass"))) 148 | #+END_SRC 149 | -------------------------------------------------------------------------------- /eos-ivy.org: -------------------------------------------------------------------------------- 1 | #+TITLE: EOS: Helm Module 2 | #+AUTHOR: Lee Hinman 3 | #+EMAIL: lee@writequit.org 4 | #+SETUPFILE: ~/eos/setupfiles/eos.setup 5 | #+OPTIONS: auto-id:t 6 | 7 | #+BEGIN_SRC emacs-lisp 8 | (provide 'eos-ivy) 9 | #+END_SRC 10 | 11 | * Ivy 12 | :PROPERTIES: 13 | :CUSTOM_ID: h:244007e8-ab30-4d1c-8636-c30732083550 14 | :END: 15 | 16 | I'm still experimenting with Ivy, so this might not be as full-featured as my helm setup. 17 | 18 | #+BEGIN_SRC emacs-lisp 19 | (use-package ivy 20 | :ensure t 21 | :demand t 22 | :diminish (ivy-mode . "") 23 | :bind 24 | (("C-M-z" . ivy-resume) 25 | ("C-x C-r" . ivy-switch-buffer) 26 | ("C-x o" . swiper) 27 | :init 28 | (ivy-mode 1) 29 | :config 30 | (bind-key "C-s" 'swiper) 31 | ;; add ‘recentf-mode’ and bookmarks to ‘ivy-switch-buffer’. 32 | (setq ivy-use-virtual-buffers t) 33 | ;; number of result lines to display 34 | ;; (setq ivy-height 10) 35 | ;; does not count candidates 36 | (setq ivy-count-format "%d/%d ") 37 | ;; no regexp by default 38 | ;; (setq ivy-initial-inputs-alist nil) 39 | ;; configure regexp engine. 40 | ;; (setq ivy-re-builders-alist 41 | ;; ;; allow input not in order 42 | ;; '((t . ivy--regex-ignore-order))) 43 | 44 | ;; included out of the box with ivy 45 | (use-package counsel-ag) 46 | (use-package counsel-projectile 47 | :ensure t 48 | :init 49 | (counsel-projectile-on))) 50 | #+END_SRC 51 | -------------------------------------------------------------------------------- /eos-java.org: -------------------------------------------------------------------------------- 1 | #+TITLE: EOS: Java Development Module 2 | #+AUTHOR: Lee Hinman 3 | #+EMAIL: lee@writequit.org 4 | #+SETUPFILE: ~/eos/setupfiles/eos.setup 5 | #+OPTIONS: auto-id:t 6 | 7 | #+BEGIN_SRC emacs-lisp 8 | (provide 'eos-java) 9 | #+END_SRC 10 | 11 | * Java 12 | :PROPERTIES: 13 | :CUSTOM_ID: java 14 | :END: 15 | 16 | To start, decide between using meghanada, eclim, lsp, all, some, or neither 17 | 18 | #+BEGIN_SRC emacs-lisp 19 | (setq eos/use-meghanada nil) 20 | (setq eos/use-eclim nil) 21 | (setq eos/use-lsp nil) 22 | #+END_SRC 23 | 24 | Java uses eclim and/or malabar to make life at least a little bit livable. 25 | 26 | =intellij-java-style= is a copy of our Intellij indentation rules for 27 | Elasticsearch, which are a little weird in some cases, but needed in order to 28 | work with the ES codebase. 29 | 30 | #+BEGIN_SRC emacs-lisp 31 | ;; via http://emacs.stackexchange.com/questions/17327/how-to-have-c-offset-style-correctly-detect-a-java-constructor-and-change-indent 32 | (defun my/point-in-defun-declaration-p () 33 | (let ((bod (save-excursion (c-beginning-of-defun) 34 | (point)))) 35 | (<= bod 36 | (point) 37 | (save-excursion (goto-char bod) 38 | (re-search-forward "{") 39 | (point))))) 40 | 41 | (defun my/is-string-concatenation-p () 42 | "Returns true if the previous line is a string concatenation" 43 | (save-excursion 44 | (let ((start (point))) 45 | (forward-line -1) 46 | (if (re-search-forward " \\\+$" start t) t nil)))) 47 | 48 | (defun my/inside-java-lambda-p () 49 | "Returns true if point is the first statement inside of a lambda" 50 | (save-excursion 51 | (c-beginning-of-statement-1) 52 | (let ((start (point))) 53 | (forward-line -1) 54 | (if (search-forward " -> {" start t) t nil)))) 55 | 56 | (defun my/trailing-paren-p () 57 | "Returns true if point is a training paren and semicolon" 58 | (save-excursion 59 | (end-of-line) 60 | (let ((endpoint (point))) 61 | (beginning-of-line) 62 | (if (re-search-forward "[ ]*);$" endpoint t) t nil)))) 63 | 64 | (defun my/prev-line-call-with-no-args-p () 65 | "Return true if the previous line is a function call with no arguments" 66 | (save-excursion 67 | (let ((start (point))) 68 | (forward-line -1) 69 | (if (re-search-forward ".($" start t) t nil)))) 70 | 71 | (defun my/arglist-cont-nonempty-indentation (arg) 72 | (if (my/inside-java-lambda-p) 73 | '+ 74 | (if (my/is-string-concatenation-p) 75 | 16 ;; TODO don't hard-code 76 | (unless (my/point-in-defun-declaration-p) '++)))) 77 | 78 | (defun my/statement-block-intro (arg) 79 | (if (and (c-at-statement-start-p) (my/inside-java-lambda-p)) 0 '+)) 80 | 81 | (defun my/block-close (arg) 82 | (if (my/inside-java-lambda-p) '- 0)) 83 | 84 | (defun my/arglist-close (arg) (if (my/trailing-paren-p) 0 '--)) 85 | 86 | (defun my/arglist-intro (arg) 87 | (if (my/prev-line-call-with-no-args-p) '++ 0)) 88 | 89 | (defconst intellij-java-style 90 | '((c-basic-offset . 4) 91 | (c-comment-only-line-offset . (0 . 0)) 92 | ;; the following preserves Javadoc starter lines 93 | (c-offsets-alist 94 | . 95 | ((inline-open . 0) 96 | (topmost-intro-cont . +) 97 | (statement-block-intro . my/statement-block-intro) 98 | (block-close . my/block-close) 99 | (knr-argdecl-intro . +) 100 | (substatement-open . +) 101 | (substatement-label . +) 102 | (case-label . +) 103 | (label . +) 104 | (statement-case-open . +) 105 | (statement-cont . +) 106 | (arglist-intro . my/arglist-intro) 107 | (arglist-cont-nonempty . (my/arglist-cont-nonempty-indentation c-lineup-arglist)) 108 | (arglist-close . my/arglist-close) 109 | (inexpr-class . 0) 110 | (access-label . 0) 111 | (inher-intro . ++) 112 | (inher-cont . ++) 113 | (brace-list-intro . +) 114 | (func-decl-cont . ++)))) 115 | "Elasticsearch's Intellij Java Programming Style") 116 | 117 | (c-add-style "intellij" intellij-java-style) 118 | (customize-set-variable 'c-default-style 119 | '((java-mode . "intellij") 120 | (awk-mode . "awk") 121 | (other . "gnu"))) 122 | 123 | ;; Used for eos/setup-java 124 | (use-package shut-up :ensure t) 125 | 126 | (defun eos/setup-java () 127 | (interactive) 128 | (define-key java-mode-map (kbd "M-,") 'pop-tag-mark) 129 | (define-key java-mode-map (kbd "C-c M-i") 'java-imports-add-import-dwim) 130 | (define-key java-mode-map (kbd "C-c C-b") 'bool-flip-do-flip) 131 | (c-set-style "intellij" t) 132 | (subword-mode 1) 133 | (shut-up (toggle-truncate-lines 1)) 134 | ;; Generic java stuff things 135 | (setq-local fci-rule-column 99) 136 | (setq-local fill-column 100) 137 | (when (fboundp 'eos/turn-on-whitespace-mode) 138 | (whitespace-mode -1) 139 | (eos/turn-on-whitespace-mode)) 140 | ;; hide the initial comment in the file (usually a license) if hs-minor-mode 141 | ;; is enabled 142 | (when (boundp' hs-minor-mode) 143 | (hs-hide-initial-comment-block))) 144 | 145 | (add-hook 'java-mode-hook #'eos/setup-java) 146 | 147 | ;; Make emacs' compile recognize broken gradle output 148 | (require 'compile) 149 | (add-to-list 'compilation-error-regexp-alist 150 | '("^:[^/.\n]+\\(/.+\\):\\([[:digit:]]+\\):" 1 2)) 151 | #+END_SRC 152 | 153 | Let's make the Backspace key act more like Intellij's backspace, in that I almost never want to just 154 | go back, I want to remove a whole line 155 | 156 | #+BEGIN_SRC emacs-lisp 157 | (use-package smart-backspace 158 | :ensure t 159 | :bind ("" . smart-backspace)) 160 | #+END_SRC 161 | 162 | * Managing Java Imports with the =java-imports= Package 163 | :PROPERTIES: 164 | :CUSTOM_ID: java-imports 165 | :END: 166 | 167 | I also have a custom package, [[https://github.com/dakrone/emacs-java-imports][java-imports]], which I use to quickly add imports 168 | for things. 169 | 170 | #+BEGIN_SRC emacs-lisp 171 | (use-package java-imports 172 | :ensure t 173 | :config 174 | ;; Elasticsearch's import style 175 | (setq java-imports-find-block-function 'java-imports-find-place-sorted-block) 176 | (add-hook 'java-mode-hook 'java-imports-scan-file)) 177 | #+END_SRC 178 | 179 | * Connecting Emacs and Eclipse with Eclim 180 | :PROPERTIES: 181 | :CUSTOM_ID: eclim 182 | :END: 183 | Eclim is decent for emacs-java integration, but isn't quite there for showing 184 | errors or things like that. Unfortunately I still have to jump back into 185 | Intellij all the time for things. 186 | 187 | Right now I have this disabled, I'm doing Java dev in Emacs 100% of the time, 188 | but I don't need this. Crazy, I know. I've been meaning to write a blog post 189 | about it, I just need to find the time. 190 | 191 | #+BEGIN_SRC emacs-lisp 192 | (use-package eclim 193 | :ensure t 194 | :disabled t 195 | :init 196 | ;; only show errors 197 | (setq-default eclim--problems-filter "e") 198 | (when eos/use-eclim 199 | (add-hook 'java-mode-hook #'eclim-mode) 200 | (use-package company-emacs-eclim 201 | :ensure t 202 | :init (company-emacs-eclim-setup)))) 203 | #+END_SRC 204 | 205 | * Configuring SDKMan for Groovy/Gradle 206 | :PROPERTIES: 207 | :CUSTOM_ID: sdkman 208 | :END: 209 | 210 | This will have to be downloaded from http://sdkman.io, there is no package for it 211 | 212 | Let's also add it to the tramp remote path 213 | 214 | #+BEGIN_SRC emacs-lisp 215 | (eval-after-load "tramp" 216 | '(progn 217 | (add-to-list 'tramp-remote-path "/home/hinmanm/.sdkman/candidates/gradle/current/bin") 218 | (add-to-list 'tramp-remote-path "/home/hinmanm/.sdkman/candidates/groovy/current/bin"))) 219 | #+END_SRC 220 | 221 | * Configure GNU Global and Gtags 222 | :PROPERTIES: 223 | :CUSTOM_ID: gnu-global 224 | :END: 225 | 226 | See: https://github.com/leoliu/ggtags 227 | 228 | If on OSX, you'll need to: 229 | 230 | : brew install ctags 231 | : wget -c http://tamacom.com/global/global-6.3.1.tar.gz 232 | : tar zxvf global-6.3.1.tar.gz 233 | : cd global-6.3.1 234 | : ./configure --prefix=/usr/local --with-exuberant-ctags=/usr/local/bin/ctags 235 | : make install 236 | 237 | I also add this to my shell configuration: 238 | 239 | : export GTAGSCONF=/usr/local/share/gtags/gtags.conf 240 | : export GTAGSLABEL=ctags 241 | 242 | I actually choose to do this because the fedora/debian/ubuntu version of 243 | =global= is so older it doesn't work well. 244 | 245 | #+BEGIN_SRC emacs-lisp 246 | (defun eos/setup-helm-gtags () 247 | (interactive) 248 | ;; this variables must be set before load helm-gtags 249 | ;; you can change to any prefix key of your choice 250 | (setq helm-gtags-prefix-key "\C-cg") 251 | (setq helm-gtags-ignore-case t 252 | helm-gtags-auto-update t 253 | helm-gtags-use-input-at-cursor t 254 | helm-gtags-pulse-at-cursor t 255 | helm-gtags-suggested-key-mapping t) 256 | (use-package helm-gtags 257 | :disabled t 258 | :ensure t 259 | ;; not needed because of smart-jump 260 | :init (helm-gtags-mode t) 261 | :diminish "" 262 | :bind (:map helm-gtags-mode-map 263 | ("M-S" . helm-gtags-select) 264 | ("M-." . helm-gtags-dwim) 265 | ("M-," . helm-gtags-pop-stack) 266 | ("C-c <" . helm-gtags-previous-history) 267 | ("C-c >" . helm-gtags-next-history)))) 268 | 269 | (defun eos/setup-ggtags () 270 | (interactive) 271 | (ggtags-mode 1) 272 | ;; turn on eldoc with ggtags 273 | (setq-local eldoc-documentation-function #'ggtags-eldoc-function) 274 | ;; add ggtags to the hippie completion 275 | (setq-local hippie-expand-try-functions-list 276 | (cons 'ggtags-try-complete-tag 277 | hippie-expand-try-functions-list)) 278 | ;; use helm for completion 279 | (setq ggtags-completing-read-function nil)) 280 | 281 | (use-package ggtags 282 | :ensure t 283 | :defer t 284 | :init 285 | (progn 286 | (add-hook 'c-mode-common-hook 287 | (lambda () 288 | (when (derived-mode-p 'c-mode 'c++-mode 'java-mode 'asm-mode) 289 | (eos/setup-semantic-mode) 290 | ;; helm-gtags 291 | (eos/setup-helm-gtags) 292 | ;; regular gtags 293 | ;;(my/setup-ggtags) 294 | ))))) 295 | #+END_SRC 296 | 297 | * Connecting to a Java debugger 298 | :PROPERTIES: 299 | :CUSTOM_ID: h:7daa814f-0c94-45e4-9864-b5d3c8227251 300 | :END: 301 | 302 | Strangely enough (I didn't think it would actually exist), there does exist a 303 | command-line debugger for Java, called =jdb=. Even better, there's a packaged 304 | called "Realgud" that combines a bunch of different debuggers and the plumbing 305 | to hook them up to Emacs. So I'll install that. 306 | 307 | For [[https://github.com/elastic/elasticsearch][Elasticsearch]] in particular, this means running =gradle run --debug-jvm= 308 | which starts up ES listening for events, and then =M-x realgud:jdb= and using 309 | =jdb -attach 8000= to attach to the JVM. 310 | 311 | #+BEGIN_SRC emacs-lisp 312 | (use-package realgud 313 | :ensure t) 314 | #+END_SRC 315 | 316 | * Java development with meghanada 317 | :PROPERTIES: 318 | :CUSTOM_ID: h:cfc790e0-9777-4cf1-a60d-25b0e9449462 319 | :END: 320 | 321 | [[https://github.com/mopemope/meghanada-emacs][Meghanada-mode]] is a new Java development mode that is supposed to be under 322 | active development, so I'm trying it out. 323 | 324 | #+BEGIN_SRC emacs-lisp 325 | (use-package meghanada 326 | :ensure t 327 | :init 328 | ;; Don't auto-start 329 | (setq meghanada-auto-start nil) 330 | (when eos/use-meghanada 331 | (add-hook 'java-mode-hook #'meghanada-mode) 332 | (add-hook 'java-mode-hook 'flycheck-mode) 333 | (bind-key "C-c M-." 'meghanada-jump-declaration java-mode-map))) 334 | #+END_SRC 335 | 336 | * LSP-mode and Java 337 | :PROPERTIES: 338 | :CUSTOM_ID: h:113092e8-da01-4e16-b80d-f2a6ad12fc51 339 | :END: 340 | 341 | LSP and Java doesn't really work too well right now, but I'm hopeful that in the future it will. 342 | 343 | #+BEGIN_SRC emacs-lisp 344 | (when (file-exists-p "~/.emacs.d/eclipse.jdt.ls") 345 | (use-package lsp-mode 346 | :ensure t 347 | :init (setq lsp-inhibit-message t 348 | lsp-eldoc-render-all nil 349 | lsp-highlight-symbol-at-point nil)) 350 | 351 | (use-package company-lsp 352 | :after company 353 | :ensure t 354 | :config 355 | (add-hook 'java-mode-hook (lambda () (push 'company-lsp company-backends))) 356 | (setq company-lsp-enable-snippet t 357 | company-lsp-cache-candidates t) 358 | (push 'java-mode company-global-modes)) 359 | 360 | (use-package lsp-ui 361 | :ensure t 362 | :config 363 | (setq lsp-ui-sideline-enable t 364 | lsp-ui-sideline-show-symbol t 365 | lsp-ui-sideline-show-hover t 366 | lsp-ui-sideline-show-code-actions t 367 | lsp-ui-sideline-update-mode 'point)) 368 | 369 | (use-package lsp-java 370 | ;; :ensure t 371 | :disabled t 372 | :requires (lsp-ui-flycheck lsp-ui-sideline) 373 | :config 374 | (add-hook 'java-mode-hook 'lsp-java-enable) 375 | (add-hook 'java-mode-hook 'flycheck-mode) 376 | (add-hook 'java-mode-hook 'company-mode) 377 | (add-hook 'java-mode-hook (lambda () (lsp-ui-flycheck-enable t))) 378 | (add-hook 'java-mode-hook 'lsp-ui-sideline-mode) 379 | (setq lsp-java--workspace-folders (list "/home/hinmanm/es/elasticsearch")))) 380 | #+END_SRC 381 | 382 | * Running tests from a test file 383 | :PROPERTIES: 384 | :CUSTOM_ID: h:fbcda62e-7f57-4083-b5aa-6acf86900441 385 | :END: 386 | 387 | A lot of the time I want to run the particular test-at-point, or tests for the class-at-point. This 388 | allows me to do it. 389 | 390 | #+BEGIN_SRC emacs-lisp 391 | (use-package s 392 | :ensure t 393 | :init 394 | (require 's) 395 | (defun eos/run-java-tests-for-method () 396 | (interactive) 397 | (if (projectile-project-p) 398 | (let* ((bName (buffer-name)) 399 | (className (car (s-split "\\." bName))) 400 | (testType (if (s-ends-with? "Tests" className) 401 | ":server:test" 402 | ":server:integTest")) 403 | (methodName "test") // TODO: get real test name 404 | (cmd (format "./gradlew %s -Dtests.class=*%s -Dtests.method=%s" testType className methodName)) 405 | (buff (window-buffer (eos/popup-project-eshell)))) 406 | (with-current-buffer buff 407 | (insert cmd))) 408 | (message "Not currently in a projectile project"))) 409 | 410 | (defun eos/run-java-tests-for-class () 411 | (interactive) 412 | (if (projectile-project-p) 413 | (let* ((bName (buffer-name)) 414 | (className (car (s-split "\\." bName))) 415 | (testType (if (s-ends-with? "Tests" className) 416 | ":server:test" 417 | ":server:integTest")) 418 | (cmd (format "./gradlew %s -Dtests.class=*%s" testType className)) 419 | (buff (window-buffer (eos/popup-project-eshell)))) 420 | (with-current-buffer buff 421 | (insert cmd))) 422 | (message "Not currently in a projectile project"))) 423 | 424 | (defun eos/run-java-test () 425 | (interactive) 426 | (let ((toRun (completing-read "Test: " '("class" "method") nil t))) 427 | (if (s-equals? toRun "method") 428 | (eos/run-java-tests-for-method) 429 | (eos/run-java-tests-for-class))))) 430 | #+END_SRC 431 | 432 | * Automatically disassemble class files 433 | :PROPERTIES: 434 | :CUSTOM_ID: h:4b087a83-74c3-4388-911b-5e0008515e9a 435 | :END: 436 | 437 | On the rare occasion I open a =.class= file, I want to be prompted to disassemble it. 438 | 439 | #+BEGIN_SRC emacs-lisp 440 | (use-package autodisass-java-bytecode 441 | :ensure t) 442 | #+END_SRC 443 | -------------------------------------------------------------------------------- /eos-leisure.org: -------------------------------------------------------------------------------- 1 | #+TITLE: EOS: Fun and Leisure Module 2 | #+AUTHOR: Lee Hinman 3 | #+EMAIL: lee@writequit.org 4 | #+SETUPFILE: ~/eos/setupfiles/eos.setup 5 | 6 | #+BEGIN_SRC emacs-lisp 7 | (provide 'eos-leisure) 8 | #+END_SRC 9 | 10 | * Download buffer 11 | :PROPERTIES: 12 | :CUSTOM_ID: downloads 13 | :END: 14 | 15 | #+BEGIN_SRC emacs-lisp 16 | (defun eos/popup-downloads () 17 | "Pop up the downloads buffer" 18 | (interactive) 19 | (when (not (get-buffer "*eshell downloads*")) 20 | (let ((eshell-buffer-name "*eshell downloads*")) 21 | (eshell))) 22 | (popwin:popup-buffer-tail "*eshell downloads*")) 23 | 24 | ;; eshell 4 is always my "download stuff" buffer 25 | (global-set-key (kbd "C-x M-d") #'eos/popup-downloads) 26 | #+END_SRC 27 | 28 | * Getting the weather 29 | :PROPERTIES: 30 | :CUSTOM_ID: weather 31 | :END: 32 | 33 | Let's manage the forecast and weather too, will be managed from the main Hydra 34 | 35 | #+BEGIN_SRC emacs-lisp 36 | (use-package wttrin 37 | :ensure t 38 | :init 39 | (setq wttrin-default-cities '("Denver"))) 40 | #+END_SRC 41 | 42 | * Browsing stack overflow 43 | :PROPERTIES: 44 | :CUSTOM_ID: stack-overflow 45 | :END: 46 | 47 | Emacs has a really nice stack overflow client, called "sx" 48 | 49 | #+BEGIN_SRC emacs-lisp 50 | (use-package sx 51 | :ensure t) 52 | #+END_SRC 53 | 54 | * Pretty colors in buffers 55 | :PROPERTIES: 56 | :CUSTOM_ID: h:df0e7f66-8fe2-41c7-b604-9a680cda850e 57 | :END: 58 | 59 | Especially when looking at emacs themes, rainbow-mode is nice. 60 | 61 | #+BEGIN_SRC emacs-lisp 62 | (use-package rainbow-mode 63 | :disabled 64 | :ensure t) 65 | #+END_SRC 66 | -------------------------------------------------------------------------------- /eos-music.org: -------------------------------------------------------------------------------- 1 | #+TITLE: EOS: Music Module 2 | #+AUTHOR: Lee Hinman 3 | #+EMAIL: lee@writequit.org 4 | #+SETUPFILE: ~/eos/setupfiles/eos.setup 5 | 6 | #+BEGIN_SRC emacs-lisp 7 | (provide 'eos-music) 8 | #+END_SRC 9 | 10 | I use MPD to stream music, not only because if uses far less CPU, but also 11 | because there is a nice Emacs interface to it. 12 | 13 | Ensure that Emacs knows where MPD is listening 14 | 15 | #+BEGIN_SRC emacs-lisp 16 | (setenv "MPD_HOST" "localhost") 17 | (setenv "MPD_PORT" "6600") 18 | #+END_SRC 19 | 20 | * MPD configuration 21 | :PROPERTIES: 22 | :CUSTOM_ID: mpd 23 | :END: 24 | 25 | Configure MPD to be pointing to our local machine 26 | 27 | #+BEGIN_SRC conf :tangle out/mpd.conf 28 | music_directory "/home/hinmanm/Music" 29 | playlist_directory "/home/hinmanm/.mpd/playlists" 30 | db_file "/home/hinmanm/.mpd/mpd.db" 31 | log_file "/home/hinmanm/.mpd/mpd.log" 32 | state_file "/home/hinmanm/.mpd/mpdstate" 33 | port "6600" 34 | bind_to_address "127.0.0.1" 35 | #+END_SRC 36 | 37 | Configure the address and port in Bash 38 | 39 | #+BEGIN_SRC sh :tangle out/bashrc.d/mpd.sh 40 | export MPD_HOST=localhost 41 | export MPD_PORT=6600 42 | #+END_SRC 43 | 44 | We also need to set up the systemd service for MPD 45 | 46 | #+BEGIN_SRC conf :tangle out/mpd.service 47 | [Unit] 48 | Description=MPD 49 | 50 | [Service] 51 | Type=simple 52 | ExecStart=/usr/bin/mpd --no-daemon /home/hinmanm/.mpd.conf 53 | ExecStop=/usr/bin/pkill mpd 54 | Environment=DISPLAY=:0 55 | Restart=always 56 | 57 | [Install] 58 | WantedBy=default.target 59 | #+END_SRC 60 | 61 | Install the required software 62 | 63 | #+BEGIN_SRC sh :tangle sh/install-mpd.sh 64 | deb-install mpd 65 | deb-install mpc 66 | rpm-install mpd 67 | rpm-install mpc 68 | mkdir -p ~/Music 69 | mkdir -p ~/.mpd/playlists 70 | ln -svf $PWD/out/mpd.conf ~/.mpd.conf 71 | cp -fv $PWD/out/mpd.service ~/.config/systemd/user/mpd.service 72 | systemctl --user daemon-reload 73 | systemctl --user enable mpd 74 | systemctl --user start mpd 75 | #+END_SRC 76 | 77 | * Mingus MPD frontend 78 | :PROPERTIES: 79 | :CUSTOM_ID: mingus 80 | :END: 81 | 82 | I haven't actually used this, but we can install it to try it out... 83 | 84 | #+BEGIN_SRC emacs-lisp 85 | (use-package mingus 86 | :ensure t) 87 | #+END_SRC 88 | 89 | * Hydra Music Controller 90 | :PROPERTIES: 91 | :CUSTOM_ID: music-hydra 92 | :END: 93 | 94 | Mingus is a nifty little minimalist MPD frontend, but it doesn't ship with any 95 | keybindings out of the box. I'd like global MPD bindings, and this goes a long 96 | way to get there. 97 | 98 | #+begin_src emacs-lisp 99 | (defhydra eos/hydra-mpd nil 100 | "MPD Actions" 101 | ("p" (progn (save-window-excursion 102 | (async-shell-command "mpc toggle" (get-buffer-create "*tmp*")))) 103 | "Play/Pause") 104 | ("/" mingus-search "Search" :exit t) 105 | ("c" (message "Currently Playing: %s" 106 | (shell-command-to-string "mpc status")) "Currently Playing") 107 | ("s" mingus "Show Mingus" :exit t) 108 | ("m" mingus "Mingus" :exit t) 109 | ("<" (progn (require 'mpc) (mpc-prev) 110 | (message "Currently Playing: %s" 111 | (shell-command-to-string "mpc status"))) "Previous") 112 | (">" (progn (require 'mpc) (mpc-next) 113 | (message "Currently Playing: %s" 114 | (shell-command-to-string "mpc status"))) "Next") 115 | ("+" (dotimes (i 5) (mingus-vol-up)) "Louder") 116 | ("-" (dotimes (i 5) (mingus-vol-down)) "Quieter") 117 | ("n" (ansi-term (executable-find "ncmpcpp")) 118 | "ncmpcpp" :exit t) 119 | ("q" nil "Quit")) 120 | #+end_src 121 | 122 | This actually gets bound in [[file:eos-core.org::*Binding%20the%20EOS%20mega-map%20with%20Hydra][eos-core.org]] 123 | -------------------------------------------------------------------------------- /eos-navigation.org: -------------------------------------------------------------------------------- 1 | #+TITLE: EOS: Navigation 2 | #+AUTHOR: Lee Hinman 3 | #+EMAIL: lee@writequit.org 4 | #+SETUPFILE: ~/eos/setupfiles/eos.setup 5 | 6 | #+BEGIN_SRC emacs-lisp 7 | (provide 'eos-navigation) 8 | #+END_SRC 9 | 10 | * General Emacs Navigation 11 | :PROPERTIES: 12 | :CUSTOM_ID: general-nav 13 | :END: 14 | 15 | These are miscellaneous bindings used all over the place that don't 16 | really fit in anywhere else. 17 | 18 | First, some window management and navigation helpers 19 | 20 | #+BEGIN_SRC emacs-lisp 21 | (global-set-key (kbd "C-x +") 'balance-windows-area) 22 | 23 | (global-set-key (kbd "C-c y") #'bury-buffer) 24 | (global-set-key (kbd "C-c C-y") #'bury-buffer) 25 | (global-set-key (kbd "C-c r") #'revert-buffer) 26 | 27 | ;; ==== Window switching ==== 28 | (defun eos/other-window-backwards () 29 | (interactive) 30 | (other-window -1)) 31 | 32 | (global-set-key (kbd "M-'") #'other-window) 33 | (global-set-key (kbd "M-\"") #'eos/other-window-backwards) 34 | (global-set-key (kbd "H-'") #'other-window) 35 | (global-set-key (kbd "H-\"") #'eos/other-window-backwards) 36 | (global-set-key (kbd "") #'other-window) 37 | (global-set-key (kbd "C-x C-o") #'other-window) 38 | #+END_SRC 39 | 40 | If you split buffers and have A on the left and B on the right, this will put B 41 | on the left and A on the right. I actually use this more than I thought I 42 | would... 43 | 44 | #+BEGIN_SRC emacs-lisp 45 | (defun transpose-buffers (arg) 46 | "Transpose the buffers shown in two windows." 47 | (interactive "p") 48 | (let ((selector (if (>= arg 0) 'next-window 'previous-window))) 49 | (while (/= arg 0) 50 | (let ((this-win (window-buffer)) 51 | (next-win (window-buffer (funcall selector)))) 52 | (set-window-buffer (selected-window) next-win) 53 | (set-window-buffer (funcall selector) this-win) 54 | (select-window (funcall selector))) 55 | (setq arg (if (plusp arg) (1- arg) (1+ arg)))))) 56 | 57 | (global-set-key (kbd "C-x 4 t") 'transpose-buffers) 58 | #+END_SRC 59 | 60 | Next, some of the random bindings that I use that don't really fit elsewhere. 61 | 62 | #+BEGIN_SRC emacs-lisp 63 | (global-set-key (kbd "C-x C-l") 'toggle-truncate-lines) 64 | 65 | ;; join line to next line 66 | (global-set-key (kbd "M-j") 67 | (lambda () 68 | (interactive) 69 | (join-line -1))) 70 | 71 | ;; Completion that uses many different methods to find options. 72 | (global-set-key (kbd "M-S-SPC") 'hippie-expand) 73 | 74 | ;; Font size 75 | (define-key global-map (kbd "C-+") 'text-scale-increase) 76 | (define-key global-map (kbd "C--") 'text-scale-decrease) 77 | 78 | ;; Start or switch to eshell 79 | (global-set-key (kbd "C-x C-m") 'eshell) 80 | 81 | ;; If you want to be able to M-x without meta (phones, etc) 82 | (global-set-key (kbd "C-c C-x") 'execute-extended-command) 83 | #+END_SRC 84 | 85 | Some random highlighting helpers 86 | 87 | #+BEGIN_SRC emacs-lisp 88 | (use-package hl-anything 89 | :ensure t 90 | :diminish hl-highlight-mode 91 | :commands hl-highlight-mode 92 | :init 93 | (global-set-key (kbd " ") 'hl-highlight-thingatpt-local) 94 | (global-set-key (kbd " u") 'hl-unhighlight-all-local) 95 | (global-set-key (kbd " U") 'hl-unhighlight-all-global) 96 | (global-set-key (kbd " n") 'hl-find-next-thing) 97 | (global-set-key (kbd " p") 'hl-find-prev-thing)) 98 | #+END_SRC 99 | 100 | ** Isearch bindings 101 | :PROPERTIES: 102 | :CUSTOM_ID: isearch 103 | :END: 104 | 105 | #+BEGIN_SRC emacs-lisp 106 | ;; Use regex searches by default. 107 | ;;(global-set-key (kbd "C-s") 'isearch-forward-regexp) 108 | ;;(global-set-key (kbd "C-r") 'isearch-backward-regexp) 109 | ;; Case-fold regex by default 110 | (setq search-default-mode 'character-fold-to-regexp) 111 | ;; Non regex search gets the meta also 112 | (global-set-key (kbd "C-M-s") 'isearch-forward) 113 | (global-set-key (kbd "C-M-r") 'isearch-backward) 114 | 115 | ;; Activate occur easily inside isearch 116 | (define-key isearch-mode-map (kbd "C-o") 117 | (lambda () (interactive) 118 | (let ((case-fold-search isearch-case-fold-search)) 119 | (occur (if isearch-regexp isearch-string (regexp-quote isearch-string)))))) 120 | 121 | (defun eos/add-watchword (string) 122 | "Highlight whatever `string' is in the current buffer 123 | permanently." 124 | (font-lock-add-keywords 125 | nil `((,(if isearch-regexp isearch-string (regexp-quote isearch-string)) 126 | 1 '((:background "yellow") (:weight bold)) t)))) 127 | 128 | (define-key isearch-mode-map (kbd "M-h") 129 | (lambda () (interactive) 130 | (eos/add-watchword isearch-string))) 131 | #+END_SRC 132 | 133 | * Mouse-based navigation 134 | :PROPERTIES: 135 | :CUSTOM_ID: mouse 136 | :END: 137 | 138 | Need to enable this to get trackpad scrolling to work on my Lenovo T450s 139 | 140 | #+BEGIN_SRC emacs-lisp 141 | ;; mouse integration 142 | (require 'mouse) 143 | (xterm-mouse-mode t) 144 | (global-set-key [mouse-4] '(lambda () 145 | (interactive) 146 | (scroll-down 1))) 147 | (global-set-key [mouse-5] '(lambda () 148 | (interactive) 149 | (scroll-up 1))) 150 | (setq mouse-sel-mode t) 151 | (defun track-mouse (e)) 152 | #+END_SRC 153 | 154 | * God-mode 155 | :PROPERTIES: 156 | :CUSTOM_ID: god-mode 157 | :END: 158 | God-mode was always something a little strange to me, halfway to =evil-mode=, 159 | but not quite Emacs. 160 | 161 | Lately though, I've begun using it because it allows me to do things I spend a 162 | lot of time doing (navigating) without hitting control. This is especially 163 | helpful because while I don't suffer from the so-called "Emacs-pinky", I am 164 | instead suffering from "Emacs-thumb". 165 | 166 | #+BEGIN_SRC emacs-lisp 167 | (use-package god-mode 168 | :ensure t 169 | :disabled t 170 | :bind ("" . god-mode-all) 171 | :config 172 | (global-set-key (kbd "") 'god-mode-all) 173 | (define-key god-local-mode-map (kbd ".") 'repeat) 174 | (define-key god-local-mode-map (kbd "i") 'god-local-mode) 175 | (defun god-update-cursor () 176 | "Update my cursor." 177 | (setq cursor-type 178 | (if god-local-mode 179 | 'box 180 | 'bar))) 181 | ;;(add-hook 'god-mode-enabled-hook 'god-update-cursor) 182 | ;;(add-hook 'god-mode-disabled-hook 'god-update-cursor) 183 | (add-to-list 'god-exempt-major-modes 'sauron-mode) 184 | (add-to-list 'god-exempt-major-modes 'eshell-mode) 185 | (add-to-list 'god-exempt-major-modes 'org-agenda-mode) 186 | (add-to-list 'god-exempt-major-modes 'mingus-playlist-mode) 187 | (add-to-list 'god-exempt-major-modes 'mingus-browse-mode) 188 | (add-to-list 'god-exempt-major-modes 'twittering-mode) 189 | (add-to-list 'god-exempt-major-modes 'Man-mode) 190 | (add-to-list 'god-exempt-major-modes 'proced-mode) 191 | (add-to-list 'god-exempt-major-modes 'gnus-summary-mode) 192 | (add-to-list 'god-exempt-major-modes 'gnus-article-mode) 193 | (add-to-list 'god-exempt-major-modes 'gnus-group-mode) 194 | (add-to-list 'god-exempt-major-modes 'elfeed-search-mode) 195 | (add-to-list 'god-exempt-major-modes 'haskell-interactive-mode) 196 | (add-to-list 'god-exempt-major-modes 'epresent-mode) 197 | (add-to-list 'god-exempt-major-modes 'compilation-mode) 198 | (add-to-list 'god-exempt-major-modes 'Custom-mode) 199 | ;; Finally, a fix for key-translation-map by redefining the 200 | ;; `key-string-after-consuming-key' method, courtesy of 201 | ;; https://github.com/chrisdone/god-mode/issues/75 202 | (defun key-string-after-consuming-key (key key-string-so-far) 203 | "Interpret god-mode special keys for key (consumes more keys 204 | if appropriate). Append to keysequence." 205 | (let ((key-consumed t) next-modifier next-key) 206 | (message key-string-so-far) 207 | (setq next-modifier 208 | (cond 209 | ((string= key god-literal-key) 210 | (setq god-literal-sequence t) 211 | "") 212 | (god-literal-sequence 213 | (setq key-consumed nil) 214 | "") 215 | ((and 216 | (stringp key) 217 | (not (eq nil (assoc key god-mod-alist))) 218 | (not (eq nil key))) 219 | (cdr (assoc key god-mod-alist))) 220 | (t 221 | (setq key-consumed nil) 222 | (cdr (assoc nil god-mod-alist)) 223 | ))) 224 | (setq next-key 225 | (if key-consumed 226 | (god-mode-sanitized-key-string (read-event key-string-so-far)) 227 | key)) 228 | (let* ((literal-key-string (concat next-modifier next-key)) 229 | (translation (lookup-key key-translation-map (kbd literal-key-string))) 230 | (next-interpreted-key-string (or translation literal-key-string))) 231 | (if key-string-so-far 232 | (concat key-string-so-far " " next-interpreted-key-string) 233 | next-interpreted-key-string))))) 234 | #+END_SRC 235 | 236 | * Dumb-jump 237 | :PROPERTIES: 238 | :CUSTOM_ID: h:45e9b2dd-2e84-4acd-b27e-6e31e9ee628f 239 | :END: 240 | 241 | Jumping to things, in a dumb way, with ag. It's usually bound to =C-M-g= (for 242 | "goto" I guess), =C-M-p= to jump back, and =C-M-q= to "show" things. 243 | 244 | #+BEGIN_SRC emacs-lisp 245 | (use-package dumb-jump 246 | :ensure t 247 | :bind (("M-g o" . dumb-jump-go-other-window) 248 | ("M-g j" . dumb-jump-go) 249 | ("M-g i" . dumb-jump-go-prompt) 250 | ("M-g x" . dumb-jump-go-prefer-external) 251 | ("M-g z" . dumb-jump-go-prefer-external-other-window)) 252 | :init (dumb-jump-mode) 253 | :config 254 | (setq dumb-jump-selector 'helm)) 255 | #+END_SRC 256 | 257 | * Smart-jump 258 | 259 | I can hear what you're thinking "Wait. Right after dumb-jump you're configuring something called 260 | 'smart-jump'? Why would you even have both?". 261 | 262 | Smart-jump lets you wrap a bunch of different jumping methods in a single command. 263 | 264 | #+BEGIN_SRC emacs-lisp 265 | (use-package smart-jump 266 | :disabled t 267 | :ensure t 268 | :init 269 | (require 'smart-jump) 270 | ;; Java 271 | ;; First try meghanada-mode if enabled 272 | (smart-jump-register :modes 'java-mode 273 | :jump-fn 'meghanada-jump-declaration 274 | :pop-fn 'meghanada-back-jump 275 | :refs-fn 'meghanada-reference 276 | :should-jump t 277 | :heuristic 'point 278 | :async 700 279 | :order 1) 280 | ;; Second, try helm-gtags 281 | (smart-jump-register :modes 'java-mode 282 | :jump-fn 'helm-gtags-dwim 283 | :pop-fn 'helm-gtags-pop-stack 284 | :should-jump t 285 | :heuristic 'point 286 | :async 700 287 | :order 2) 288 | ;; Third fall back to regular ggtags 289 | (smart-jump-register :modes 'java-mode 290 | :jump-fn 'ggtags-find-tag-dwim 291 | :pop-fn 'ggtags-prev-mark 292 | :refs-fn 'ggtags-find-reference 293 | :should-jump t 294 | :heuristic 'point 295 | :async 700 296 | :order 3) 297 | 298 | ;; Elisp 299 | (smart-jump-register :modes '(emacs-lisp-mode lisp-interaction-mode) 300 | :jump-fn 'elisp-slime-nav-find-elisp-thing-at-point 301 | :pop-fn 'pop-tag-mark 302 | :should-jump t 303 | :heuristic 'error 304 | :async nil) 305 | ;; C/C++ 306 | (smart-jump-register :modes '(c-mode c++-mode) 307 | :jump-fn 'ggtags-find-tag-dwim 308 | :pop-fn 'ggtags-prev-mark 309 | :refs-fn 'ggtags-find-reference 310 | :should-jump t 311 | :heuristic 'point 312 | :async 500) 313 | ;; Clojure 314 | (smart-jump-register :modes '(clojure-mode cider-mode cider-repl-mode) 315 | :jump-fn 'cider-find-var 316 | :pop-fn 'cider-pop-back 317 | :refs-fn 'cljr-find-usages 318 | :should-jump 'cider-connected-p 319 | :heuristic 'point 320 | :async 500) 321 | ;; Javascript 322 | (smart-jump-register :modes '(js2-mode)) 323 | ;; Python 324 | (smart-jump-register :modes '(python-mode)) 325 | ;; Ruby 326 | (smart-jump-register :modes '(ruby-mode)) 327 | ;; Haskell 328 | (smart-jump-register :modes '(haskell-mode) 329 | :jump-fn 'intero-goto-definition 330 | :pop-fn 'xref-pop-marker-stack 331 | :refs-fn 'intero-uses-at 332 | :should-jump t 333 | :heuristic 'point 334 | :async nil)) 335 | #+END_SRC 336 | 337 | * Move-text 338 | 339 | This is a nice package used to move text around 340 | 341 | #+BEGIN_SRC emacs-lisp 342 | (use-package move-text 343 | :ensure t 344 | :init (move-text-default-bindings)) 345 | #+END_SRC 346 | 347 | * Navigating without control 348 | 349 | I don't use EVIL mode, as I think that on a Dvorak keyboard, VI-like keys aren't really that 350 | helpful. 351 | 352 | What I do want though, is something that is I can toggle to make a buffer "view-like", and navigate 353 | it how I want 354 | 355 | #+BEGIN_SRC emacs-lisp 356 | (use-package hydra :ensure t) 357 | (require 'view) 358 | 359 | (defhydra eos/nav-mode (:foreign-keys run) 360 | "[NAV-MODE] q or i to exit" 361 | ("C-h" hl-line-mode) 362 | ("t" toggle-truncate-lines) 363 | ("a" beginning-of-line) 364 | ("l" forward-char) 365 | ("" forward-char) 366 | ("h" backward-char) 367 | ("" backward-char) 368 | ("n" next-line) 369 | ("j" next-line) 370 | ("" next-line) 371 | ("p" previous-line) 372 | ("k" previous-line) 373 | ("" previous-line) 374 | ("e" View-scroll-half-page-forward) 375 | ("u" View-scroll-half-page-backward) 376 | ("SPC" scroll-up-command) 377 | ("S-SPC" scroll-down-command) 378 | ("<" beginning-of-buffer) 379 | (">" end-of-buffer) 380 | ("." end-of-buffer) 381 | ("C-'" nil) 382 | ("C-\"" nil) 383 | ("d" (when (y-or-n-p "Kill buffer?") 384 | (kill-currenty-buffer)) 385 | :exit t) 386 | ("/" isearch-forward-regexp :exit t) 387 | ("?" isearch-backward-regexp :exit t) 388 | ("i" nil :exit t) 389 | ("q" nil :exit t)) 390 | 391 | (global-set-key (kbd "M-V") 'eos/nav-mode/body) 392 | #+END_SRC 393 | 394 | * Search engines 395 | 396 | Frequently I want to search for a particular thing from Emacs (most of the time it's a class name, 397 | or a failure message, or something of that sort). Engine-mode does that. 398 | 399 | #+BEGIN_SRC emacs-lisp 400 | (use-package engine-mode 401 | :ensure t 402 | :defer 10 403 | :init (engine-mode 1) 404 | :config 405 | ;; Use an external browser for these 406 | (setq engine/browser-function 'browse-url-generic) 407 | 408 | (defengine duckduckgo 409 | "https://duckduckgo.com/?q=%s" 410 | :keybinding "d") 411 | 412 | (defengine elasticsearch 413 | "https://github.com/elastic/elasticsearch/search?q=%s&type=" 414 | :keybinding "e") 415 | 416 | (defengine x-pack 417 | "https://github.com/elastic/x-pack-elasticsearch/search?q=%s&type=" 418 | :keybinding "x") 419 | 420 | (defengine google-maps 421 | "http://maps.google.com/maps?q=%s" 422 | :keybinding "m") 423 | 424 | (defengine stack-overflow 425 | "https://stackoverflow.com/search?q=%s" 426 | :keybinding "s") 427 | 428 | (defengine wikipedia 429 | "http://www.wikipedia.org/search-redirect.php?language=en&go=Go&search=%s" 430 | :keybinding "w")) 431 | #+END_SRC 432 | -------------------------------------------------------------------------------- /eos-notify.org: -------------------------------------------------------------------------------- 1 | #+TITLE: EOS: Notification Module 2 | #+AUTHOR: Lee Hinman 3 | #+EMAIL: lee@writequit.org 4 | #+SETUPFILE: ~/eos/setupfiles/eos.setup 5 | #+OPTIONS: auto-id:t 6 | 7 | #+BEGIN_SRC emacs-lisp 8 | (provide 'eos-notify) 9 | #+END_SRC 10 | 11 | * A Word about Notifications and Alerting 12 | :PROPERTIES: 13 | :CUSTOM_ID: notifications 14 | :END: 15 | 16 | Yep. I need to actually make this work for OSX, for Linux it's no problem 17 | though. 18 | 19 | #+BEGIN_SRC emacs-lisp 20 | (use-package alert 21 | :ensure t 22 | :config 23 | (when (eq system-type 'darwin) 24 | (setq alert-default-style 'notifier)) 25 | (when (eq system-type 'gnu/linux) 26 | (setq alert-default-style 'notifications))) 27 | #+END_SRC 28 | 29 | To use this, I just need to do =(alert "this is a message")=. 30 | 31 | The all-seeing eye of Sauron 32 | 33 | #+BEGIN_SRC emacs-lisp 34 | (use-package sauron 35 | :ensure t 36 | :init 37 | (setq sauron-modules 38 | '(sauron-compilation 39 | sauron-dbus 40 | ;; sauron-elfeed 41 | sauron-erc 42 | ;; sauron-mu4e 43 | sauron-notifications 44 | sauron-org 45 | sauron-twittering 46 | ;; sauron-zeroconf 47 | )) 48 | 49 | (when (not (boundp 'dbus-compiled-version)) 50 | ;; Remove dbus if it is not compiled 51 | (require 'sauron) 52 | (setq sauron-modules (remove 'sauron-dbus sauron-modules))) 53 | 54 | (setq sauron-max-line-length 120 55 | sauron-watch-patterns '("dakrone" "thnetos" "okenezak") 56 | sauron-watch-nicks '("dakrone" "thnetos") 57 | sauron-nick-insensitivity 20 58 | sauron-min-priority 2 59 | sauron-prio-twittering-new-tweets 2 60 | sauron-prio-erc-default 1 61 | sauron-prio-erc-privmsg-root 1 62 | sauron-prio-erc-privmsg-default 1 63 | sauron-zeroconf-priority 2 64 | sauron-prio-org-minutes-left-list '((10 3) (2 4)) 65 | sauron-frame-geometry "120x36+0+0") 66 | 67 | ;; filter out IRC spam 68 | (defun tsp/hide-irc-user-spam (origin priority msg &optional properties) 69 | (or (string-match "^*** Users" msg) 70 | (and (string-match "^.* has quit" msg) (string-match "erc" origin)) 71 | (and (string-match "^.* has joined #" msg) (string-match "erc" origin)))) 72 | (defun tsp/hide-tweet-counts (origin priority msg &optional properties) 73 | (or (string-match "^[0-9]+ new tweets" msg))) 74 | (add-hook 'sauron-event-block-functions #'tsp/hide-irc-user-spam) 75 | (add-hook 'sauron-event-block-functions #'tsp/hide-tweet-counts) 76 | 77 | (sauron-start-hidden) 78 | 79 | ;; Need to stop tracking notifications, because sauron will be sending 80 | ;; notifications! 81 | (sauron-notifications-stop) 82 | 83 | (add-hook 'sauron-event-added-functions 'sauron-alert-el-adapter) 84 | 85 | :commands (sauron-toggle-hide-show) 86 | :bind ("M-o" . sauron-toggle-hide-show)) 87 | #+END_SRC 88 | 89 | * Notifications for running commands in Eshell 90 | :PROPERTIES: 91 | :CUSTOM_ID: h:f06f9521-d13c-474d-aebc-1d27b13b52ab 92 | :END: 93 | 94 | This is used to mimic zsh's =REPORTTIME= feature, but with sauron alerting! 95 | 96 | #+BEGIN_SRC emacs-lisp 97 | (use-package eshell 98 | :config 99 | ;; Seconds a command must take before showing an alert 100 | (setq eos/eshell-time-before-alert 5.0) 101 | 102 | (defun eos/eshell-precommand () 103 | (interactive) 104 | (setq-local eos/eshell-command-start-time (current-time))) 105 | 106 | (defun eos/eshell-command-finished () 107 | (interactive) 108 | (when (and (boundp 'eos/eshell-command-start-time) 109 | (> (float-time (time-subtract (current-time) 110 | eos/eshell-command-start-time)) 111 | eos/eshell-time-before-alert)) 112 | (sauron-add-event major-mode 2 113 | (format "EShell: command [%s] finished, status: %s" 114 | eshell-last-command-name 115 | eshell-last-command-status) 116 | (lambda () (switch-to-buffer-other-window (buffer-name))) 117 | nil))) 118 | (add-hook 'eshell-pre-command-hook #'eos/eshell-precommand) 119 | (add-hook 'eshell-post-command-hook #'eos/eshell-command-finished)) 120 | #+END_SRC 121 | -------------------------------------------------------------------------------- /eos-remote.org: -------------------------------------------------------------------------------- 1 | #+TITLE: EOS: Remote Servers Module 2 | #+AUTHOR: Lee Hinman 3 | #+EMAIL: lee@writequit.org 4 | #+SETUPFILE: ~/eos/setupfiles/eos.setup 5 | 6 | #+BEGIN_SRC emacs-lisp 7 | (provide 'eos-remote) 8 | #+END_SRC 9 | 10 | * TRAMP 11 | :PROPERTIES: 12 | :CUSTOM_ID: tramp 13 | :END: 14 | I have really been getting into TRAMP lately, I use it with eshell all the time, 15 | and dired tramp buffers are great for file management. 16 | 17 | #+BEGIN_SRC emacs-lisp 18 | (use-package tramp 19 | :defer 5 20 | :config 21 | ;; Turn off auto-save for tramp files 22 | (defun tramp-set-auto-save () 23 | (auto-save-mode -1)) 24 | (with-eval-after-load 'tramp-cache 25 | (setq tramp-persistency-file-name "~/.emacs.d/tramp")) 26 | (setq tramp-default-method "ssh" 27 | tramp-default-user-alist '(("\\`su\\(do\\)?\\'" nil "root")) 28 | tramp-adb-program "adb" 29 | ;; use the settings in ~/.ssh/config instead of Tramp's 30 | tramp-use-ssh-controlmaster-options nil 31 | backup-enable-predicate 32 | (lambda (name) 33 | (and (normal-backup-enable-predicate name) 34 | (not (let ((method (file-remote-p name 'method))) 35 | (when (stringp method) 36 | (member method '("su" "sudo")))))))) 37 | 38 | (use-package tramp-sh 39 | :config 40 | (add-to-list 'tramp-remote-path "/usr/local/sbin") 41 | (add-to-list 'tramp-remote-path "/opt/java/current/bin") 42 | (add-to-list 'tramp-remote-path "/opt/gradle/current/bin") 43 | (add-to-list 'tramp-remote-path "~/bin"))) 44 | #+END_SRC 45 | 46 | * Passwords for remote services 47 | :PROPERTIES: 48 | :CUSTOM_ID: h:5beffcde-27b8-40c8-89dc-bbf29e0bde88 49 | :END: 50 | 51 | I've been trying out [[https://www.passwordstore.org/][pass]] for passwords lately, which has an Emacs mode, so 52 | let's install it and get it running 53 | 54 | #+BEGIN_SRC emacs-lisp 55 | (use-package pass 56 | :ensure t) 57 | #+END_SRC 58 | -------------------------------------------------------------------------------- /eos-rss.org: -------------------------------------------------------------------------------- 1 | #+TITLE: EOS: RSS Module 2 | #+AUTHOR: Lee Hinman 3 | #+EMAIL: lee@writequit.org 4 | #+SETUPFILE: ~/eos/setupfiles/eos.setup 5 | 6 | #+BEGIN_SRC emacs-lisp 7 | (provide 'eos-rss) 8 | #+END_SRC 9 | 10 | * RSS feed reading with Elfeed 11 | :PROPERTIES: 12 | :CUSTOM_ID: elfeed 13 | :END: 14 | 15 | #+BEGIN_SRC emacs-lisp 16 | (use-package elfeed 17 | :ensure t 18 | :bind ("C-x w" . elfeed) 19 | :init 20 | ;; URLs in no particular order 21 | (setq elfeed-use-curl t) 22 | (add-hook 'elfeed-show-mode-hook #'eos/turn-on-hl-line) 23 | (setq elfeed-feeds 24 | '(;; Blogs 25 | ("http://harryrschwartz.com/atom.xml" blog) 26 | ("http://zinascii.com/writing-feed.xml" blog) 27 | ("http://githubengineering.com/atom.xml" blog) 28 | ("http://blog.smola.org/rss" blog) 29 | ("http://briancarper.net/feed" blog) 30 | ("https://kotka.de/blog/index.rss" blog) 31 | ("http://fiftyfootshadows.net/feed/" blog) 32 | ("http://blag.xkcd.com/feed/" blog) 33 | ("http://youdisappear.net/files/page1.xml" blog music) 34 | ("http://normanmaurer.me/blog.atom" blog) 35 | ("http://blog.mikemccandless.com/feeds/posts/default" elasticsearch blog) 36 | ("http://lethain.com/feeds/all/" blog) 37 | ("http://feeds.feedburner.com/jamesshelley" blog) 38 | ("http://www.marco.org/rss" blog) 39 | ("http://elliotth.blogspot.com/feeds/posts/default" blog) 40 | ("http://feeds.feedburner.com/Hyperbole-and-a-half" blog) 41 | ("http://lcamtuf.blogspot.com/feeds/posts/default" blog) 42 | ("http://blog.isabel-drost.de/index.php/feed" blog) 43 | ("http://feeds2.feedburner.com/CodersTalk" blog) 44 | ("http://feeds.feedburner.com/codinghorror/" blog) 45 | ("http://lambda-the-ultimate.org/rss.xml" blog) 46 | ("http://danluu.com/atom.xml" blog) 47 | ("http://ferd.ca/feed.rss" blog) 48 | ("http://blog.fsck.com/atom.xml" blog) 49 | ("http://jvns.ca/atom.xml" blog) 50 | ("http://newartisans.com/rss.xml" blog emacs) 51 | ("http://bling.github.io/index.xml" blog emacs) 52 | ("https://rachelbythebay.com/w/atom.xml" blog) 53 | ("http://blog.nullspace.io/feed.xml" blog) 54 | ("http://www.mcfunley.com/feed/atom" blog) 55 | ("https://codewords.recurse.com/feed.xml" blog) 56 | ("http://akaptur.com/atom.xml" blog) 57 | ("http://davidad.github.io/atom.xml" blog) 58 | ("http://www.evanjones.ca/index.rss" blog) 59 | ("http://neverworkintheory.org/feed.xml" blog) 60 | ("http://feeds.feedburner.com/GustavoDuarte?format=xml" blog) 61 | ("http://blog.regehr.org/feed" blog) 62 | ("https://www.snellman.net/blog/rss-index.xml" blog) 63 | ("http://eli.thegreenplace.net/feeds/all.atom.xml" blog) 64 | ("https://idea.popcount.org/rss.xml" blog) 65 | ("https://aphyr.com/posts.atom" blog) 66 | ("http://kamalmarhubi.com/blog/feed.xml" blog) 67 | ("http://maryrosecook.com/blog/feed" blog) 68 | ("http://www.tedunangst.com/flak/rss" blog) 69 | ("http://yosefk.com/blog/feed" blog) 70 | ("http://www.benkuhn.net/rss/" blog) 71 | ("https://emacsgifs.github.io/feed.xml" blog emacs) 72 | ("http://www.alfredodinapoli.com/rss.xml" blog) 73 | ("http://stapletonion.com/feed/" blog) 74 | ("http://outoflivingbooks.com/feed/" blog) 75 | ("http://slatestarcodex.com/feed/" blog) 76 | ("http://quillette.com/feed/" blog) 77 | ("http://www.baconbridge.com/feed/" blog) 78 | ("https://fridaywithflo.wordpress.com/feed/" blog) 79 | ("https://oakamel.wordpress.com/feed/" blog) 80 | ("https://social.ayjay.org/feed.xml" blog) 81 | ("https://writequit.org/book/index.xml" blog) 82 | ("https://sixdayscience.com/feed/" blog) 83 | ("https://mckinleyvalentine.com/feed/" blog) 84 | ("https://vicki.substack.com/feed/" blog) 85 | ("https://pluralistic.net/feed/" blog) 86 | ("https://astralcodexten.substack.com/feed/" blog) 87 | ("https://samueldjames.substack.com/feed" blog christianity) 88 | ("https://www.etymologynerd.com/1/feed" blog) 89 | ("https://austinkleon.com/feed/" blog) 90 | ("http://babylonbee.com/feed/" humor) 91 | 92 | ;; Theology 93 | ("http://www.speculativefaith.com/feed/" christianity) 94 | ("http://feeds.feedburner.com/canon-fodder" christianity) 95 | ("http://feeds.feedburner.com/tgcblog?format=xml" christianity) 96 | ("http://www.rzim.org/let-my-people-think-broadcasts/feed/" christianity) 97 | ("http://adam4d.com/feed/" christianity) 98 | ("https://chesed297.wordpress.com/feed/" blog christianity) 99 | ("https://faithandselfdefense.com/feed/" blog christianity) 100 | ("http://www.challies.com/feed" blog christianity) 101 | ("http://www.thepoachedegg.net/the-poached-egg/atom.xml" christianity) 102 | ("https://feeds.feedburner.com/secondnaturejournal/HfHT" christianity) 103 | ("http://blogs.mereorthodoxy.com/samuel/feed/" christianity) 104 | ("https://civilamericablog.wordpress.com/feed/" blog christianity) 105 | ("http://blog.ayjay.org/feed/" blog christianity) 106 | ("https://mereorthodoxy.com/feed/" christianity) 107 | ("http://www.travisdickinson.com/feed/" blog christianity) 108 | ("http://thinktheology.co.uk/rss" christianity) 109 | ("http://www.readingaugustine.com/?feed=rss2" blog christianity) 110 | ("http://www.theolatte.com/feed/atom/" christianity) 111 | ("https://letterandliturgy.com/feed/" christianity) 112 | ("https://alastairadversaria.com/feed/" blog christianity) 113 | ("https://chab123.wordpress.com/feed/" blog christianity) 114 | ("https://cogentchristianity.com/feed/" blog christianity) 115 | ("https://christandpopculture.com/feed/" blog christianity) 116 | ("https://mindyourmaker.com/feed/" christianity) 117 | ("https://letterandliturgy.wordpress.com/feed/" blog christianity) 118 | ("https://adfontesjournal.com/feed/" christianity) 119 | ("https://www.oakamel.com/rss/" blog christianity) 120 | 121 | ;; Github feeds 122 | ("https://github.com/milkypostman/melpa/commits/master.atom" github emacs) 123 | ("https://github.com/elasticsearch/elasticsearch/commits/master.atom" github elasticsearch) 124 | ("https://github.com/aphyr/jepsen/commits/master.atom" github) 125 | 126 | ;; Linux 127 | ("http://www.phoronix.com/rss.php" linux news) 128 | ("http://fedoramagazine.org/feed/" linux) 129 | ("http://feeds.feedburner.com/mylinuxrig" linux) 130 | 131 | ;; Java 132 | ("http://psy-lob-saw.blogspot.com/feeds/posts/default" blog java) 133 | ("http://vanillajava.blogspot.de/feeds/posts/default" blog java) 134 | ("http://feeds.feedburner.com/DanielMitterdorfer?format=xml" blog java) 135 | ("http://www.nurkiewicz.com/feeds/posts/default" blog java) 136 | ("http://jcdav.is/atom.xml" blog java) 137 | 138 | ;; Clojure 139 | ("http://feeds.feedburner.com/ClojureAndMe" clojure) 140 | ("http://clojure.com/blog/atom.xml" clojure) 141 | ("http://feeds.feedburner.com/disclojure" clojure) 142 | 143 | ;; Emacs 144 | ("http://oremacs.com/atom.xml" emacs) 145 | ("http://www.lunaryorn.com/feed.atom" emacs) 146 | ("http://emacsnyc.org/atom.xml" emacs) 147 | ("http://emacsredux.com/atom.xml" emacs) 148 | ("http://www.masteringemacs.org/feed/" emacs) 149 | ("http://planet.emacsen.org/atom.xml" emacs) 150 | ("http://endlessparentheses.com/atom.xml" emacs) 151 | 152 | ;; News 153 | ("http://feeds.arstechnica.com/arstechnica/index/" news) 154 | ("http://www.osnews.com/files/recent.xml" news) 155 | ("http://rss.slashdot.org/Slashdot/slashdot" news) 156 | ("http://feeds2.feedburner.com/boingboing/iBag" news) 157 | ("http://thefeature.net/rss" news) 158 | ("http://acculturated.com/feed/" news) 159 | ("https://opensource.com/feed" news) 160 | ("https://submittedforyourperusal.com/feed/" news) 161 | ("https://arcdigital.media/feed" news) 162 | 163 | ;; Flickr 164 | ("http://api.flickr.com/services/feeds/photos_public.gne?id=76499814@N00&format=atom" flickr) 165 | ("http://api.flickr.com/services/feeds/photos_public.gne?id=22397765@N00&format=atom" flickr) 166 | ("http://api.flickr.com/services/feeds/photos_public.gne?id=86882399@N00&format=atom" flickr) 167 | ("http://api.flickr.com/services/feeds/photos_public.gne?id=47372492@N00&format=atom" flickr) 168 | ("http://api.flickr.com/services/feeds/photos_public.gne?id=71413926@N00&format=atom" flickr) 169 | ("http://api.flickr.com/services/feeds/photos_public.gne?id=40347643@N00&format=atom" flickr) 170 | ("http://api.flickr.com/services/feeds/photos_public.gne?id=43319799@N00&format=atom" flickr) 171 | 172 | ;; Reddit 173 | ("https://www.reddit.com/r/emacs/.rss" emacs reddit) 174 | ("https://www.reddit.com/r/orgmode/.rss" emacs reddit) 175 | ("https://www.reddit.com/r/elasticsearch/.rss" elasticsearch reddit) 176 | ("https://www.reddit.com/r/elastic/.rss" elasticsearch reddit) 177 | 178 | ;; Other 179 | ("http://speeddemosarchive.com/sda100.atom" gaming) 180 | ("https://retropie.org.uk/feed/" gaming) 181 | ("http://www.elastic.co/blog/feed/" elasticsearch) 182 | "http://git-annex.branchable.com/tips/index.atom" 183 | "http://git-annex.branchable.com/devblog/index.atom" 184 | "https://github.com/blog.atom" 185 | "http://blog.chromium.org/feeds/posts/default" 186 | "http://classicprogrammerpaintings.tumblr.com/rss" 187 | "http://www.thepublicdiscourse.com/feed/" 188 | "https://www.intellectualtakeout.org/rss/blog.xml" 189 | "https://www.bibledesignblog.com/blog?format=rss" 190 | )) 191 | :config 192 | (define-key elfeed-show-mode-map (kbd "j") 'next-line) 193 | (define-key elfeed-show-mode-map (kbd "k") 'previous-line)) 194 | #+END_SRC 195 | -------------------------------------------------------------------------------- /eos-twitter.org: -------------------------------------------------------------------------------- 1 | #+TITLE: EOS: Twitter Module 2 | #+AUTHOR: Lee Hinman 3 | #+EMAIL: lee@writequit.org 4 | #+SETUPFILE: ~/eos/setupfiles/eos.setup 5 | 6 | #+BEGIN_SRC emacs-lisp 7 | (provide 'eos-twitter) 8 | #+END_SRC 9 | 10 | * Twitter with twittering-mode 11 | :PROPERTIES: 12 | :CUSTOM_ID: twitter 13 | :END: 14 | 15 | Load up twittering mode, but defer it since I'm probably not loading emacs to 16 | immediately use Twitter :P 17 | 18 | #+BEGIN_SRC emacs-lisp 19 | (use-package twittering-mode 20 | :ensure t 21 | :disabled t 22 | :config 23 | (setq twittering-icon-mode t 24 | twittering-use-master-password t 25 | twittering-username "thnetos" 26 | twittering-timer-interval 600 27 | ;; Start up with home and "emacs" search 28 | twittering-initial-timeline-spec-string 29 | '("(:home+@)" 30 | "(:search/emacs/)" 31 | "(:search/elasticsearch/)")) 32 | ;; Don't kill the twittering buffer, just bury it 33 | (define-key twittering-mode-map (kbd "q") 'bury-buffer)) 34 | #+END_SRC 35 | 36 | And then a nice helper for starting that will be called from the main EOS hydra 37 | 38 | #+BEGIN_SRC emacs-lisp 39 | (defun eos/turn-on-twittering-notifications () 40 | (setq sauron-prio-twittering-mention 4)) 41 | 42 | (defun eos/start-or-jump-to-twitter () 43 | "If twittering-mode is already active, jump to it, otherwise start it." 44 | (interactive) 45 | (if (get-buffer "(:home+@)") 46 | (switch-to-buffer "(:home+@)") 47 | ;; disable twitter notifications for ~10 seconds 48 | (setq sauron-prio-twittering-mention 2) 49 | (twittering-mode) 50 | (run-at-time "10 sec" nil #'eos/turn-on-twittering-notifications))) 51 | #+END_SRC 52 | -------------------------------------------------------------------------------- /eos-vertico.org: -------------------------------------------------------------------------------- 1 | #+TITLE: EOS: Vertico Module 2 | #+AUTHOR: Lee Hinman 3 | #+EMAIL: lee@writequit.org 4 | #+SETUPFILE: ~/eos/setupfiles/eos.setup 5 | 6 | #+BEGIN_SRC emacs-lisp 7 | (provide 'eos-vertico) 8 | #+END_SRC 9 | 10 | * Vertico, vertical completion 11 | Vertico is a completion framework alternative to Helm. 12 | 13 | #+BEGIN_SRC emacs-lisp 14 | (use-package vertico 15 | :ensure t 16 | :init 17 | (vertico-mode) 18 | ;; Different scroll margin (default is 2) 19 | ;; (setq vertico-scroll-margin 0) 20 | ;; Show more candidates 21 | (setq vertico-count 14) 22 | ;; Grow and shrink the Vertico minibuffer 23 | (setq vertico-resize nil) 24 | ;; Optionally enable cycling for `vertico-next' and `vertico-previous'. 25 | (setq vertico-cycle t) 26 | :config 27 | ;; Persist history over Emacs restarts. Vertico sorts by history position. 28 | (use-package savehist 29 | :init 30 | (savehist-mode)) 31 | (use-package emacs 32 | :init 33 | ;; Add prompt indicator to `completing-read-multiple'. 34 | ;; We display [CRM], e.g., [CRM,] if the separator is a comma. 35 | (defun eos/crm-indicator (args) 36 | (cons (format "[CRM%s] %s" 37 | (replace-regexp-in-string 38 | "\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" "" 39 | crm-separator) 40 | (car args)) 41 | (cdr args))) 42 | (advice-add #'completing-read-multiple :filter-args #'eos/crm-indicator) 43 | 44 | ;; Do not allow the cursor in the minibuffer prompt 45 | (setq minibuffer-prompt-properties 46 | '(read-only t cursor-intangible t face minibuffer-prompt)) 47 | (add-hook 'minibuffer-setup-hook #'cursor-intangible-mode) 48 | 49 | ;; Emacs 28: Hide commands in M-x which do not work in the current mode. 50 | ;; Vertico commands are hidden in normal buffers. 51 | (setq read-extended-command-predicate 52 | #'command-completion-default-include-p) 53 | 54 | ;; Enable recursive minibuffers 55 | (setq enable-recursive-minibuffers t))) 56 | #+END_SRC 57 | 58 | * Orderless 59 | 60 | #+BEGIN_SRC emacs-lisp 61 | (use-package orderless 62 | :ensure t 63 | :custom 64 | (completion-styles '(orderless basic)) 65 | (completion-category-overrides '((file (styles basic partial-completion))))) 66 | #+END_SRC 67 | 68 | * Consult 69 | 70 | #+BEGIN_SRC emacs-lisp 71 | (use-package consult 72 | :ensure t 73 | ;; Replace bindings. Lazily loaded due by `use-package'. 74 | :bind (;; C-c bindings (mode-specific-map) 75 | ("C-c h" . consult-history) 76 | ("C-c m" . consult-mode-command) 77 | ("C-c k" . consult-kmacro) 78 | ;; C-x bindings (ctl-x-map) 79 | ("C-x M-:" . consult-complex-command) ;; orig. repeat-complex-command 80 | ("C-x b" . consult-buffer) ;; orig. switch-to-buffer 81 | ("C-x C-b" . consult-buffer) ;; orig. switch-to-buffer 82 | ("C-x 4 b" . consult-buffer-other-window) ;; orig. switch-to-buffer-other-window 83 | ("C-x 5 b" . consult-buffer-other-frame) ;; orig. switch-to-buffer-other-frame 84 | ("C-x r b" . consult-bookmark) ;; orig. bookmark-jump 85 | ("C-x p b" . consult-project-buffer) ;; orig. project-switch-to-buffer 86 | ("C-x C-d" . consult-project-buffer) 87 | ("C-x o" . consult-line) 88 | ;; Custom M-# bindings for fast register access 89 | ;; ("M-#" . consult-register-load) 90 | ;; ("M-'" . consult-register-store) ;; orig. abbrev-prefix-mark (unrelated) 91 | ;; ("C-M-#" . consult-register) 92 | ;; Other custom bindings 93 | ("M-y" . consult-yank-pop) ;; orig. yank-pop 94 | (" a" . consult-apropos) ;; orig. apropos-command 95 | ;; M-g bindings (goto-map) 96 | ("M-g e" . consult-compile-error) 97 | ("M-g f" . consult-flymake) ;; Alternative: consult-flycheck 98 | ("M-g g" . consult-goto-line) ;; orig. goto-line 99 | ("M-g M-g" . consult-goto-line) ;; orig. goto-line 100 | ("M-g o" . consult-outline) ;; Alternative: consult-org-heading 101 | ("M-g m" . consult-mark) 102 | ("M-g k" . consult-global-mark) 103 | ("M-g i" . consult-imenu) 104 | ("M-g I" . consult-imenu-multi) 105 | ;; M-s bindings (search-map) 106 | ("M-s d" . consult-find) 107 | ("M-s D" . consult-locate) 108 | ("M-s g" . consult-grep) 109 | ("M-s G" . consult-git-grep) 110 | ("M-s r" . consult-ripgrep) 111 | ("C-c C-s" . consult-ripgrep) 112 | ("M-s l" . consult-line) 113 | ("C-c C-l" . consult-line) 114 | ("C-x L" . consult-line) 115 | ("M-s L" . consult-line-multi) 116 | ("M-s m" . consult-multi-occur) 117 | ("M-s k" . consult-keep-lines) 118 | ("M-s u" . consult-focus-lines) 119 | ;; Isearch integration 120 | ("M-s e" . consult-isearch-history) 121 | :map isearch-mode-map 122 | ("M-e" . consult-isearch-history) ;; orig. isearch-edit-string 123 | ("M-s e" . consult-isearch-history) ;; orig. isearch-edit-string 124 | ("M-s l" . consult-line) ;; needed by consult-line to detect isearch 125 | ("M-s L" . consult-line-multi) ;; needed by consult-line to detect isearch 126 | ;; Minibuffer history 127 | :map minibuffer-local-map 128 | ("M-s" . consult-history) ;; orig. next-matching-history-element 129 | ("M-r" . consult-history)) ;; orig. previous-matching-history-element 130 | 131 | ;; Enable automatic preview at point in the *Completions* buffer. This is 132 | ;; relevant when you use the default completion UI. 133 | :hook (completion-list-mode . consult-preview-at-point-mode) 134 | 135 | ;; The :init configuration is always executed (Not lazy) 136 | :init 137 | 138 | ;; Optionally configure the register formatting. This improves the register 139 | ;; preview for `consult-register', `consult-register-load', 140 | ;; `consult-register-store' and the Emacs built-ins. 141 | (setq register-preview-delay 0.5 142 | register-preview-function #'consult-register-format) 143 | 144 | ;; Optionally tweak the register preview window. 145 | ;; This adds thin lines, sorting and hides the mode line of the window. 146 | (advice-add #'register-preview :override #'consult-register-window) 147 | 148 | ;; Use Consult to select xref locations with preview 149 | (setq xref-show-xrefs-function #'consult-xref 150 | xref-show-definitions-function #'consult-xref) 151 | 152 | ;; Configure other variables and modes in the :config section, 153 | ;; after lazily loading the package. 154 | :config 155 | 156 | ;; Optionally configure preview. The default value 157 | ;; is 'any, such that any key triggers the preview. 158 | ;; (setq consult-preview-key 'any) 159 | ;; (setq consult-preview-key (kbd "M-.")) 160 | ;; (setq consult-preview-key (list (kbd "") (kbd ""))) 161 | ;; For some commands and buffer sources it is useful to configure the 162 | ;; :preview-key on a per-command basis using the `consult-customize' macro. 163 | (consult-customize 164 | consult-theme :preview-key '(:debounce 0.2 any) 165 | consult-ripgrep consult-git-grep consult-grep 166 | consult-bookmark consult-recent-file consult-xref 167 | consult--source-bookmark consult--source-file-register 168 | consult--source-recent-file consult--source-project-recent-file 169 | ;; :preview-key (kbd "M-.") 170 | :preview-key '(:debounce 0.4 any)) 171 | 172 | ;; Optionally configure the narrowing key. 173 | ;; Both < and C-+ work reasonably well. 174 | (setq consult-narrow-key "<") ;; (kbd "C-+") 175 | 176 | ;; Optionally make narrowing help available in the minibuffer. 177 | ;; You may want to use `embark-prefix-help-command' or which-key instead. 178 | ;; (define-key consult-narrow-map (vconcat consult-narrow-key "?") #'consult-narrow-help) 179 | 180 | ;; By default `consult-project-function' uses `project-root' from project.el. 181 | ;; Optionally configure a different project root function. 182 | ;; There are multiple reasonable alternatives to chose from. 183 | ;;;; 1. project.el (the default) 184 | ;; (setq consult-project-function #'consult--default-project--function) 185 | ;;;; 2. projectile.el (projectile-project-root) 186 | ;; (autoload 'projectile-project-root "projectile") 187 | ;; (setq consult-project-function (lambda (_) (projectile-project-root))) 188 | ;;;; 3. vc.el (vc-root-dir) 189 | ;; (setq consult-project-function (lambda (_) (vc-root-dir))) 190 | ;;;; 4. locate-dominating-file 191 | ;; (setq consult-project-function (lambda (_) (locate-dominating-file "." ".git"))) 192 | ) 193 | #+END_SRC 194 | 195 | * Marginalia 196 | 197 | #+BEGIN_SRC emacs-lisp 198 | ;; Enable rich annotations using the Marginalia package 199 | (use-package marginalia 200 | :ensure t 201 | ;; Either bind `marginalia-cycle' globally or only in the minibuffer 202 | :bind (("M-A" . marginalia-cycle) 203 | :map minibuffer-local-map 204 | ("M-A" . marginalia-cycle)) 205 | 206 | ;; The :init configuration is always executed (Not lazy!) 207 | :init 208 | 209 | ;; Must be in the :init section of use-package such that the mode gets 210 | ;; enabled right away. Note that this forces loading the package. 211 | (marginalia-mode)) 212 | #+END_SRC 213 | 214 | * Embark 215 | 216 | #+BEGIN_SRC emacs-lisp 217 | (use-package embark 218 | :ensure t 219 | :bind 220 | (("C-." . embark-act) ;; pick some comfortable binding 221 | ("C-M-." . embark-dwim) ;; good alternative: M-. 222 | ("C-h b" . embark-bindings) 223 | ("C-h B" . embark-bindings)) ;; alternative for `describe-bindings' 224 | 225 | :init 226 | 227 | ;; Optionally replace the key help with a completing-read interface 228 | (setq prefix-help-command #'embark-prefix-help-command) 229 | 230 | :config 231 | 232 | ;; Hide the mode line of the Embark live/completions buffers 233 | (add-to-list 'display-buffer-alist 234 | '("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*" 235 | nil 236 | (window-parameters (mode-line-format . none))))) 237 | 238 | ;; Consult users will also want the embark-consult package. 239 | (use-package embark-consult 240 | :ensure t ; only need to install it, embark loads it after consult if found 241 | :hook 242 | (embark-collect-mode . consult-preview-at-point-mode)) 243 | #+END_SRC 244 | 245 | * Corfu 246 | 247 | #+BEGIN_SRC emacs-lisp 248 | (use-package corfu 249 | :ensure t 250 | ;; Optional customizations 251 | ;; :custom 252 | ;; (corfu-auto t) ;; Enable auto completion 253 | ;; (corfu-separator ?\s) ;; Orderless field separator 254 | ;; (corfu-quit-at-boundary nil) ;; Never quit at completion boundary 255 | ;; (corfu-quit-no-match nil) ;; Never quit, even if there is no match 256 | ;; (corfu-preview-current nil) ;; Disable current candidate preview 257 | ;; (corfu-preselect-first nil) ;; Disable candidate preselection 258 | ;; (corfu-on-exact-match nil) ;; Configure handling of exact matches 259 | ;; (corfu-echo-documentation nil) ;; Disable documentation in the echo area 260 | ;; (corfu-scroll-margin 5) ;; Use scroll margin 261 | 262 | ;; Enable Corfu only for certain modes. 263 | ;; :hook ((prog-mode . corfu-mode) 264 | ;; (shell-mode . corfu-mode) 265 | ;; (eshell-mode . corfu-mode)) 266 | 267 | ;; Recommended: Enable Corfu globally. 268 | ;; This is recommended since Dabbrev can be used globally (M-/). 269 | ;; See also `corfu-excluded-modes'. 270 | :init 271 | (global-corfu-mode) 272 | :config 273 | (setq corfu-cycle t) ;; Enable cycling for `corfu-next/previous' 274 | (use-package corfu-terminal 275 | :ensure t 276 | :init 277 | (unless (display-graphic-p) 278 | (corfu-terminal-mode +1)))) 279 | 280 | ;; A few more useful configurations... 281 | (use-package emacs 282 | :init 283 | ;; TAB cycle if there are only few candidates 284 | (setq completion-cycle-threshold 3) 285 | 286 | ;; Emacs 28: Hide commands in M-x which do not apply to the current mode. 287 | ;; Corfu commands are hidden, since they are not supposed to be used via M-x. 288 | ;; (setq read-extended-command-predicate 289 | ;; #'command-completion-default-include-p) 290 | 291 | ;; Enable indentation+completion using the TAB key. 292 | ;; `completion-at-point' is often bound to M-TAB. 293 | (setq tab-always-indent 'complete)) 294 | #+END_SRC 295 | 296 | * Kind-icon for Corfu 297 | 298 | #+BEGIN_SRC emacs-lisp 299 | (use-package kind-icon 300 | :ensure t 301 | :after corfu 302 | :custom 303 | (kind-icon-default-face 'corfu-default) ; to compute blended backgrounds correctly 304 | :config 305 | (add-to-list 'corfu-margin-formatters #'kind-icon-margin-formatter)) 306 | #+END_SRC 307 | -------------------------------------------------------------------------------- /eos-web.org: -------------------------------------------------------------------------------- 1 | #+TITLE: EOS: Web Module 2 | #+AUTHOR: Lee Hinman 3 | #+EMAIL: lee@writequit.org 4 | #+SETUPFILE: ~/eos/setupfiles/eos.setup 5 | 6 | #+BEGIN_SRC emacs-lisp 7 | (provide 'eos-web) 8 | #+END_SRC 9 | 10 | * Web browsers, EWW and Firefox 11 | :PROPERTIES: 12 | :CUSTOM_ID: eww 13 | :END: 14 | Ewwwwww... 15 | 16 | Wait, no, I mean the Emacs web browser built in to 24.4+ 17 | 18 | We can browse to anything that looks like a URL with =C-x m=. 19 | 20 | #+begin_src emacs-lisp :tangle yes 21 | (global-set-key (kbd "C-x m") 'browse-url-at-point) 22 | #+end_src 23 | 24 | I use EWW as my default browser in Emacs; certain things, I need to jump out of 25 | EWW and in to a real browser with javascript; which I can do if I just hit =&= 26 | or =O= -- it'll drop me in to a firefox session without a hassle. 27 | 28 | There are certain sites that, despite my best abilities, I cannot make work in 29 | EWW. For these, I launch Firefox directly, instead of hitting a silly man in the 30 | middle. 31 | 32 | #+BEGIN_SRC emacs-lisp 33 | (use-package eww 34 | :defer t 35 | :init 36 | (setq browse-url-handlers 37 | '((".*google.*maps.*" . browse-url-generic) 38 | ;; Github goes to firefox, but not gist 39 | ("http.*\/\/github.com" . browse-url-generic) 40 | ("groups.google.com" . browse-url-generic) 41 | ("docs.google.com" . browse-url-generic) 42 | ("melpa.org" . browse-url-generic) 43 | ("build.*\.elastic.co" . browse-url-generic) 44 | (".*-ci\.elastic.co" . browse-url-generic) 45 | ("gradle-enterprise.elastic.co" . browse-url-generic) 46 | ("internal-ci\.elastic\.co" . browse-url-generic) 47 | ("zendesk\.com" . browse-url-generic) 48 | ("salesforce\.com" . browse-url-generic) 49 | ("stackoverflow\.com" . browse-url-generic) 50 | ("apache\.org\/jira" . browse-url-generic) 51 | ("thepoachedegg\.net" . browse-url-generic) 52 | ("zoom.us" . browse-url-generic) 53 | ("t.co" . browse-url-generic) 54 | ("twitter.com" . browse-url-generic) 55 | ("\/\/a.co" . browse-url-generic) 56 | ("youtube.com" . browse-url-generic) 57 | ("amazon.com" . browse-url-generic) 58 | ("slideshare.net" . browse-url-generic) 59 | ("." . eww-browse-url))) 60 | (setq shr-external-browser 'browse-url-generic) 61 | (setq browse-url-generic-program (or (executable-find "firefox") (executable-find "open-browser"))) 62 | (add-hook 'eww-mode-hook #'toggle-word-wrap) 63 | (add-hook 'eww-mode-hook #'visual-line-mode) 64 | :config 65 | (use-package s :ensure t) 66 | (define-key eww-mode-map "o" 'eww) 67 | (define-key eww-mode-map "O" 'eww-browse-with-external-browser) 68 | (define-key eww-mode-map "j" 'next-line) 69 | (define-key eww-mode-map "k" 'previous-line) 70 | 71 | (use-package eww-lnum 72 | :ensure t 73 | :config 74 | (bind-key "f" #'eww-lnum-follow eww-mode-map) 75 | (bind-key "U" #'eww-lnum-universal eww-mode-map))) 76 | #+END_SRC 77 | 78 | Let's also add some code so we get vimperator/eww-lnum style link hints 79 | everywhere 80 | 81 | #+BEGIN_SRC emacs-lisp 82 | (use-package link-hint 83 | :ensure t 84 | :bind ("C-c f" . link-hint-open-link)) 85 | #+END_SRC 86 | 87 | Search backwards, prompting to open any URL found. This is 88 | fantastic for ERC buffers. I bind this to =C-c u= because I use it 89 | a lot. 90 | 91 | #+BEGIN_SRC emacs-lisp 92 | (defun browse-last-url-in-brower () 93 | (interactive) 94 | (save-excursion 95 | (ffap-next-url t t))) 96 | 97 | (global-set-key (kbd "C-c u") 'browse-last-url-in-brower) 98 | #+END_SRC 99 | -------------------------------------------------------------------------------- /eos-writing.org: -------------------------------------------------------------------------------- 1 | #+TITLE: EOS: Writing Module 2 | #+AUTHOR: Lee Hinman 3 | #+EMAIL: lee@writequit.org 4 | #+SETUPFILE: ~/eos/setupfiles/eos.setup 5 | 6 | #+BEGIN_SRC emacs-lisp 7 | (provide 'eos-writing) 8 | #+END_SRC 9 | 10 | Used more often than you'd think... 11 | 12 | #+BEGIN_SRC emacs-lisp 13 | (defun lod () 14 | "Well. This is disappointing." 15 | (interactive) 16 | (insert "ಠ_ಠ")) 17 | 18 | (global-set-key (kbd "C-c M-d") #'lod) 19 | #+END_SRC 20 | 21 | Sometimes I need to unfill paragraphs (the undo of =M-q=): 22 | 23 | #+BEGIN_SRC emacs-lisp 24 | (use-package unfill 25 | :ensure t 26 | :bind (("M-q" . eos/maybe-unfill-toggle) 27 | ("M-Q" . unfill-paragraph)) 28 | :config 29 | (defun eos/maybe-unfill-toggle () 30 | "Fill paragraph at or after point (see `unfill-paragraph'). 31 | Does nothing if `visual-line-mode' is on." 32 | (interactive) 33 | (or visual-line-mode 34 | (unfill-toggle)))) 35 | #+END_SRC 36 | 37 | * Installing Markup Languages 38 | :PROPERTIES: 39 | :CUSTOM_ID: markup 40 | :END: 41 | 42 | Let's install markdown mode, since all of Github seems enamored with it. 43 | 44 | #+BEGIN_SRC emacs-lisp 45 | (use-package markdown-mode 46 | :ensure t 47 | :mode (("\\`README\\.md\\'" . gfm-mode) 48 | ("github\\.com.*\\.txt\\'" . gfm-mode) 49 | ("\\.md\\'" . markdown-mode) 50 | ("\\.markdown\\'" . markdown-mode)) 51 | :init 52 | (setq markdown-enable-wiki-links t 53 | markdown-italic-underscore t 54 | markdown-make-gfm-checkboxes-buttons t 55 | markdown-gfm-additional-languages '("sh")) 56 | (add-hook 'markdown-mode-hook #'flyspell-mode)) 57 | #+END_SRC 58 | 59 | YAML is used all over the place 60 | 61 | #+BEGIN_SRC emacs-lisp 62 | (use-package yaml-mode 63 | :ensure t) 64 | #+END_SRC 65 | 66 | Elasticsearch uses asciidoc everywhere for documentation, so let's install it 67 | 68 | #+BEGIN_SRC emacs-lisp 69 | (use-package adoc-mode 70 | :ensure t) 71 | #+END_SRC 72 | 73 | * Functions for Skeleton Code 74 | :PROPERTIES: 75 | :CUSTOM_ID: skeletons 76 | :END: 77 | Skeletons are kind of like yasnippet, but they don't mess with my keybindings 78 | all over the place and take forever to load ಠ_ಠ 79 | 80 | #+BEGIN_SRC emacs-lisp 81 | (require 'skeleton) 82 | 83 | (define-skeleton eos/org-header 84 | "Insert a standard header for org-mode files" 85 | "Title: " 86 | "#+TITLE: " str \n 87 | "#+AUTHOR: " (user-full-name) \n 88 | "#+EMAIL: " user-mail-address \n 89 | "#+SETUPFILE: ~/eos/setupfiles/default.setup 90 | 91 | | *Author* | {{{author}}} ({{{email}}}) | 92 | | *Date* | {{{time(%Y-%m-%d %H:%M:%S)}}} | 93 | 94 | ,* Introduction 95 | " \n) 96 | 97 | (define-skeleton eos/org-wrap-diagram-drawer 98 | "Wrap text with a :DIAGRAM: / :END: drawer for org-mode" 99 | nil 100 | > ":DIAGRAM:" \n 101 | > _ \n 102 | > ":END:" \n) 103 | 104 | (define-skeleton eos/org-wrap-elisp 105 | "Wrap text with #+BEGIN_SRC / #+END_SRC for the emacs-lisp code" 106 | nil 107 | > "#+BEGIN_SRC emacs-lisp" \n 108 | > _ \n 109 | > "#+END_SRC" \n) 110 | 111 | (define-skeleton eos/org-wrap-source 112 | "Wrap text with #+BEGIN_SRC / #+END_SRC for a code type" 113 | "Language: " 114 | > "#+BEGIN_SRC " str \n 115 | > _ \n 116 | > "#+END_SRC" \n) 117 | 118 | (define-skeleton eos/es-make-index 119 | "Insert boilerplate to create an index with `es-mode' syntax" 120 | "Index name: " 121 | "POST /" str \n 122 | "{" \n 123 | > "\"settings\": {" \n 124 | > "\"index\": {" \n 125 | > "\"number_of_shards\": 1," \n 126 | > "\"number_of_replicas\": 0" \n 127 | > "}" \n ;; index 128 | > "}," \n ;; settings 129 | > "\"mappings\": {" \n 130 | > "\"" (skeleton-read "Type name: ") "\": {" \n 131 | > "\"properties\": {" \n 132 | > "\"body\": {" \n 133 | > "\"type\": \"string\"" \n 134 | > "}" \n ;; body 135 | > "}" \n ;; properties 136 | > "}" \n ;; type 137 | > "}" \n ;; mappings 138 | > "}" \n) 139 | 140 | (define-skeleton eos/java-try-catch 141 | "Wrap code in a Java try/catch" 142 | nil 143 | > "try {" \n 144 | > _ 145 | > "} catch (Exception e) {" \n 146 | > "throw e;" \n 147 | > "}" \n) 148 | #+END_SRC 149 | 150 | And now let's add a hydra for the skeletons 151 | 152 | #+BEGIN_SRC emacs-lisp 153 | (defhydra eos/hydra-skeleton nil 154 | "Insert Skeleton" 155 | ("d" eos/org-wrap-diagram-drawer "Wrap as drawer" :exit t) 156 | ("e" eos/org-wrap-elisp "Wrap as elisp" :exit t) 157 | ("s" eos/org-wrap-source "Wrap as source" :exit t) 158 | ("i" eos/es-make-index "ES Index" :exit t) 159 | ("h" eos/org-header "Org Header" :exit t) 160 | ("t" eos/java-try-catch "Wrap with try/catch" :exit t)) 161 | #+END_SRC 162 | 163 | * Inserting Abbreviations with Abbrev-mode 164 | :PROPERTIES: 165 | :CUSTOM_ID: abbrev 166 | :END: 167 | 168 | #+BEGIN_SRC emacs-lisp 169 | (use-package abbrev 170 | :init (add-hook 'after-init-hook 'abbrev-mode) 171 | :diminish abbrev-mode 172 | :config 173 | (define-abbrev-table 174 | 'global-abbrev-table 175 | '(("ooc" "out of curiosity" nil 0))) 176 | (define-abbrev-table 177 | 'org-mode-abbrev-table 178 | '(("html exports 349 | 350 | #+BEGIN_SRC emacs-lisp 351 | (use-package fill-column-indicator 352 | :ensure t 353 | :config 354 | ;; fix for org -> html export 355 | (defun fci-mode-override-advice (&rest args)) 356 | (use-package org) 357 | (advice-add 'org-html-fontify-code :around 358 | (lambda (fun &rest args) 359 | (advice-add 'fci-mode :override #'fci-mode-override-advice) 360 | (let ((result (apply fun args))) 361 | (advice-remove 'fci-mode #'fci-mode-override-advice) 362 | result))) 363 | 364 | (defvar eos/fci-disabled nil) 365 | (make-variable-buffer-local 'eos/fci-disabled) 366 | ;; Add a hook that disables fci if enabled when the window changes and it 367 | ;; isn't wide enough to display it. 368 | (defun eos/maybe-disable-fci () 369 | (interactive) 370 | ;; Disable FCI if necessary 371 | (when (and fci-mode 372 | (< (window-width) (or fci-rule-column fill-column))) 373 | (fci-mode -1) 374 | (setq-local eos/fci-disabled t)) 375 | ;; Enable FCI if necessary 376 | (when (and eos/fci-disabled 377 | (eq fci-mode nil) 378 | (> (window-width) (or fci-rule-column fill-column))) 379 | (fci-mode 1) 380 | (setq-local eos/fci-disabled nil))) 381 | 382 | (defun eos/add-fci-disabling-hook () 383 | (interactive) 384 | (add-hook 'window-configuration-change-hook 385 | #'eos/maybe-disable-fci)) 386 | (add-hook 'prog-mode-hook #'eos/add-fci-disabling-hook)) 387 | #+END_SRC 388 | 389 | There's also the built-in whitespace mode, which I use to highlight things over 390 | the fill-column (80 in most programming modes, 140 in Java :P) 391 | 392 | #+BEGIN_SRC emacs-lisp 393 | ;; A subset, only training lines and whitespace 394 | (setq whitespace-style '(spaces tabs newline space-mark tab-mark newline-mark)) 395 | 396 | (setq whitespace-display-mappings 397 | ;; all numbers are Unicode codepoint in decimal. 398 | '(;;(space-mark 32 [183] [46]) 399 | ;; (newline-mark 10 [172 10]) ;; the paragraph sign 400 | (newline-mark 10 [172 10]) ;; mathematical "not" 401 | (tab-mark 9 [187 9] [92 9]))) 402 | 403 | (defun eos/turn-on-whitespace-mode () 404 | (interactive) 405 | (setq-local whitespace-line-column fill-column) 406 | (whitespace-mode +1) 407 | (diminish 'whitespace-mode) 408 | (whitespace-newline-mode 1) 409 | (diminish 'whitespace-newline-mode)) 410 | 411 | (add-hook 'prog-mode-hook #'eos/turn-on-whitespace-mode) 412 | 413 | #+END_SRC 414 | 415 | And a helper to turn off whitespace mode when exporting org documents 416 | 417 | #+BEGIN_SRC emacs-lisp 418 | (use-package org 419 | :config 420 | (advice-add 'org-html-fontify-code :around 421 | (lambda (fun &rest args) 422 | (whitespace-mode -1) 423 | (let ((result (apply fun args))) 424 | (whitespace-mode +1) 425 | result)))) 426 | #+END_SRC 427 | 428 | * Highlighting indentation 429 | 430 | There are basically two ways to do this, either with [[https://github.com/DarthFennec/highlight-indent-guides][highlight-indent-guides]] or with 431 | [[https://github.com/antonj/Highlight-Indentation-for-Emacs][highlight-indentation]]. The names are confusing, and they each have pros and cons, so it's hard to 432 | tell which is the better option... 433 | 434 | #+BEGIN_SRC emacs-lisp 435 | (use-package highlight-indent-guides 436 | :ensure t 437 | :disabled t 438 | :init 439 | (setq highlight-indent-guides-method 'character) 440 | (add-hook 'prog-mode-hook #'highlight-indent-guides-mode)) 441 | #+END_SRC 442 | 443 | * Plumbing writing on Firefox pages 444 | 445 | Sometimes I need to type really long responses in things. There are a couple of nice tools for this. 446 | Both are required for it to work. 447 | 448 | First, [[https://github.com/alpha22jp/atomic-chrome][atomic-chrome]] is needed on the Emacs side, and then [[https://github.com/GhostText/GhostText][GhostText]] on the Firefox side. 449 | 450 | #+BEGIN_SRC emacs-lisp 451 | (use-package atomic-chrome 452 | :ensure t 453 | :defer 10 454 | :init 455 | ;; See: https://github.com/alpha22jp/atomic-chrome/pull/28 456 | (defun atomic-chrome-server-running-p () 457 | "Returns `t' if the atomic-chrome server is currently running, 458 | `nil' otherwise." 459 | (let ((retval nil)) 460 | (condition-case ex 461 | (progn 462 | (delete-process 463 | (make-network-process 464 | :name "atomic-client-test" :host "localhost" 465 | :noquery t :service "64292")) 466 | (setq retval t)) 467 | ('error nil)) 468 | retval)) 469 | 470 | (when (not (atomic-chrome-server-running-p)) 471 | (atomic-chrome-start-server)) 472 | (setq atomic-chrome-default-major-mode 'markdown-mode 473 | atomic-chrome-url-major-mode-alist 474 | '(("github\\.com" . gfm-mode)))) 475 | #+END_SRC 476 | -------------------------------------------------------------------------------- /eos.org: -------------------------------------------------------------------------------- 1 | #+TITLE: The Emacs Operating System (EOS) 2 | #+AUTHOR: Lee Hinman 3 | #+EMAIL: lee@writequit.org 4 | #+SETUPFILE: ~/eos/setupfiles/eos.setup 5 | 6 | | *Author* | {{{author}}} ({{{email}}}) | 7 | | *Date* | {{{time(%Y-%m-%d %H:%M:%S)}}} | 8 | 9 | * Emacs Operating System 10 | :PROPERTIES: 11 | :CUSTOM_ID: eos 12 | :END: 13 | This is my attempt at a complete workflow inside of Emacs. 14 | 15 | There are many like it, but this one is mine. So let's start with a story. 16 | 17 | I used to be a hardcore Vim guy (hence the website named after a Vim command), 18 | in 2010 I joined a small company called [[http://sonian.com/][Sonian]] doing Clojure as a full-time gig. 19 | As part of the job, we all pair-programmed together on Clojure code in Emacs 20 | using TMUX. This meant that I needed to learn Emacs having never used it before. 21 | I dived in head first and found Emacs to be a more customizable and elegant 22 | editor. 23 | 24 | Around the same time, I switched to typing in [[https://en.wikipedia.org/wiki/Dvorak_Simplified_Keyboard][Dvorak]], so if you are reading this 25 | configuration and wondering why some of the bindings are the way they are, 26 | remember that my keys might be different than someone on Qwerty :) 27 | 28 | People often say about Emacs "sure it's a great operating system, but it lacks a 29 | good editor" so I decided to call my configuration "EOS" for the Emacs Operating 30 | System. This is my tribute to the [[http://doc.rix.si/cce/cce.html][Complete Computing Environment]], which heavily 31 | inspires this and from which I continue to find interesting tidbits to copy. 32 | 33 | If you want to look at specific parts, jump down to the [[#modules][module]] list to see links 34 | to different parts of the configuration. 35 | 36 | * How to use these files 37 | :PROPERTIES: 38 | :CUSTOM_ID: how-to-use 39 | :END: 40 | 41 | So usually you would check out [[https://github.com/dakrone/eos/][this repository]] and then run =make= in the 42 | directory. That will tangle a bunch of =.el= files. If you want to install this, 43 | run =make install= (or just =make init= if you only want to run initialization 44 | things). 45 | 46 | Once it's installed, make changes to the files directly and then just run =make= 47 | to re-tangle the files, no re-installation necessary, since symlinks are set up 48 | the first time you ran =make install=. 49 | 50 | If you get lost at any point, checking the org source is probably the best way 51 | to go, or send me an email (lee at writequit dot org) or a message on [[https://twitter.com/thnetos][twitter]]. 52 | 53 | Because the installation symlinks things into whatever directory EOS is checked 54 | out it, it allows me to type =make= and generate new =.el= files without any 55 | file copying. 56 | 57 | * Initial Preparation 58 | :PROPERTIES: 59 | :CUSTOM_ID: initial-prep 60 | :END: 61 | There is some initial prep that needs to happen before someone could run this, 62 | basically creating a bunch of directories so the tangled files and symlinks can 63 | go in the right place. 64 | 65 | This will tangle an initialization script and invoke it. This is handled by the 66 | =Makefile= which special-cases this one file. Basically the following goes into 67 | =initialize.sh=: 68 | 69 | #+BEGIN_SRC sh :tangle initialize.sh 70 | # Directory for user-installed scripts 71 | mkdir -p ~/bin 72 | 73 | # GnuPG 74 | mkdir -p ~/.gnupg 75 | chmod 700 ~/.gnupg 76 | 77 | # SSH 78 | mkdir -p ~/.ssh 79 | chmod 700 ~/.ssh 80 | 81 | # Emacs configuration folders 82 | mkdir -p ~/.emacs.d 83 | mkdir -p ~/.emacs.d/snippets 84 | mkdir -p ~/.emacs.d/eshell 85 | #+END_SRC 86 | 87 | This initialization file is then run first thing when running =make install= (or 88 | you can run =make initialize= manually to run this part). 89 | 90 | ** Installation script 91 | :PROPERTIES: 92 | :CUSTOM_ID: installation-script 93 | :END: 94 | In addition to the prep script, there needs to be a script used for installation 95 | that actually links up the appropriate parts. It ends up in =install.sh= 96 | 97 | *Warning! This will overwrite your current configuration if you run 98 | =install.sh=!* 99 | 100 | #+BEGIN_SRC sh :tangle install.sh :eval no 101 | ln -sfv $PWD/eos.el ~/.emacs.d/init.el 102 | ln -sfv $PWD ~/.emacs.d/eos 103 | ln -sfv $PWD/site-lisp ~/.emacs.d/site-lisp 104 | cp -vf bin/* ~/bin 105 | #+END_SRC 106 | 107 | * The EOS Module Set 108 | :PROPERTIES: 109 | :CUSTOM_ID: modules 110 | :END: 111 | There is of course the prerequisite, which is this file, and then EOS contains a 112 | number of different configurations and modules. This is a basic overview of the 113 | modules, which you should visit should you desire more information about a 114 | particular module. 115 | 116 | Ideally, each module except for the "Core" module is optional and can be skipped 117 | if not desired. In practice though, I load all of them, because this is my 118 | config. I haven't really tried loading them all individually to make sure I 119 | don't have links between them. 120 | 121 | - [[./eos-core.org][Core EOS]] - base Emacs settings and configurations 122 | - [[./eos-appearance.org][Appearance]] - change the look-and-feel 123 | - [[./eos-navigation.org][Navigation]] - helpers when navigating around Emacs 124 | - [[./eos-notify.org][Notification System]] - unifying notifications in Emacs with sauron 125 | - [[./eos-helm.org][Helm]] - incremental completion and selection framework 126 | - [[./eos-vertico.org][Vertico]] - an alternative completion and selection framework 127 | - [[./eos-develop.org][Development (programming) System]] - various development settings 128 | - [[./eos-java.org][Java]] - for the day job 129 | - [[./eos-clojure.org][Clojure]] - for the old day job and the open source work 130 | - [[./eos-es.org][Elasticsearch]] - so useful for things 131 | - [[./eos-git.org][Git]] - usually the only VCS I use, so it has quite a few customizations 132 | - [[./eos-completion.org][Completion]] - auto-completing things while programming (and not programming) 133 | - [[./eos-org.org][Org-mode and agenda]] - org is a fantastic organization tool 134 | - [[./eos-writing.org][Writing]] - various settings for writing human language 135 | - [[./eos-dired.org][Dired]] - directory browsing and file management 136 | - [[./eos-remote.org][Working with Remote Servers]] - transparently edit remote files with TRAMP 137 | - [[./eos-web.org][Web browsing]] - internal and external browsing with eww 138 | - [[./eos-shell.org][Shell]] - shells inside and outside of Emacs, mostly inside with eshell 139 | - [[./eos-mail.org][Mail (Email)]] - mu4e configuration to keep mail inside 140 | - [[./eos-irc.org][IRC]] - ERC configuration for IRC inside of Emacs 141 | - [[./eos-distributed.org][Distributed services]] - distributed services for things like ipfs and matrix 142 | - [[./eos-rss.org][RSS]] - keep up to date with websites I enjoy 143 | - [[./eos-twitter.org][Twitter]] - social networking at its angriest 144 | - [[./eos-leisure.org][Fun and Leisure]] - a catch-all for other things 145 | - [[./eos-music.org][Music]] - listening to tunes with Emacs 146 | 147 | * =init.el= 148 | :PROPERTIES: 149 | :CUSTOM_ID: init.el 150 | :END: 151 | 152 | =init.el= is the file that Emacs reads when it starts up, so here we do most of 153 | the bootstrapping before the EOS modules are loaded, then load the modules, then 154 | some cleanup at the end. It's worth noticing that even though this would tangle 155 | to =eos.el= by default, it gets symlinked to =~/.emacs.d/init.el=. 156 | 157 | Since an error may occur in loading any EOS files, I set some debugging things 158 | so a debugger is entered if there's a problem. These get unset after everything 159 | loads successfully. 160 | 161 | #+BEGIN_SRC emacs-lisp 162 | (setq debug-on-error t) 163 | (setq debug-on-quit t) 164 | #+END_SRC 165 | 166 | I load a couple of custom versions of libraries that are included in Emacs. This 167 | is so I can run a newer version than what's bundled, in particular this checks 168 | for the existence and loads them if there are there, otherwise it uses the 169 | bundled version. 170 | 171 | A custom version of [[http://cedet.sourceforge.net/][CEDET]]: 172 | 173 | #+BEGIN_SRC emacs-lisp 174 | ;; Load a custom version of cedet, if available 175 | (when (file-exists-p "~/src/elisp/cedet/cedet-devel-load.el") 176 | (load "~/src/elisp/cedet/cedet-devel-load.el")) 177 | #+END_SRC 178 | 179 | I hardcode a version of of [[http://orgmode.org/][Org-mode]]: 180 | 181 | #+BEGIN_SRC emacs-lisp 182 | ;; Load a custom version of org-mode, if available 183 | (when (file-exists-p "~/src/elisp/org-mode/lisp") 184 | (add-to-list 'load-path "~/src/elisp/org-mode/lisp") 185 | (add-to-list 'load-path "~/src/elisp/org-mode/contrib/lisp") 186 | (require 'org)) 187 | #+END_SRC 188 | 189 | Also, let's make =cl= things available right from the start 190 | 191 | #+BEGIN_SRC emacs-lisp 192 | (require 'cl) 193 | #+END_SRC 194 | 195 | I can't live without this, "x" on Dvorak is where "b" is on Qwerty, and it's 196 | just too hard for all the C-x things I have to hit. Maybe one day I'll just 197 | switch to evil (or god-mode) and be done with it. 198 | 199 | For now, 't' is much more convenient so I switch =C-x= and =C-t= on the 200 | keyboard. I don't transpose things nearly as often as I =C-x= things 201 | 202 | #+BEGIN_SRC emacs-lisp 203 | (define-key key-translation-map "\C-t" "\C-x") 204 | (define-key key-translation-map "\C-x" "\C-t") 205 | #+END_SRC 206 | 207 | ** =package.el= Setup 208 | :PROPERTIES: 209 | :CUSTOM_ID: package.el 210 | :END: 211 | My strategy with regard to packaging is simple, I make heavy use of [[https://github.com/jwiegley/use-package][use-package]] 212 | which does most of the installing with the =:ensure= keyword, but I need to set 213 | up the sources at least 214 | 215 | #+BEGIN_SRC emacs-lisp 216 | (require 'package) 217 | (package-initialize) 218 | 219 | (add-to-list 'package-archives 220 | '("gnu" . "https://elpa.gnu.org/packages/") t) 221 | (add-to-list 'package-archives 222 | '("melpa-stable" . "https://stable.melpa.org/packages/") t) 223 | (add-to-list 'package-archives 224 | '("melpa" . "https://melpa.org/packages/") t) 225 | #+END_SRC 226 | 227 | Let's also set up a custom file and load it before we do anything too fancy, we 228 | want to make sure to keep customize settings in their own file instead of 229 | init.el. 230 | 231 | #+BEGIN_SRC emacs-lisp 232 | (setq custom-file "~/.emacs.d/custom.el") 233 | (when (file-exists-p custom-file) 234 | (load custom-file)) 235 | #+END_SRC 236 | 237 | I define =eos/did-refresh-packages=, which is used as a signal in =install-pkgs= 238 | that we need to refresh the package archives. 239 | 240 | #+begin_src emacs-lisp 241 | (defvar eos/did-refresh-packages nil 242 | "Flag for whether packages have been refreshed yet") 243 | #+end_src 244 | 245 | =install-pkgs= is a simple elisp function that will iterate over a list, and 246 | install each package in it, if it is not installed. If 247 | =eos/did-refresh-packages= is set to =nil=, it'll also refresh the package 248 | manager. 249 | 250 | #+begin_src emacs-lisp 251 | (defun install-pkgs (list) 252 | (dolist (pkg list) 253 | (progn 254 | (if (not (package-installed-p pkg)) 255 | (progn 256 | (if (not eos/did-refresh-packages) 257 | (progn (package-refresh-contents) 258 | (setq eos/did-refresh-packages t))) 259 | (package-install pkg)))))) 260 | #+end_src 261 | 262 | Pin some of the packages that go wonky if I use the bleeding edge. 263 | 264 | #+BEGIN_SRC emacs-lisp 265 | (when (boundp 'package-pinned-packages) 266 | (setq package-pinned-packages 267 | '((org-plus-contrib . "org") 268 | (cider . "melpa-stable") 269 | (ac-cider . "melpa-stable") 270 | (clojure-mode . "melpa-stable") 271 | (clojure-mode-extra-font-locking . "melpa-stable") 272 | (company-cider . "melpa-stable")))) 273 | #+END_SRC 274 | 275 | Now, install the things we need in the future for all other package 276 | installation/configuration, in particular, use-package needs to be installed 277 | because we require it everywhere else. 278 | 279 | #+BEGIN_SRC emacs-lisp 280 | (install-pkgs '(use-package diminish)) 281 | ;; Load use-package, used for loading packages everywhere else 282 | (require 'use-package nil t) 283 | ;; Set to t to debug package loading or nil to disable 284 | (setq use-package-verbose nil) 285 | ;; Set to t to always defer package loading 286 | (setq use-package-always-defer t) 287 | #+END_SRC 288 | 289 | ** =el-get= setup 290 | :PROPERTIES: 291 | :CUSTOM_ID: el-get 292 | :END: 293 | I install [[https://github.com/dimitri/el-get/][el-get]], but so far I haven't really used it for much, because 294 | everything I want is on MELPA, and I don't really mind bleeding edge, 295 | regardless, it's there if I want it. 296 | 297 | #+BEGIN_SRC emacs-lisp 298 | (add-to-list 'load-path "~/.emacs.d/el-get/el-get") 299 | 300 | (unless (require 'el-get nil 'noerror) 301 | (with-current-buffer 302 | (url-retrieve-synchronously 303 | "https://raw.githubusercontent.com/dimitri/el-get/master/el-get-install.el") 304 | (goto-char (point-max)) 305 | (eval-print-last-sexp))) 306 | 307 | (add-to-list 'el-get-recipe-path "~/.emacs.d/el-get-user/recipes") 308 | ;;(el-get 'sync) 309 | #+END_SRC 310 | 311 | ** Module setup 312 | :PROPERTIES: 313 | :CUSTOM_ID: module-setup 314 | :END: 315 | 316 | And now, let's start things up by loading all of the modules. I'd eventually 317 | like to keep the module list in an org table and reference it here, but I'm not 318 | quite sure how that would work for tangling, so for now it's hard-coded. 319 | 320 | #+BEGIN_SRC emacs-lisp 321 | ;; Mitigate Bug#28350 (security) in Emacs 25.2 and earlier. 322 | (eval-after-load "enriched" 323 | '(defun enriched-decode-display-prop (start end &optional param) 324 | (list start end))) 325 | 326 | (defvar after-eos-hook nil 327 | "Hooks to run after all of the EOS has been loaded") 328 | 329 | (defvar emacs-start-time (current-time) 330 | "Time Emacs was started.") 331 | 332 | ;; Installed by `make install` 333 | (add-to-list 'load-path "~/.emacs.d/eos/") 334 | 335 | (defmacro try-load (module) 336 | "Try to load the given module, logging an error if unable to load" 337 | `(condition-case ex 338 | (require ,module) 339 | ('error 340 | (message "EOS: Unable to load [%s] module: %s" ,module ex)))) 341 | 342 | ;; Override projectile's default map back to C-c p before it gets loaded by 343 | ;; anything 344 | (setq projectile-keymap-prefix (kbd "C-c p")) 345 | 346 | ;; The EOS modules 347 | (try-load 'eos-core) 348 | ;; Only load one completion framework (ido/helm/vertico/ivy) 349 | ;; (try-load 'eos-ido) 350 | (try-load 'eos-helm) 351 | ;; (try-load 'eos-vertico) 352 | ;; (try-load 'eos-ivy) 353 | (try-load 'eos-appearance) 354 | (try-load 'eos-navigation) 355 | (try-load 'eos-notify) 356 | (try-load 'eos-completion) 357 | (try-load 'eos-develop) 358 | (try-load 'eos-git) 359 | (try-load 'eos-es) 360 | (try-load 'eos-org) 361 | (try-load 'eos-writing) 362 | (try-load 'eos-dired) 363 | (try-load 'eos-remote) 364 | (try-load 'eos-java) 365 | (try-load 'eos-clojure) 366 | (try-load 'eos-web) 367 | (try-load 'eos-shell) 368 | (try-load 'eos-mail) 369 | (try-load 'eos-irc) 370 | (try-load 'eos-distributed) 371 | (try-load 'eos-rss) 372 | (try-load 'eos-twitter) 373 | (try-load 'eos-leisure) 374 | (try-load 'eos-music) 375 | 376 | ;; Hooks 377 | (add-hook 'after-eos-hook 378 | (lambda () 379 | (message "The Emacs Operating System has been loaded"))) 380 | 381 | (defun eos/time-since-start () 382 | (float-time (time-subtract (current-time) 383 | emacs-start-time))) 384 | 385 | (add-hook 'after-eos-hook 386 | `(lambda () 387 | (let ((elapsed (eos/time-since-start))) 388 | (message "Loading %s...done (%.3fs)" 389 | ,load-file-name elapsed))) t) 390 | (add-hook 'after-init-hook 391 | `(lambda () 392 | (let ((elapsed (eos/time-since-start))) 393 | (message "Loading %s...done (%.3fs) [after-init]" 394 | ,load-file-name elapsed))) t) 395 | (run-hooks 'after-eos-hook) 396 | 397 | (setq initial-scratch-message ";; ╔═╗┌─┐┬─┐┌─┐┌┬┐┌─┐┬ ┬\n;; ╚═╗│ ├┬┘├─┤ │ │ ├─┤\n;; ╚═╝└─┘┴└─┴ ┴ ┴ └─┘┴ ┴\n") 398 | #+END_SRC 399 | 400 | Turn debugging back off, if there were no errors then things successfully got loaded. 401 | 402 | #+BEGIN_SRC emacs-lisp 403 | (setq debug-on-error nil) 404 | (setq debug-on-quit nil) 405 | #+END_SRC 406 | 407 | If you've checked this out so far, head back up and check out the [[#modules][Module Set]]! 408 | 409 | * License 410 | 411 | #+BEGIN_QUOTE 412 | Copyright (C) 2015-2017 Lee Hinman 413 | 414 | Permission is granted to copy, distribute and/or modify this document 415 | under the terms of the GNU Free Documentation License, Version 1.3 416 | or any later version published by the Free Software Foundation; 417 | with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. 418 | 419 | Code in this document is free software: you can redistribute it 420 | and/or modify it under the terms of the GNU General Public 421 | License as published by the Free Software Foundation, either 422 | version 3 of the License, or (at your option) any later version. 423 | 424 | This code is distributed in the hope that it will be useful, 425 | but WITHOUT ANY WARRANTY; without even the implied warranty of 426 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 427 | GNU General Public License for more details. 428 | #+END_QUOTE 429 | 430 | This document [[https://writequit.org/eos/]] (either in its [[https://writequit.org/eos/][HTML format]] or in its 431 | [[https://github.com/dakrone/eos/blob/master/eos.org][Org format]] is licensed under the GNU Free Documentation License version 1.3 or 432 | later (http://www.gnu.org/copyleft/fdl.html). 433 | 434 | The code examples and CSS stylesheets are licensed under the GNU General Public 435 | License v3 or later (http://www.gnu.org/licenses/gpl.html). 436 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Redirecting... 7 | 8 | 9 | -------------------------------------------------------------------------------- /out/README: -------------------------------------------------------------------------------- 1 | This is a directory intended for org-tangle to put files into that will be linked elsewhere 2 | -------------------------------------------------------------------------------- /out/bashrc.d/README: -------------------------------------------------------------------------------- 1 | This is a directory intended for org-tangle to put bashrc shell scripts into 2 | -------------------------------------------------------------------------------- /out/zsh.d/README: -------------------------------------------------------------------------------- 1 | This is a directory intended for org-tangle to put files into that will be linked elsewhere 2 | -------------------------------------------------------------------------------- /setupfiles/default-wide.setup: -------------------------------------------------------------------------------- 1 | # -*- mode: org; -*- 2 | 3 | #+LANGUAGE: en 4 | #+PROPERTY: header-args :results code replace :exports both :noweb yes :tangle no 5 | #+HTML_HEAD: 6 | #+HTML_HEAD: 7 | #+EXPORT_EXCLUDE_TAGS: noexport 8 | #+OPTIONS: H:4 num:nil toc:t \\n:nil ::t |:t ^:{} -:t f:t *:t 9 | #+OPTIONS: d:(HIDE) tags:not-in-toc 10 | #+TODO: MEETING 11 | #+TODO: TODO(t) | DONE(d) 12 | #+TODO: TODO(t) STARTED(s) SOMEDAY(m) INPROGRESS(i) HOLD(h) WAITING(w@/!) NEEDSREVIEW(n@/!) | DONE(d) 13 | #+TODO: TODO(t) INPROGRESS(i) | CANCELLED(c@/!) 14 | #+TAGS: export(e) noexport(n) 15 | #+STARTUP: fninline fold nodlcheck lognotestate content 16 | #+HTML_HEAD_EXTRA: 17 | -------------------------------------------------------------------------------- /setupfiles/default.setup: -------------------------------------------------------------------------------- 1 | # -*- mode: org; -*- 2 | 3 | #+LANGUAGE: en 4 | #+PROPERTY: header-args :results code replace :exports both :noweb yes :tangle no 5 | #+HTML_HEAD: 6 | #+HTML_HEAD: 7 | #+EXPORT_EXCLUDE_TAGS: noexport 8 | #+OPTIONS: H:4 num:nil toc:t \\n:nil ::t |:t ^:{} -:t f:t *:t 9 | #+OPTIONS: d:(HIDE) tags:not-in-toc 10 | #+TODO: MEETING 11 | #+TODO: TODO(t) | DONE(d) 12 | #+TODO: TODO(t) STARTED(s) SOMEDAY(m) INPROGRESS(i) HOLD(h) WAITING(w@/!) NEEDSREVIEW(n@/!) | DONE(d) 13 | #+TODO: TODO(t) INPROGRESS(i) | CANCELLED(c@/!) 14 | #+TAGS: export(e) noexport(n) 15 | #+STARTUP: fninline fold nodlcheck lognotestate content 16 | -------------------------------------------------------------------------------- /setupfiles/eos.setup: -------------------------------------------------------------------------------- 1 | # -*- mode: org; -*- 2 | 3 | #+LANGUAGE: en 4 | #+PROPERTY: header-args:emacs-lisp :tangle yes 5 | #+PROPERTY: header-args:sh :eval no 6 | #+HTML_HEAD: 7 | #+HTML_HEAD: 8 | #+EXPORT_EXCLUDE_TAGS: noexport 9 | #+OPTIONS: H:4 num:nil toc:t \n:nil ::t |:t ^:{} -:t f:t *:t 10 | #+OPTIONS: d:(HIDE) tags:not-in-toc 11 | #+STARTUP: nodlcheck lognotestate showall 12 | -------------------------------------------------------------------------------- /setupfiles/et-book/et-book-bold-line-figures/et-book-bold-line-figures.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dakrone/eos/118412d321ee84285aa27c70e90c3cddf1967975/setupfiles/et-book/et-book-bold-line-figures/et-book-bold-line-figures.eot -------------------------------------------------------------------------------- /setupfiles/et-book/et-book-bold-line-figures/et-book-bold-line-figures.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dakrone/eos/118412d321ee84285aa27c70e90c3cddf1967975/setupfiles/et-book/et-book-bold-line-figures/et-book-bold-line-figures.ttf -------------------------------------------------------------------------------- /setupfiles/et-book/et-book-bold-line-figures/et-book-bold-line-figures.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dakrone/eos/118412d321ee84285aa27c70e90c3cddf1967975/setupfiles/et-book/et-book-bold-line-figures/et-book-bold-line-figures.woff -------------------------------------------------------------------------------- /setupfiles/et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dakrone/eos/118412d321ee84285aa27c70e90c3cddf1967975/setupfiles/et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.eot -------------------------------------------------------------------------------- /setupfiles/et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dakrone/eos/118412d321ee84285aa27c70e90c3cddf1967975/setupfiles/et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.ttf -------------------------------------------------------------------------------- /setupfiles/et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dakrone/eos/118412d321ee84285aa27c70e90c3cddf1967975/setupfiles/et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.woff -------------------------------------------------------------------------------- /setupfiles/et-book/et-book-roman-line-figures/et-book-roman-line-figures.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dakrone/eos/118412d321ee84285aa27c70e90c3cddf1967975/setupfiles/et-book/et-book-roman-line-figures/et-book-roman-line-figures.eot -------------------------------------------------------------------------------- /setupfiles/et-book/et-book-roman-line-figures/et-book-roman-line-figures.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dakrone/eos/118412d321ee84285aa27c70e90c3cddf1967975/setupfiles/et-book/et-book-roman-line-figures/et-book-roman-line-figures.ttf -------------------------------------------------------------------------------- /setupfiles/et-book/et-book-roman-line-figures/et-book-roman-line-figures.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dakrone/eos/118412d321ee84285aa27c70e90c3cddf1967975/setupfiles/et-book/et-book-roman-line-figures/et-book-roman-line-figures.woff -------------------------------------------------------------------------------- /setupfiles/et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dakrone/eos/118412d321ee84285aa27c70e90c3cddf1967975/setupfiles/et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.eot -------------------------------------------------------------------------------- /setupfiles/et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dakrone/eos/118412d321ee84285aa27c70e90c3cddf1967975/setupfiles/et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.ttf -------------------------------------------------------------------------------- /setupfiles/et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dakrone/eos/118412d321ee84285aa27c70e90c3cddf1967975/setupfiles/et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.woff -------------------------------------------------------------------------------- /setupfiles/et-book/et-book-semi-bold-old-style-figures/et-book-semi-bold-old-style-figures.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dakrone/eos/118412d321ee84285aa27c70e90c3cddf1967975/setupfiles/et-book/et-book-semi-bold-old-style-figures/et-book-semi-bold-old-style-figures.eot -------------------------------------------------------------------------------- /setupfiles/et-book/et-book-semi-bold-old-style-figures/et-book-semi-bold-old-style-figures.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dakrone/eos/118412d321ee84285aa27c70e90c3cddf1967975/setupfiles/et-book/et-book-semi-bold-old-style-figures/et-book-semi-bold-old-style-figures.ttf -------------------------------------------------------------------------------- /setupfiles/et-book/et-book-semi-bold-old-style-figures/et-book-semi-bold-old-style-figures.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dakrone/eos/118412d321ee84285aa27c70e90c3cddf1967975/setupfiles/et-book/et-book-semi-bold-old-style-figures/et-book-semi-bold-old-style-figures.woff -------------------------------------------------------------------------------- /setupfiles/org-spec.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: Helvetica, Arial, sans-serif; 3 | font-size: 16px; 4 | line-height: 1.4; 5 | color: #33333f; 6 | } 7 | 8 | code { 9 | font-family: "Inconsolata", "monospace"; 10 | font-size: 16px; 11 | } 12 | 13 | p>code, li>code { 14 | background-color: #eee; 15 | padding: 0.25em; 16 | } 17 | 18 | h1, h2, h3 { 19 | font-family: "Roboto Slab", Helvetica, Arial, sans-serif; 20 | } 21 | 22 | h2 { 23 | border-bottom: 1px solid #f0c; 24 | padding-bottom: 0.5em; 25 | font-size: 1.75em; 26 | } 27 | 28 | h3 { 29 | margin-top: 2em; 30 | font-size: 1.5em; 31 | } 32 | 33 | h4 { 34 | font-size: 1.25em; 35 | } 36 | 37 | h5 { 38 | font-size: 1em; 39 | } 40 | 41 | h2 code, h3 code, h4 code, h5 code, td code { 42 | font-family: inherit !important; 43 | font-size: inherit !important; 44 | } 45 | 46 | td code { 47 | font-weight: bold; 48 | } 49 | 50 | a:link, a:hover, a:visited { 51 | text-decoration: none; 52 | color: black; 53 | } 54 | 55 | a:link { 56 | background: #ff8; 57 | } 58 | 59 | a:visited { 60 | color: #666; 61 | background: #ffc; 62 | } 63 | 64 | a:link:hover, 65 | a:visited:hover { 66 | background: #ff0; 67 | } 68 | 69 | a[href^="http"] { 70 | background: #bff; 71 | } 72 | 73 | a[href^="http"]:visited { 74 | background: #dff; 75 | } 76 | 77 | a[href^="http"]:link:hover, 78 | a[href^="http"]:visited:hover { 79 | background: #0ff; 80 | } 81 | 82 | a[href^="http"]:after { 83 | content: "\21B3"; 84 | background: white; 85 | padding-left: 0.2em; 86 | } 87 | 88 | #meta { 89 | margin-top: 2em; 90 | } 91 | 92 | #table-of-contents a:link, 93 | #table-of-contents a:visited { 94 | color: black; 95 | background: transparent; 96 | } 97 | 98 | #table-of-contents { 99 | line-height: 1.2; 100 | } 101 | #table-of-contents h2 { 102 | border-bottom: 0; 103 | } 104 | 105 | #table-of-contents ul { 106 | list-style: none; 107 | padding-left: 0.5em; 108 | font-weight: normal; 109 | } 110 | 111 | #table-of-contents div>ul>li { 112 | margin-top: 1em; 113 | font-weight: bold; 114 | } 115 | 116 | #table-of-contents .tag { 117 | display: none; 118 | } 119 | 120 | #table-of-contents .todo, 121 | #table-of-contents .done { 122 | font-size: 80%; 123 | } 124 | 125 | #table-of-contents ol>li { 126 | margin-top: 1em; 127 | } 128 | 129 | table { 130 | width: 100%; 131 | } 132 | 133 | table, th, td { 134 | border: 1px solid #666; 135 | } 136 | 137 | th, td { 138 | padding: 0.5em; 139 | text-align: left; 140 | } 141 | 142 | tbody tr:nth-child(odd) { 143 | background-color: #eee; 144 | } 145 | 146 | img { 147 | max-width: 90%; 148 | } 149 | 150 | div.notice { 151 | position: relative; 152 | margin: 0 1.2em; 153 | padding: 0.25em 1em; 154 | border-left: 4px solid; 155 | } 156 | 157 | table + div.notice { 158 | margin-top: 2em; 159 | } 160 | 161 | div.notice a { 162 | background: transparent !important; 163 | border-bottom: 1px dotted; 164 | } 165 | 166 | div.notice a[href^="http"]:after { 167 | background: transparent !important; 168 | } 169 | 170 | div.notice:before { 171 | position: absolute; 172 | top: 0; 173 | right: 0; 174 | padding: 0.25em 0.5em 0; 175 | font-size: 60%; 176 | border-bottom-left-radius: 0.5em; 177 | } 178 | 179 | .notice-warning { 180 | background: #fcc; 181 | color: #600; 182 | } 183 | 184 | .notice-example { 185 | background: #def; 186 | color: #069; 187 | } 188 | 189 | .notice-info { 190 | background: #efe; 191 | color: #060; 192 | } 193 | 194 | .notice-warning a { 195 | color: #600; 196 | } 197 | 198 | .notice-example a { 199 | color: #069; 200 | } 201 | 202 | .notice-info a { 203 | color: #060; 204 | } 205 | 206 | div.notice-warning:before { 207 | content: "WARNING"; 208 | background: #c99; 209 | color: #fcc; 210 | } 211 | 212 | div.notice-example:before { 213 | content: "EXAMPLE"; 214 | background: #abc; 215 | color: #def; 216 | } 217 | 218 | div.notice-info:before { 219 | content: "INFO"; 220 | background: #9c9; 221 | color: #efe; 222 | } 223 | 224 | /* things inside the #+BEGIN_NOTE...#+END_NOTE block */ 225 | div.NOTE a { 226 | background: transparent !important; 227 | border-bottom: 1px dotted; 228 | } 229 | 230 | div.NOTE { 231 | position: relative; 232 | margin: 0 1.2em; 233 | padding: 0.25em 1em; 234 | border-left: 4px solid; 235 | margin-top: 2em; 236 | background: #efe; 237 | color: #060; 238 | } 239 | 240 | div.NOTE:before { 241 | position: absolute; 242 | top: 0; 243 | right: 0; 244 | padding: 0.25em 0.5em 0; 245 | font-size: 60%; 246 | border-bottom-left-radius: 0.5em; 247 | content: "NOTE"; 248 | background: #9c9; 249 | color: #efe; 250 | } 251 | 252 | blockquote { 253 | padding: 0px 10px 0px 10px; 254 | border: 1px solid #ddd; 255 | background: #eee; 256 | box-shadow: 5px 5px 5px #eee; 257 | border-radius: 2px; 258 | line-height: 1.2em; 259 | } 260 | 261 | pre { 262 | font-family: "Inconsolata", "monospace"; 263 | font-size: 100%; 264 | border: 0; 265 | box-shadow: none; 266 | overflow: auto; 267 | } 268 | 269 | pre.example:before { 270 | content: "EXAMPLE"; 271 | display: block; 272 | border-bottom: 1px dotted; 273 | margin-bottom: 1em; 274 | } 275 | 276 | pre.example { 277 | background: #fec; 278 | color: #666; 279 | font-size: 0.85em; 280 | } 281 | 282 | pre { 283 | background-color: #f8f8f8; 284 | background-size: 8px 8px; 285 | background-image: linear-gradient(135deg, transparent 25%, rgba(0, 0, 0, 0.02) 25%, rgba(0, 0, 0, 0.02) 50%, transparent 50%, transparent 75%, rgba(0, 0, 0, 0.02) 75%, rgba(0, 0, 0, 0.02)); 286 | } 287 | 288 | pre.src { 289 | padding: 0.5em; 290 | } 291 | 292 | pre.src:before { 293 | display: block; 294 | position: absolute; 295 | background-color: #ccccd0; 296 | top: 0; 297 | right: 0; 298 | padding: 0.25em 0.5em; 299 | border-bottom-left-radius: 8px; 300 | border: 0; 301 | color: white; 302 | font-size: 80%; 303 | } 304 | 305 | pre.src-plantuml:before { 306 | content: "UML"; 307 | } 308 | 309 | pre.src-javascript:before { 310 | content: "JS"; 311 | } 312 | 313 | pre.src-clojure:before { 314 | content: "CLJ"; 315 | } 316 | 317 | pre.src-c:before { 318 | content: "C"; 319 | } 320 | 321 | pre.src-sh:before { 322 | content: "Shell"; 323 | } 324 | 325 | pre.src-es:before { 326 | content: "ES"; 327 | } 328 | 329 | span.org-string { 330 | color: #f94; 331 | } 332 | 333 | span.org-keyword { 334 | color: #c07; 335 | } 336 | 337 | span.org-variable-name { 338 | color: #f04; 339 | } 340 | 341 | span.org-clojure-keyword { 342 | color: #09f; 343 | } 344 | 345 | span.org-comment, span.org-comment-delimiter { 346 | color: #999; 347 | } 348 | 349 | span.org-rainbow-delimiters-depth-1, span.org-rainbow-delimiters-depth-5 { 350 | color: #666; 351 | } 352 | 353 | span.org-rainbow-delimiters-depth-2, span.org-rainbow-delimiters-depth-6 { 354 | color: #888; 355 | } 356 | 357 | span.org-rainbow-delimiters-depth-3, span.org-rainbow-delimiters-depth-7 { 358 | color: #aaa; 359 | } 360 | 361 | span.org-rainbow-delimiters-depth-4, span.org-rainbow-delimiters-depth-8 { 362 | color: #ccc; 363 | } 364 | 365 | div.figure { 366 | font-size: 0.85em; 367 | } 368 | 369 | .tag { 370 | font-family: "Roboto Slab", Helvetica, Arial, sans-serif; 371 | font-size: 11px; 372 | font-weight: normal; 373 | float: right; 374 | margin-top: 1em; 375 | background: transparent; 376 | } 377 | 378 | .tag span { 379 | background: #ccc; 380 | padding: 0 0.5em; 381 | border-radius: 0.2em; 382 | color: white; 383 | } 384 | 385 | .todo, .done { 386 | font-family: "Roboto Slab", Helvetica, Arial, sans-serif; 387 | font-weight: normal; 388 | padding: 0 0.25em; 389 | border-radius: 0.2em; 390 | } 391 | 392 | .todo { 393 | background: #f04; 394 | color: white; 395 | } 396 | 397 | .done { 398 | background: #5f7; 399 | color: white; 400 | } 401 | 402 | @media screen { 403 | h1.title { 404 | text-align: left; 405 | margin: 0.5em 0 1em 0; 406 | } 407 | 408 | h2 { 409 | margin-top: 3em; 410 | } 411 | 412 | #table-of-contents { 413 | position: fixed; 414 | top: 0; 415 | left: 0; 416 | padding: 2em 0 2em 2em; 417 | width: 290px; 418 | height: 100vh; 419 | font-size: 11px; 420 | background: #eee; 421 | overlow-x: hidden; 422 | overlow-y: auto; 423 | } 424 | 425 | #table-of-contents h2 { 426 | margin-top: 0; 427 | } 428 | 429 | #table-of-contents code { 430 | font-size: 12px; 431 | } 432 | 433 | div#content { 434 | margin-left: 320px; 435 | max-width: 1100px; 436 | } 437 | } 438 | 439 | @media screen and (max-width: 1024px) { 440 | html, body { 441 | font-size: 14px; 442 | } 443 | 444 | #table-of-contents { 445 | display: none; 446 | } 447 | 448 | h1.title { 449 | margin-left: 0%; 450 | } 451 | 452 | div#content { 453 | margin-left: 5%; 454 | max-width: 90%; 455 | } 456 | } 457 | 458 | @media print { 459 | 460 | body { 461 | color: black; 462 | } 463 | 464 | @page { 465 | margin: 25mm; 466 | } 467 | 468 | h2, h3 { 469 | page-break-before: always; 470 | margin-top: 0; 471 | } 472 | 473 | table { 474 | page-break-inside: avoid; 475 | } 476 | 477 | a:visited { 478 | color: black; 479 | background: #ff8; 480 | } 481 | 482 | a[href^="http"]:visited { 483 | background: #bff; 484 | } 485 | 486 | div.notice:before { 487 | display: none; 488 | } 489 | } 490 | -------------------------------------------------------------------------------- /setupfiles/org-spec.setup: -------------------------------------------------------------------------------- 1 | # -*- mode: org; -*- 2 | 3 | #+LANGUAGE: en 4 | #+PROPERTY: header-args :results code replace :exports both :noweb yes :tangle no 5 | #+HTML_HEAD: 6 | #+HTML_HEAD: 7 | #+EXPORT_EXCLUDE_TAGS: noexport 8 | #+OPTIONS: H:4 num:t toc:t \\n:nil @:t ::t |:t ^:{} -:t f:t *:t 9 | #+OPTIONS: skip:nil d:(HIDE) tags:not-in-toc 10 | #+TODO: MEETING 11 | #+TODO: TODO(t) | DONE(d) 12 | #+TODO: TODO(t) STARTED(s) SOMEDAY(m) INPROGRESS(i) HOLD(h) WAITING(w@/!) NEEDSREVIEW(n@/!) | DONE(d) 13 | #+TODO: TODO(t) INPROGRESS(i) | CANCELLED(c@/!) 14 | #+TAGS: export(e) noexport(n) 15 | #+STARTUP: fninline fold nodlcheck lognotestate content 16 | -------------------------------------------------------------------------------- /setupfiles/tufte.css: -------------------------------------------------------------------------------- 1 | /* Import ET Book styles 2 | adapted from https://github.com/edwardtufte/et-book/blob/gh-pages/et-book.css */ 3 | 4 | @charset "UTF-8"; 5 | 6 | @font-face { font-family: "et-book"; 7 | src: url("et-book/et-book-roman-line-figures/et-book-roman-line-figures.eot"); 8 | src: url("et-book/et-book-roman-line-figures/et-book-roman-line-figures.eot?#iefix") format("embedded-opentype"), url("et-book/et-book-roman-line-figures/et-book-roman-line-figures.woff") format("woff"), url("et-book/et-book-roman-line-figures/et-book-roman-line-figures.ttf") format("truetype"), url("et-book/et-book-roman-line-figures/et-book-roman-line-figures.svg#etbookromanosf") format("svg"); 9 | font-weight: normal; 10 | font-style: normal; } 11 | 12 | @font-face { font-family: "et-book"; 13 | src: url("et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.eot"); 14 | src: url("et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.eot?#iefix") format("embedded-opentype"), url("et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.woff") format("woff"), url("et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.ttf") format("truetype"), url("et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.svg#etbookromanosf") format("svg"); 15 | font-weight: normal; 16 | font-style: italic; } 17 | 18 | @font-face { font-family: "et-book"; 19 | src: url("et-book/et-book-bold-line-figures/et-book-bold-line-figures.eot"); 20 | src: url("et-book/et-book-bold-line-figures/et-book-bold-line-figures.eot?#iefix") format("embedded-opentype"), url("et-book/et-book-bold-line-figures/et-book-bold-line-figures.woff") format("woff"), url("et-book/et-book-bold-line-figures/et-book-bold-line-figures.ttf") format("truetype"), url("et-book/et-book-bold-line-figures/et-book-bold-line-figures.svg#etbookromanosf") format("svg"); 21 | font-weight: bold; 22 | font-style: normal; } 23 | 24 | @font-face { font-family: "et-book-roman-old-style"; 25 | src: url("et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.eot"); 26 | src: url("et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.eot?#iefix") format("embedded-opentype"), url("et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.woff") format("woff"), url("et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.ttf") format("truetype"), url("et-book/et-book-roman-old-style-figures/et-book-roman-old-style-figures.svg#etbookromanosf") format("svg"); 27 | font-weight: normal; 28 | font-style: normal; } 29 | 30 | /* Tufte CSS styles */ 31 | html { font-size: 15px; } 32 | 33 | body { width: 87.5%; 34 | margin-left: auto; 35 | margin-right: auto; 36 | padding-left: 12.5%; 37 | font-family: et-book, Palatino, "Palatino Linotype", "Palatino LT STD", "Book Antiqua", Georgia, serif; 38 | background-color: #fffff8; 39 | color: #111; 40 | max-width: 1400px; 41 | counter-reset: sidenote-counter; } 42 | 43 | h1 { font-weight: 400; 44 | margin-top: 4rem; 45 | margin-bottom: 1.5rem; 46 | font-size: 3.2rem; 47 | line-height: 1; } 48 | 49 | h2 { font-style: italic; 50 | font-weight: 400; 51 | margin-top: 2.1rem; 52 | margin-bottom: 0; 53 | font-size: 2.2rem; 54 | line-height: 1; } 55 | 56 | h3 { font-style: italic; 57 | font-weight: 400; 58 | font-size: 1.7rem; 59 | margin-top: 2rem; 60 | margin-bottom: 0; 61 | line-height: 1; } 62 | 63 | p.subtitle { font-style: italic; 64 | margin-top: 1rem; 65 | margin-bottom: 1rem; 66 | font-size: 1.8rem; 67 | display: block; 68 | line-height: 1; } 69 | 70 | .numeral { font-family: et-book-roman-old-style; } 71 | 72 | .danger { color: red; } 73 | 74 | article { position: relative; 75 | padding: 5rem 0rem; } 76 | 77 | section { padding-top: 1rem; 78 | padding-bottom: 1rem; } 79 | 80 | p, ol, ul { font-size: 1.4rem; } 81 | 82 | p { line-height: 2rem; 83 | margin-top: 1.4rem; 84 | margin-bottom: 1.4rem; 85 | padding-right: 0; 86 | vertical-align: baseline; } 87 | 88 | /* Chapter Epigraphs */ 89 | div.epigraph { margin: 5em 0; } 90 | 91 | div.epigraph > blockquote { margin-top: 3em; 92 | margin-bottom: 3em; } 93 | 94 | div.epigraph > blockquote, div.epigraph > blockquote > p { font-style: italic; } 95 | 96 | div.epigraph > blockquote > footer { font-style: normal; } 97 | 98 | div.epigraph > blockquote > footer > cite { font-style: italic; } 99 | /* end chapter epigraphs styles */ 100 | 101 | blockquote { font-size: 1.4rem; } 102 | 103 | blockquote p { width: 55%; 104 | margin-right: 40px; } 105 | 106 | blockquote footer { width: 55%; 107 | font-size: 1.1rem; 108 | text-align: right; } 109 | 110 | section>ol, section>ul { width: 45%; 111 | -webkit-padding-start: 5%; 112 | -webkit-padding-end: 5%; } 113 | 114 | li { padding: 0.5rem 0; } 115 | 116 | figure { padding: 0; 117 | border: 0; 118 | font-size: 100%; 119 | font: inherit; 120 | vertical-align: baseline; 121 | max-width: 55%; 122 | -webkit-margin-start: 0; 123 | -webkit-margin-end: 0; 124 | margin: 0 0 3em 0; } 125 | 126 | figcaption { float: right; 127 | clear: right; 128 | margin-right: -48%; 129 | margin-top: 0; 130 | margin-bottom: 0; 131 | font-size: 1.1rem; 132 | line-height: 1.6; 133 | vertical-align: baseline; 134 | position: relative; 135 | max-width: 40%; } 136 | 137 | figure.fullwidth figcaption { margin-right: 24%; } 138 | 139 | /* Links: replicate underline that clears descenders */ 140 | a:link, a:visited { color: inherit; } 141 | 142 | a:link { text-decoration: none; 143 | background: -webkit-linear-gradient(#fffff8, #fffff8), -webkit-linear-gradient(#fffff8, #fffff8), -webkit-linear-gradient(#333, #333); 144 | background: linear-gradient(#fffff8, #fffff8), linear-gradient(#fffff8, #fffff8), linear-gradient(#333, #333); 145 | -webkit-background-size: 0.05em 1px, 0.05em 1px, 1px 1px; 146 | -moz-background-size: 0.05em 1px, 0.05em 1px, 1px 1px; 147 | background-size: 0.05em 1px, 0.05em 1px, 1px 1px; 148 | background-repeat: no-repeat, no-repeat, repeat-x; 149 | text-shadow: 0.03em 0 #fffff8, -0.03em 0 #fffff8, 0 0.03em #fffff8, 0 -0.03em #fffff8, 0.06em 0 #fffff8, -0.06em 0 #fffff8, 0.09em 0 #fffff8, -0.09em 0 #fffff8, 0.12em 0 #fffff8, -0.12em 0 #fffff8, 0.15em 0 #fffff8, -0.15em 0 #fffff8; 150 | background-position: 0% 93%, 100% 93%, 0% 93%; } 151 | 152 | @media screen and (-webkit-min-device-pixel-ratio: 0) { a:link { background-position-y: 87%, 87%, 87%; } } 153 | 154 | a:link::selection { text-shadow: 0.03em 0 #b4d5fe, -0.03em 0 #b4d5fe, 0 0.03em #b4d5fe, 0 -0.03em #b4d5fe, 0.06em 0 #b4d5fe, -0.06em 0 #b4d5fe, 0.09em 0 #b4d5fe, -0.09em 0 #b4d5fe, 0.12em 0 #b4d5fe, -0.12em 0 #b4d5fe, 0.15em 0 #b4d5fe, -0.15em 0 #b4d5fe; 155 | background: #b4d5fe; } 156 | 157 | a:link::-moz-selection { text-shadow: 0.03em 0 #b4d5fe, -0.03em 0 #b4d5fe, 0 0.03em #b4d5fe, 0 -0.03em #b4d5fe, 0.06em 0 #b4d5fe, -0.06em 0 #b4d5fe, 0.09em 0 #b4d5fe, -0.09em 0 #b4d5fe, 0.12em 0 #b4d5fe, -0.12em 0 #b4d5fe, 0.15em 0 #b4d5fe, -0.15em 0 #b4d5fe; 158 | background: #b4d5fe; } 159 | 160 | /* Sidenotes, margin notes, figures, captions */ 161 | img { max-width: 100%; } 162 | 163 | .sidenote, .marginnote { float: right; 164 | clear: right; 165 | margin-right: -60%; 166 | width: 50%; 167 | margin-top: 0; 168 | margin-bottom: 0; 169 | font-size: 1.1rem; 170 | line-height: 1.3; 171 | vertical-align: baseline; 172 | position: relative; } 173 | 174 | .sidenote-number { counter-increment: sidenote-counter; } 175 | 176 | .sidenote-number:after, .sidenote:before { content: counter(sidenote-counter) " "; 177 | font-family: et-book-roman-old-style; 178 | position: relative; 179 | vertical-align: baseline; } 180 | 181 | .sidenote-number:after { content: counter(sidenote-counter); 182 | font-size: 1rem; 183 | top: -0.5rem; 184 | left: 0.1rem; } 185 | 186 | .sidenote:before { content: counter(sidenote-counter) " "; 187 | top: -0.5rem; } 188 | 189 | blockquote .sidenote, blockquote .marginnote { margin-right: -82%; 190 | min-width: 59%; 191 | text-align: left; } 192 | 193 | p, footer, table { width: 55%; } 194 | 195 | div.fullwidth, table.fullwidth { width: 100%; } 196 | 197 | div.table-wrapper { overflow-x: auto; 198 | font-family: "Trebuchet MS", "Gill Sans", "Gill Sans MT", sans-serif; } 199 | 200 | .sans { font-family: "Gill Sans", "Gill Sans MT", Calibri, sans-serif; 201 | letter-spacing: .03em; } 202 | 203 | code { font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; 204 | font-size: 1.0rem; 205 | line-height: 1.42; } 206 | 207 | .sans > code { font-size: 1.2rem; } 208 | 209 | h1 > code, h2 > code, h3 > code { font-size: 0.80em; } 210 | 211 | .marginnote > code, .sidenote > code { font-size: 1rem; } 212 | 213 | pre.code { font-size: 0.9rem; 214 | width: 52.5%; 215 | margin-left: 2.5%; 216 | overflow-x: auto; } 217 | 218 | pre.code.fullwidth { width: 90%; } 219 | 220 | .fullwidth { max-width: 90%; 221 | clear:both; } 222 | 223 | span.newthought { font-variant: small-caps; 224 | font-size: 1.2em; } 225 | 226 | input.margin-toggle { display: none; } 227 | 228 | label.sidenote-number { display: inline; } 229 | 230 | label.margin-toggle:not(.sidenote-number) { display: none; } 231 | 232 | @media (max-width: 760px) { body { width: 84%; 233 | padding-left: 8%; 234 | padding-right: 8%; } 235 | p, footer { width: 100%; } 236 | pre.code { width: 97%; } 237 | ul { width: 85%; } 238 | figure { max-width: 90%; } 239 | figcaption, figure.fullwidth figcaption { margin-right: 0%; 240 | max-width: none; } 241 | blockquote { margin-left: 1.5em; 242 | margin-right: 0em; } 243 | blockquote p, blockquote footer { width: 100%; } 244 | label.margin-toggle:not(.sidenote-number) { display: inline; } 245 | .sidenote, .marginnote { display: none; } 246 | .margin-toggle:checked + .sidenote, 247 | .margin-toggle:checked + .marginnote { display: block; 248 | float: left; 249 | left: 1rem; 250 | clear: both; 251 | width: 95%; 252 | margin: 1rem 2.5%; 253 | vertical-align: baseline; 254 | position: relative; } 255 | label { cursor: pointer; } 256 | div.table-wrapper, table { width: 85%; } 257 | img { width: 100%; } } -------------------------------------------------------------------------------- /setupfiles/tufte.setup: -------------------------------------------------------------------------------- 1 | # -*- mode: org; -*- 2 | 3 | #+LANGUAGE: en 4 | #+PROPERTY: header-args :results code replace :exports both :noweb yes :tangle no 5 | #+HTML_HEAD: 6 | #+HTML_HEAD: 7 | #+EXPORT_EXCLUDE_TAGS: noexport 8 | #+OPTIONS: H:4 num:nil toc:t \\n:nil ::t |:t ^:{} -:t f:t *:t 9 | #+OPTIONS: d:(HIDE) tags:not-in-toc 10 | #+TODO: MEETING 11 | #+TODO: TODO(t) | DONE(d) 12 | #+TODO: TODO(t) STARTED(s) SOMEDAY(m) INPROGRESS(i) HOLD(h) WAITING(w@/!) NEEDSREVIEW(n@/!) | DONE(d) 13 | #+TODO: TODO(t) INPROGRESS(i) | CANCELLED(c@/!) 14 | #+TAGS: export(e) noexport(n) 15 | #+STARTUP: fninline fold nodlcheck lognotestate content 16 | -------------------------------------------------------------------------------- /setupfiles/vertical.setup: -------------------------------------------------------------------------------- 1 | # -*- mode: org; -*- 2 | 3 | #+LANGUAGE: en 4 | #+PROPERTY: header-args :results code replace :exports both :noweb yes :tangle yes 5 | #+HTML_HEAD: 6 | #+HTML_HEAD: 7 | #+EXPORT_EXCLUDE_TAGS: noexport 8 | #+OPTIONS: H:4 num:t toc:t \\n:nil ::t |:t ^:{} -:t f:t *:t 9 | #+OPTIONS: d:(HIDE) tags:not-in-toc 10 | #+TODO: MEETING 11 | #+TODO: TODO(t) | DONE(d) 12 | #+TODO: TODO(t) STARTED(s) SOMEDAY(m) INPROGRESS(i) HOLD(h) WAITING(w@/!) NEEDSREVIEW(n@/!) | DONE(d) 13 | #+TODO: TODO(t) INPROGRESS(i) | CANCELLED(c@/!) 14 | #+STARTUP: fold nodlcheck lognotestate content 15 | -------------------------------------------------------------------------------- /sh/README: -------------------------------------------------------------------------------- 1 | This is a directory intended for org-tangle to put shell scripts into 2 | -------------------------------------------------------------------------------- /site-lisp/bookmark+/bookmark+.el: -------------------------------------------------------------------------------- 1 | ;;; bookmark+.el --- Bookmark+: extensions to standard library `bookmark.el'. 2 | ;; 3 | ;; Filename: bookmark+.el 4 | ;; Description: Bookmark+: extensions to standard library `bookmark.el'. 5 | ;; Author: Drew Adams, Thierry Volpiatto 6 | ;; Maintainer: Drew Adams (concat "drew.adams" "@" "oracle" ".com") 7 | ;; Copyright (C) 2000-2018, Drew Adams, all rights reserved. 8 | ;; Copyright (C) 2009, Thierry Volpiatto, all rights reserved. 9 | ;; Created: Fri Sep 15 07:58:41 2000 10 | ;; Version: 2017.03.31 11 | ;; Last-Updated: Mon Jan 1 10:01:05 2018 (-0800) 12 | ;; By: dradams 13 | ;; Update #: 15042 14 | ;; URL: https://www.emacswiki.org/emacs/download/bookmark%2b.el 15 | ;; Doc URL: https://www.emacswiki.org/emacs/BookmarkPlus 16 | ;; Keywords: bookmarks, bookmark+, projects, placeholders, annotations, search, info, url, eww, w3m, gnus 17 | ;; Compatibility: GNU Emacs: 20.x, 21.x, 22.x, 23.x, 24.x, 25.x, 26.x 18 | ;; 19 | ;; Features that might be required by this library: 20 | ;; 21 | ;; `apropos', `apropos+', `avoid', `bookmark', `bookmark+-1', 22 | ;; `bookmark+-bmu', `bookmark+-key', `bookmark+-lit', `ffap', 23 | ;; `fit-frame', `frame-fns', `help+20', `info', `info+20', 24 | ;; `kmacro', `menu-bar', `menu-bar+', `misc-cmds', `misc-fns', 25 | ;; `naked', `pp', `pp+', `second-sel', `strings', `thingatpt', 26 | ;; `thingatpt+', `unaccent', `w32browser-dlgopen', `wid-edit', 27 | ;; `wid-edit+', `widget'. 28 | ;; 29 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 30 | ;; 31 | ;;; Commentary: 32 | ;; 33 | ;; Bookmark+: extensions to standard library `bookmark.el'. 34 | ;; 35 | ;; The Bookmark+ libraries are these: 36 | ;; 37 | ;; `bookmark+.el' - main (driver) library (this file) 38 | ;; `bookmark+-mac.el' - Lisp macros 39 | ;; `bookmark+-lit.el' - (optional) code for highlighting bookmarks 40 | ;; `bookmark+-bmu.el' - code for the `*Bookmark List*' (bmenu) 41 | ;; `bookmark+-1.el' - other required code (non-bmenu) 42 | ;; `bookmark+-key.el' - key and menu bindings 43 | ;; 44 | ;; `bookmark+-doc.el' - documentation (comment-only file) 45 | ;; `bookmark+-chg.el' - change log (comment-only file) 46 | ;; 47 | ;; The documentation (in `bookmark+-doc.el') includes how to 48 | ;; byte-compile and install Bookmark+. The documentation is also 49 | ;; available in these ways: 50 | ;; 51 | ;; 1. From the bookmark list (`C-x r l'): 52 | ;; Use `?' to show the current bookmark-list status and general 53 | ;; help, then click link `Doc in Commentary' or link `Doc on the 54 | ;; Web'. 55 | ;; 56 | ;; 2. From the Emacs-Wiki Web site: 57 | ;; https://www.emacswiki.org/emacs/BookmarkPlus. 58 | ;; 59 | ;; 3. From the Bookmark+ group customization buffer: 60 | ;; `M-x customize-group bookmark-plus', then click link 61 | ;; `Commentary'. 62 | ;; 63 | ;; (The commentary links in #1 and #3 work only if you have library 64 | ;; `bookmark+-doc.el' in your `load-path'.) 65 | ;; 66 | ;; To report Bookmark+ bugs: `M-x customize-group bookmark-plus' 67 | ;; and then follow (e.g. click) the link `Send Bug Report', which 68 | ;; helps you prepare an email to me. 69 | ;; 70 | ;; 71 | ;; ****** NOTE ****** 72 | ;; 73 | ;; Whenever you update Bookmark+ (i.e., download new versions of 74 | ;; Bookmark+ source files), I recommend that you do the 75 | ;; following: 76 | ;; 77 | ;; 1. Delete all existing byte-compiled Bookmark+ files 78 | ;; (bookmark+*.elc). 79 | ;; 2. Load Bookmark+ (`load-library' or `require'). 80 | ;; 3. Byte-compile the source files. 81 | ;; 82 | ;; In particular, always load `bookmark+-mac.el' (not 83 | ;; `bookmark+-mac.elc') before you byte-compile new versions of 84 | ;; the files, in case there have been any changes to Lisp macros 85 | ;; (in `bookmark+-mac.el'). 86 | ;; 87 | ;; ****************** 88 | ;; 89 | ;; 90 | ;; ****** NOTE ****** 91 | ;; 92 | ;; On 2010-06-18, I changed the prefix used by package Bookmark+ 93 | ;; from `bookmarkp-' to `bmkp-'. THIS IS AN INCOMPATIBLE CHANGE. 94 | ;; I apologize for the inconvenience, but the new prefix is 95 | ;; preferable for a number of reasons, including easier 96 | ;; distinction from standard `bookmark.el' names. 97 | ;; 98 | ;; This change means that YOU MUST MANUALLY REPLACE ALL 99 | ;; OCCURRENCES of `bookmarkp-' by `bmkp-' in the following 100 | ;; places, if you used Bookmark+ prior to this change: 101 | ;; 102 | ;; 1. In your init file (`~/.emacs') or your `custom-file', if 103 | ;; you have one. This is needed if you customized any 104 | ;; Bookmark+ features. 105 | ;; 106 | ;; 2. In your default bookmark file, `bookmark-default-file' 107 | ;; (`~/.emacs.bmk'), and in any other bookmark files you might 108 | ;; have. 109 | ;; 110 | ;; 3. In your `*Bookmark List*' state file, 111 | ;; `bmkp-bmenu-state-file' (`~/.emacs-bmk-bmenu-state.el'). 112 | ;; 113 | ;; 4. In your `*Bookmark List*' commands file, 114 | ;; `bmkp-bmenu-commands-file' (`~/.emacs-bmk-bmenu-commands.el'), 115 | ;; if you have one. 116 | ;; 117 | ;; You can do this editing in a virgin Emacs session (`emacs 118 | ;; -Q'), that is, without loading Bookmark+. 119 | ;; 120 | ;; Alternatively, you can do this editing in an Emacs session 121 | ;; where Bookmark+ has been loaded, but in that case you must 122 | ;; TURN OFF AUTOMATIC SAVING of both your default bookmark file 123 | ;; and your `*Bookmark List*' state file. Otherwise, when you 124 | ;; quit Emacs your manually edits will be overwritten. 125 | ;; 126 | ;; To turn off this automatic saving, you can use `M-~' and `M-l' 127 | ;; in buffer `*Bookmark List*' (commands 128 | ;; `bmkp-toggle-saving-bookmark-file' and 129 | ;; `bmkp-toggle-saving-menu-list-state' - they are also in the 130 | ;; `Bookmark+' menu). 131 | ;; 132 | ;; 133 | ;; Again, sorry for this inconvenience. 134 | ;; 135 | ;; ****************** 136 | ;; 137 | ;; 138 | ;; Commands defined here: 139 | ;; 140 | ;; `bmkp-version'. 141 | ;; 142 | ;; Internal variables defined here: 143 | ;; 144 | ;; `bmkp-version-number'. 145 | ;; 146 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 147 | ;; 148 | ;; This program is free software; you can redistribute it and/or modify 149 | ;; it under the terms of the GNU General Public License as published by 150 | ;; the Free Software Foundation; either version 3, or (at your option) 151 | ;; any later version. 152 | ;; 153 | ;; This program is distributed in the hope that it will be useful, 154 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 155 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 156 | ;; GNU General Public License for more details. 157 | ;; 158 | ;; You should have received a copy of the GNU General Public License 159 | ;; along with this program; see the file COPYING. If not, write to 160 | ;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth 161 | ;; Floor, Boston, MA 02110-1301, USA. 162 | ;; 163 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 164 | 165 | ;;; Code: 166 | 167 | ;;;;;;;;;;;;;;;;;;;;;;; 168 | 169 | (require 'bookmark) ; Vanilla Emacs. 170 | 171 | ;;;###autoload (autoload 'bmkp-version-number "bookmark+") 172 | (defconst bmkp-version-number "2017.10.14") 173 | 174 | ;;;###autoload (autoload 'bmkp-version "bookmark+") 175 | (defun bmkp-version () 176 | "Show version number of library `bookmark+.el'." 177 | (interactive) 178 | (message "Bookmark+, version %s" bmkp-version-number)) 179 | 180 | 181 | ;; Load Bookmark+ libraries. 182 | ;; 183 | (eval-when-compile 184 | (or (condition-case nil 185 | (load-library "bookmark+-mac") ; Lisp macros. 186 | (error nil)) ; Use load-library to ensure latest .elc. 187 | (require 'bookmark+-mac))) ; Require, so can load separately if not on `load-path'. 188 | 189 | (require 'bookmark+-lit nil t) ; Optional (soft require) - no error if not found. If you do 190 | ; not want to use `bookmark+-lit.el' then simply do not put 191 | ; that file in your `load-path'. 192 | (require 'bookmark+-bmu) ; `*Bookmark List*' (aka "menu list") stuff. 193 | (require 'bookmark+-1) ; Rest of Bookmark+, except keys & menus. 194 | (require 'bookmark+-key) ; Keys & menus. 195 | 196 | ;;;;;;;;;;;;;;;;;;;;;;; 197 | 198 | (provide 'bookmark+) 199 | 200 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 201 | ;;; bookmark+.el ends here 202 | -------------------------------------------------------------------------------- /site-lisp/bookmark+/bookmark-add.el: -------------------------------------------------------------------------------- 1 | ;;; bookmark-add.el --- creates the buffer for work with bookmarks 2 | ;; 3 | ;; $Id$ 4 | ;; 5 | ;; Time-stamp: <28-10-2004 00:25:00> 6 | ;; 7 | ;; Copyright (C) 2004 Eugene V. Markov 8 | 9 | ;; Author: Eugene V. Markov 10 | ;; Version: $Revision$ 11 | ;; Keywords: bookmarks, placeholders, annotations 12 | 13 | ;; This program is free software; you can redistribute it and/or modify 14 | ;; it under the terms of the GNU General Public License as published by 15 | ;; the Free Software Foundation; either version 2, or (at your option) 16 | ;; any later version. 17 | 18 | ;; This program is distributed in the hope that it will be useful, 19 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | ;; GNU General Public License for more details. 22 | 23 | ;; You should have received a copy of the GNU General Public License 24 | ;; along with this program; see the file COPYING. If not, write to the 25 | ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, 26 | ;; Boston, MA 02111-1307, USA. 27 | 28 | ;;; Commentary: 29 | 30 | ;; `bookmark-open-in-symply-buffer' will generate buffer named 31 | ;; *Bookmark list*, which shows bookmarks from .emacs.bmk. 32 | ;; It has possibilities for deleting bookmarks from list, 33 | ;; saveing bookmarks list to file and loading bookmarks list 34 | ;; from file. 35 | ;; 36 | ;; Install. 37 | ;; 38 | ;; (load "bookmark-add") 39 | ;; (global-set-key [?\C-c ?b ?l] 'bookmark-open-in-simply-buffer) 40 | ;; (global-set-key [?\C-c ?b ?m] 'bookmark-set-add) 41 | ;; (global-set-key [?\C-.] 'bookmark-jump-next-cyclic) 42 | ;; (global-set-key [?\C-,] 'bookmark-jump-prev-cyclic) 43 | ;; (global-set-key [?\C-'] 'bookmark-jump-backwards) 44 | ;; 45 | ;; More commentary: 46 | ;; 47 | ;; `bookmark-open-in-simply-buffer' - switch to buffer named 48 | ;; *Bookmark list*. If to hit key Enter on bookmark region will 49 | ;; pass on a corresponding file. If to hit key Delete (or Ctrl-d) on 50 | ;; bookmark region remove this bookmark from bookmarks list. 51 | ;; If to hit key 'q' the buffer will be closed. 52 | ;; `bookmark-set-add' - add this bookmark to bookmarks list. 53 | ;; To use history, it is necessary to press buttons Up and Down. 54 | ;; The first pressing Up inserts expression which is near to a point. 55 | ;; `bookmark-jump-next-cyclic' - cyclic moving on bookmarks forward. 56 | ;; `bookmark-jump-prev-cyclic' - cyclic moving on bookmarks backward. 57 | ;; `bookmark-jump-backwards' - will move to last cursor position right 58 | ;; after uses of commands `bookmark-jump-next-cyclic' and 59 | ;; `bookmark-jump-prev-cyclic'. 60 | 61 | (require 'bookmark) 62 | (require 'wid-edit) 63 | 64 | (defvar bookmark-add-version "$Revision$" 65 | "The version of bookmark-add currently loaded") 66 | 67 | (defgroup bookmark-add nil 68 | "Setting, annotation and jumping to bookmarks." 69 | :group 'bookmark) 70 | 71 | (defcustom bookmark-add-default-file-name 72 | ".emacs.bmk" 73 | "" 74 | :type 'file 75 | :group 'bookmark-add) 76 | 77 | 78 | (defface bookmark-simply-buffer-face 79 | '((t (:background "light grey" :foreground "red" :bold t))) 80 | "" 81 | :group 'bookmark-add) 82 | 83 | (defvar evm-current-bookmark-path nil 84 | "Path to current bookmark file." 85 | ) 86 | 87 | 88 | (defun bookmark-open-in-simply-buffer () 89 | "Allow to open bookmark list in simply buffer." 90 | (interactive) 91 | (if (bookmark-alist-exists-p) 92 | (if (and (get-buffer "*Bookmark list*") 93 | (get-buffer-window (get-buffer "*Bookmark list*"))) 94 | (select-window (get-buffer-window (get-buffer "*Bookmark list*"))) 95 | (setq bookmark-windows-configure (current-window-configuration)) 96 | (split-window-vertically) 97 | (other-window 1) 98 | (with-current-buffer (get-buffer-create "*Bookmark list*") 99 | (switch-to-buffer (current-buffer)) 100 | (kill-all-local-variables) 101 | (setq truncate-lines t) 102 | (let ((inhibit-read-only t)) 103 | (erase-buffer)) 104 | (let ((all (overlay-lists))) 105 | ;; Delete all the overlays. 106 | (mapcar 'delete-overlay (car all)) 107 | (mapcar 'delete-overlay (cdr all))) 108 | ;; Insert the dialog header 109 | (widget-insert "Click on a text to open it or on Cancel to quit.\n\n") 110 | ;; Insert the list of texts as buttons 111 | (setq bookmark-max-fnl (let ((l bookmark-alist )(nl 0)(str)) 112 | (while 113 | (setq str (cdr (assoc 'front-context-string 114 | (cadr (car l))))) 115 | (if (> (length str) nl) 116 | (setq nl (length str))) 117 | (setq l (cdr l)) 118 | ) 119 | (symbol-value 'nl))) 120 | (setq bookmark-max-fnl (+ bookmark-max-fnl 2)) 121 | (mapcar '(lambda (menu-element) 122 | (let ((menu-item1 (cdr (assoc 'front-context-string (cadr menu-element)))) 123 | (menu-item2 (cdr (assoc 'rear-context-string (cadr menu-element)))) 124 | (file-path (copy-sequence 125 | (cdr (assoc 'filename (cadr menu-element))))) 126 | (name (copy-sequence (car menu-element))) 127 | bp ep ovl) 128 | (setq bp (point)) 129 | (widget-insert " Bookmark ") 130 | (let (bp ep ovl) 131 | (setq bp (point)) 132 | (widget-insert name) 133 | (setq ep (point)) 134 | (setq ovl (make-overlay bp ep)) 135 | (overlay-put ovl 'face font-lock-function-name-face)) 136 | (widget-insert " from file\n") 137 | (widget-insert " ") 138 | (let (bp ep ovl) 139 | (setq bp (point)) 140 | (widget-insert file-path) 141 | (setq ep (point)) 142 | (setq ovl (make-overlay bp ep)) 143 | (overlay-put ovl 'face font-lock-keyword-face)) 144 | (widget-insert "\n") 145 | (widget-create 'push-button 146 | :button-face 'bookmark-simply-buffer-face 147 | :tag (concat " " menu-item2 menu-item1 "\n") 148 | :help-echo (concat "Open bookmark " name) 149 | :format "%[%t%]" 150 | :notify 'bookmark-open-in-simply-buffer-action 151 | menu-element) 152 | (widget-insert "\n") 153 | (setq ep (point)) 154 | (setq ovl (make-overlay bp ep)) 155 | (overlay-put ovl 'bookmark-add-item-region t) 156 | )) 157 | bookmark-alist) 158 | (widget-insert "\n") 159 | ;; Insert the Cancel button 160 | (widget-create 'push-button 161 | :notify 'bookmark-open-in-simply-buffer-cancel 162 | :help-echo "Quit from this buffer." 163 | "Cancel") 164 | (widget-insert " ") 165 | ;; Insert the Save button 166 | (widget-create 'push-button 167 | :notify 'bookmark-save-wrapper 168 | :help-echo "Save bookmark list to file." 169 | "Save") 170 | (widget-insert " ") 171 | ;; Insert the Load button 172 | (widget-create 'push-button 173 | :notify 'bookmark-load-wrapper 174 | :help-echo "Load bookmark list from file." 175 | "Load") 176 | (widget-insert " ") 177 | ;; Insert the Bookmark path button 178 | (widget-create 'push-button 179 | :notify 'evm-bookmark-path-to-current 180 | :help-echo "Path to bookmark file." 181 | "Bookmark path") 182 | (let ((map (copy-keymap widget-keymap))) 183 | ; (define-key map [up] 'widget-backward) 184 | ; (define-key map [down] 'widget-forward) 185 | (define-key map [delete] 'bookmark-delete-wrapper) 186 | (define-key map [?\C-d] 'bookmark-delete-wrapper) 187 | (define-key map [?q] 'bookmark-open-in-simply-buffer-cancel) 188 | (define-key map "\e\e" 'bookmark-open-in-simply-buffer-cancel) 189 | (use-local-map map)) 190 | (widget-setup) 191 | (goto-char (point-min)))))) 192 | 193 | 194 | (defun bookmark-delete-wrapper () 195 | (interactive) 196 | (let ((ovls (overlays-at (point))) 197 | (inhibit-read-only t)) 198 | (while ovls 199 | (if (and (overlay-get (car ovls) 'bookmark-add-item-region) 200 | (widget-tabable-at)) 201 | (progn 202 | (bookmark-delete (car (widget-value (widget-tabable-at)))) 203 | (delete-region (overlay-start (car ovls)) 204 | (overlay-end (car ovls))) 205 | (setq ovls nil))) 206 | (setq ovls (cdr ovls))))) 207 | 208 | 209 | (defun evm-bookmark-path-to-current (&rest ignore) 210 | (interactive) 211 | (message "%s" evm-current-bookmark-path)) 212 | 213 | 214 | (defun bookmark-open-in-simply-buffer-action (widget &rest ignore) 215 | (kill-buffer (current-buffer)) 216 | (set-window-configuration bookmark-windows-configure) 217 | (bookmark-delete (car (widget-value widget))) 218 | (setq bookmark-alist (cons (widget-value widget) bookmark-alist)) 219 | (bookmark-jump (car (widget-value widget))) 220 | ) 221 | 222 | (defun bookmark-open-in-simply-buffer-cancel (&rest ignore) 223 | (interactive) 224 | (kill-buffer (current-buffer)) 225 | (set-window-configuration bookmark-windows-configure) 226 | (message "Command canceled.")) 227 | 228 | 229 | (defun bookmark-alist-exists-p () 230 | ;; это для загрузки с проверкой, а не для проверки. 231 | (if (and (boundp 'bookmark-alist) 232 | (not evm-current-bookmark-path)) 233 | (if (and (boundp 'desktop-dirname) 234 | desktop-dirname 235 | (file-exists-p (concat desktop-dirname ".emacs.bmk"))) 236 | (progn 237 | (bookmark-load (concat desktop-dirname ".emacs.bmk") t) 238 | (setq evm-current-bookmark-path 239 | (concat desktop-dirname ".emacs.bmk")) 240 | t) 241 | (if (file-exists-p (expand-file-name "~/.emacs.bmk")) 242 | (progn 243 | (bookmark-load (expand-file-name "~/.emacs.bmk") t) 244 | (setq evm-current-bookmark-path 245 | (expand-file-name "~/.emacs.bmk")) 246 | t) 247 | nil)) 248 | t)) 249 | 250 | 251 | (defun bookmark-set-add () 252 | (interactive) 253 | (if (bookmark-alist-exists-p) 254 | (let ((l bookmark-alist) (s) (sxp)) 255 | (while l 256 | (setq s (nconc s (list (caar l)))) 257 | (setq l (cdr l))) 258 | (setq l minibuffer-history) 259 | (if (setq sxp (thing-at-point 'sexp)) 260 | (setq s (nconc (list sxp) s))) 261 | (setq minibuffer-history s) 262 | (unwind-protect 263 | (bookmark-set) 264 | (setq minibuffer-history l)) 265 | ))) 266 | 267 | (defun bookmark-jump-next-cyclic() 268 | (interactive) 269 | (if (bookmark-alist-exists-p) 270 | (let* ((keys (recent-keys)) 271 | (len (length keys)) 272 | (key1 (if (> len 0) (elt keys (- len 1)) nil)) 273 | (key2 (if (> len 1) (elt keys (- len 2)) nil)) 274 | n) 275 | (if (eq key1 key2) 276 | (progn 277 | (setq n (length bookmark-alist)) 278 | (nconc bookmark-alist bookmark-alist) 279 | (setq bookmark-alist (cdr bookmark-alist)) 280 | (setcdr (nthcdr (- n 1) bookmark-alist) nil) 281 | (bookmark-jump (car (car bookmark-alist))) 282 | ) 283 | (progn 284 | (if (not (equal key2 285 | (elt (car (where-is-internal 'bookmark-jump-prev-cyclic)) 0))) 286 | (progn 287 | (setq bookmark-windows-configure 288 | (cons (current-window-configuration) (point))))) 289 | (bookmark-jump (car (car bookmark-alist)))))))) 290 | 291 | 292 | (defun bookmark-jump-prev-cyclic() 293 | (interactive) 294 | (if (bookmark-alist-exists-p) 295 | (let* ((keys (recent-keys)) 296 | (len (length keys)) 297 | (key1 (if (> len 0) (elt keys (- len 1)) nil)) 298 | (key2 (if (> len 1) (elt keys (- len 2)) nil)) 299 | n) 300 | (if (eq key1 key2) 301 | (progn 302 | (setq n (length bookmark-alist)) 303 | (setq bookmark-alist (reverse bookmark-alist)) 304 | (nconc bookmark-alist bookmark-alist) 305 | (setq bookmark-alist (cdr bookmark-alist)) 306 | (setcdr (nthcdr (- n 1) bookmark-alist) nil) 307 | (bookmark-jump (car (car bookmark-alist))) 308 | (setq bookmark-alist (reverse bookmark-alist)) 309 | ) 310 | (progn 311 | (if (not (equal key2 312 | (elt (car (where-is-internal 'bookmark-jump-next-cyclic)) 0))) 313 | (progn 314 | (setq bookmark-windows-configure 315 | (cons (current-window-configuration) (point))))) 316 | (bookmark-jump (car (car (reverse bookmark-alist))))))))) 317 | 318 | 319 | (defun bookmark-jump-backwards() 320 | (interactive) 321 | (let* ((keys (recent-keys)) 322 | (key (if (> (length keys) 1) (elt keys (- (length keys) 2)) nil))) 323 | (if (or (eq key 324 | (elt (car (where-is-internal 'bookmark-jump-prev-cyclic)) 0)) 325 | (eq key 326 | (elt (car (where-is-internal 'bookmark-jump-next-cyclic)) 0))) 327 | (progn 328 | (set-window-configuration (car bookmark-windows-configure)) 329 | (goto-char (cdr bookmark-windows-configure)))))) 330 | 331 | 332 | (defadvice bookmark-jump (after bookmark-jump-folding-mode activate) 333 | (if (and (boundp 'folding-mode) folding-mode) 334 | (progn 335 | (let ((p (point))) 336 | (folding-show-current-entry nil t) 337 | (goto-char p))))) 338 | 339 | 340 | 341 | (defun bookmark-save-wrapper (&rest ignore) 342 | "" 343 | (interactive) 344 | (cond 345 | ((featurep 'evm-dired-ch) 346 | (evm-pcompleting-minibuffer-file-dired 347 | "Path to bookmarks file (Save): " 348 | 'bookmark-save-wrapper-fn 349 | evm-current-bookmark-path)) 350 | ((featurep 'evm-pcomplete) 351 | (bookmark-save-wrapper-fn 352 | (evm-pcompleting-minibuffer-dir "Path to bookmarks file (Save): " 353 | evm-current-bookmark-path))) 354 | (t 355 | (bookmark-add-default-file-name 356 | (file (read-file-name "Path to bookmarks file (Save): " 357 | evm-current-bookmark-path nil nil 358 | )))))) 359 | 360 | 361 | (defun bookmark-save-wrapper-fn (path) 362 | "" 363 | (when (listp path) 364 | (setq path (car path))) 365 | ;; 366 | (if (and path (not (= (length path) 0))) 367 | (progn 368 | (setq path (expand-file-name path)) 369 | (bookmark-save nil path)))) 370 | 371 | 372 | (defun bookmark-load-wrapper (&rest ignore) 373 | "" 374 | (interactive) 375 | (cond 376 | ((featurep 'evm-dired-ch) 377 | (evm-pcompleting-minibuffer-file-dired* 378 | "Path to bookmarks file (Load): " 379 | 'bookmark-load-wrapper-fn 380 | evm-current-bookmark-path)) 381 | ((featurep 'evm-pcomplete) 382 | (bookmark-load-wrapper-fn 383 | (evm-pcompleting-minibuffer-dir "Path to bookmarks file (Load): " 384 | evm-current-bookmark-path))) 385 | (t 386 | (bookmark-add-default-file-name 387 | (file (read-file-name "Path to bookmarks file (Load): " 388 | evm-current-bookmark-path nil nil 389 | )))))) 390 | 391 | 392 | (defun bookmark-load-wrapper-fn (path) 393 | "" 394 | (when (listp path) 395 | (setq path (car path))) 396 | ;; 397 | (if (and path (not (= (length path) 0))) 398 | (progn 399 | (setq path (expand-file-name path)) 400 | (bookmark-load path t) 401 | (setq evm-bookmark-path-to-current path) 402 | (kill-buffer (current-buffer)) 403 | (set-window-configuration bookmark-windows-configure) 404 | (bookmark-open-in-simply-buffer)))) 405 | 406 | 407 | (provide 'bookmark-add) 408 | 409 | ;;; bookmark-add.el ends here. 410 | -------------------------------------------------------------------------------- /site-lisp/bookmark+/bookmark-iterator.el: -------------------------------------------------------------------------------- 1 | ;;; bookmark-iterator.el --- iterate through tags - similar to DevStudio 2 | ;; Author: Patrick Anderson 3 | ;; Version: 1 4 | ;; This is free software 5 | ;; License: GPL 6 | 7 | ;install: 8 | ;this file in your load path 9 | 10 | ;add 11 | ; (require 'etags-iterator) 12 | ;to your .emacs file 13 | 14 | ;execute 15 | ; M-x eval-buffer 16 | ;so you don't have to restart 17 | 18 | ;todo: 19 | ;interface/parse with Micropoly's .bsc format 20 | 21 | (defun etags () 22 | "shell out etags.exe" 23 | (interactive) 24 | (shell-command "etags *") 25 | (require 'etags) 26 | (tags-reset-tags-tables)) 27 | 28 | (defun find-tag-current-word() 29 | "find the tag for the word currently under the cursor. 30 | if none is found, call etags" 31 | (interactive) 32 | (find-tag (current-word))) 33 | 34 | 35 | (define-key global-map [(control f12)] 'find-tag-current-word) 36 | (define-key global-map [(f12)] '(lambda () "find next tag" (interactive) (execute-kbd-macro "\C-u\256"))) 37 | (define-key global-map [(shift f12)] '(lambda () "find prev tag" (interactive) (execute-kbd-macro "\C-u-\256"))) 38 | (define-key global-map [(shift control f12)] 'select-tags-table) 39 | (define-key global-map [(meta control f12)] 'tags-reset-tags-tables) 40 | (define-key global-map [(f4)] 'tags-loop-continue) 41 | 42 | (provide 'etags-iterator) 43 | (provide 'bookmark-iterator) 44 | ;;; bookmark-iterator.el ends here 45 | -------------------------------------------------------------------------------- /site-lisp/snippets/snippets/clojure-mode/defn: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | #name : defn 3 | # -- 4 | (defn ${1:name} 5 | "${2:TODO: Document}" 6 | [$3] 7 | $0) 8 | 9 | -------------------------------------------------------------------------------- /site-lisp/snippets/snippets/clojure-mode/ns: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | #name : ns 3 | # -- 4 | (ns `(let* ((nsname '()) 5 | (dirs (split-string (buffer-file-name) "/")) 6 | (aftersrc nil)) 7 | (dolist (dir dirs) 8 | (if aftersrc 9 | (progn 10 | (setq nsname (cons dir nsname)) 11 | (setq nsname (cons "." nsname))) 12 | (when (or (string= dir "src") (string= dir "test")) 13 | (setq aftersrc t)))) 14 | (when nsname 15 | (replace-regexp-in-string "_" "-" (substring (apply 'concat 16 | (reverse nsname)) 0 -5))))` 17 | (:use $1) 18 | (:require )) -------------------------------------------------------------------------------- /site-lisp/snippets/snippets/es-mode/new-index: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | #name : new-index 3 | # -- 4 | POST /${2:test} 5 | { 6 | "settings": { 7 | "number_of_shards": 1, 8 | "number_of_replicas": 0 9 | }, 10 | "mappings": { 11 | "doc": { 12 | "properties": { 13 | "body": {"type": "string"} 14 | } 15 | } 16 | } 17 | }$0 18 | -------------------------------------------------------------------------------- /site-lisp/snippets/snippets/org-mode/bgd: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | #name : bgd 3 | # -- 4 | #+HTML_HEAD: 5 | -------------------------------------------------------------------------------- /site-lisp/snippets/snippets/org-mode/els: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | #name : els 3 | # -- 4 | #+BEGIN_SRC emacs-lisp 5 | $0 6 | #+END_SRC 7 | -------------------------------------------------------------------------------- /site-lisp/snippets/snippets/org-mode/gnup: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | #name : gnup 3 | # -- 4 | #+BEGIN_SRC gnuplot :results raw :var data=${1:mydata} :file $1.png 5 | set title "$2" 6 | set xlabel "$3" 7 | set ylabel "$4" 8 | plot data with lines 9 | #+END_SRC 10 | -------------------------------------------------------------------------------- /site-lisp/snippets/snippets/org-mode/header: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | #name : header 3 | # -- 4 | #+TITLE: ${1:} 5 | #+AUTHOR: `(user-full-name)` 6 | #+EMAIL: `user-mail-address` 7 | #+LANGUAGE: en 8 | #+PROPERTY: header-args :results code replace :exports both :noweb yes :tangle no 9 | #+HTML_HEAD: <link rel="stylesheet" href="http://dakrone.github.io/org.css" type="text/css" /> 10 | #+EXPORT_SELECT_TAGS: export 11 | #+EXPORT_EXCLUDE_TAGS: noexport 12 | #+OPTIONS: H:4 num:nil toc:t \n:nil @:t ::t |:t ^:{} -:t f:t *:t 13 | #+OPTIONS: skip:nil d:(HIDE) tags:not-in-toc 14 | #+TODO: TODO(t) | DONE(d) 15 | #+TODO: TODO(t) SOMEDAY(s) INPROGRESS(i) HOLD(h) WAITING(w@/!) NEEDSREVIEW(n@/!) | DONE(d) 16 | #+TODO: TODO(t) INPROGRESS(i) | CANCELLED(c@/!) 17 | #+TAGS: export(e) noexport(n) 18 | #+STARTUP: fold nodlcheck lognotestate content 19 | 20 | * $0 -------------------------------------------------------------------------------- /site-lisp/snippets/snippets/org-mode/mki: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | #name : mki 3 | # -- 4 | #+BEGIN_SRC sh :results code :exports both :noweb yes :tangle `(file-name-base (buffer-name))`.zsh 5 | curl -XDELETE "localhost:9200/${1:test}" 6 | echo 7 | curl -XPOST 'localhost:9200/$1' -d'{ 8 | "mappings": { 9 | "doc": { 10 | "properties": { 11 | "body": { 12 | "type": "string" 13 | }$0 14 | } 15 | } 16 | } 17 | }' 18 | echo 19 | #+END_SRC 20 | -------------------------------------------------------------------------------- /site-lisp/snippets/snippets/org-mode/nex: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | #name : <nex 3 | #description : create a new sub-org example 4 | # -- 5 | ** ${1:title} 6 | $0 7 | 8 | *** Create an index 9 | 10 | #+BEGIN_SRC es 11 | DELETE /${2:test} 12 | {} 13 | 14 | POST /$2 15 | { 16 | "settings": { 17 | "number_of_shards": 1, 18 | "number_of_replicas": 0 19 | }, 20 | "mappings": { 21 | "doc": { 22 | "properties": { 23 | "body": {"type": "string"} 24 | } 25 | } 26 | } 27 | } 28 | #+END_SRC 29 | 30 | *** Index docs 31 | 32 | #+BEGIN_SRC es 33 | POST /$2/doc/1 34 | {"body": "foo"} 35 | 36 | POST /$2/_refresh 37 | {} 38 | #+END_SRC 39 | 40 | *** Query 41 | 42 | #+BEGIN_SRC es 43 | POST /$2/_search?pretty 44 | { 45 | "query": { 46 | "match_all": {} 47 | } 48 | } 49 | #+END_SRC 50 | -------------------------------------------------------------------------------- /site-lisp/snippets/snippets/org-mode/ses: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | #name : ses 3 | # -- 4 | #+BEGIN_SRC es :tangle yes 5 | $0 6 | #+END_SRC 7 | -------------------------------------------------------------------------------- /site-lisp/snippets/snippets/org-mode/shellorg: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | #name : shellorg 3 | # -- 4 | #+TITLE: ${1:<title>} 5 | #+AUTHOR: `(user-full-name)` 6 | #+EMAIL: `user-mail-address` 7 | #+LANGUAGE: en 8 | #+PROPERTY: header-args :results code replace :exports both :noweb yes :tangle no 9 | #+HTML_HEAD: <link rel="stylesheet" href="http://dakrone.github.io/org.css" type="text/css" /> 10 | #+EXPORT_SELECT_TAGS: export 11 | #+EXPORT_EXCLUDE_TAGS: noexport 12 | #+OPTIONS: H:4 num:nil toc:t \n:nil @:t ::t |:t ^:{} -:t f:t *:t 13 | #+OPTIONS: skip:nil d:(HIDE) tags:not-in-toc 14 | #+TODO: TODO(t) | DONE(d) 15 | #+TODO: TODO(t) SOMEDAY(s) INPROGRESS(i) HOLD(h) WAITING(w@/!) NEEDSREVIEW(n@/!) | DONE(d) 16 | #+TODO: TODO(t) INPROGRESS(i) | CANCELLED(c@/!) 17 | #+TAGS: export(e) noexport(n) 18 | #+STARTUP: fold nodlcheck lognotestate content 19 | 20 | * Create the index 21 | 22 | #+BEGIN_SRC es :tangle yes 23 | DELETE /${2:thing} 24 | {} 25 | 26 | POST /$2 27 | { 28 | "settings": { 29 | "number_of_shards": 1, 30 | "number_of_replicas": 0 31 | }, 32 | "mappings": { 33 | "doc": { 34 | "properties": { 35 | "body": {"type": "string"} 36 | } 37 | } 38 | } 39 | }$0 40 | #+END_SRC 41 | 42 | * Index docs 43 | 44 | #+BEGIN_SRC es :tangle yes 45 | POST /$2/doc/1 46 | {"body": "foo"} 47 | 48 | POST /$2/_refresh 49 | {} 50 | #+END_SRC 51 | 52 | * Query 53 | 54 | #+BEGIN_SRC es :tangle yes 55 | POST /$2/_search?pretty 56 | { 57 | "query": { 58 | "match_all": {} 59 | } 60 | } 61 | #+END_SRC 62 | -------------------------------------------------------------------------------- /site-lisp/snippets/snippets/org-mode/shs: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | #name : shs 3 | # -- 4 | #+BEGIN_SRC sh :tangle `(file-name-base (buffer-name))`.sh 5 | $0 6 | #+END_SRC 7 | --------------------------------------------------------------------------------