all repos — nixfiles @ 6aa8ab5de3bb204b807348f192e3cbdd7311a656

System and user configuration, managed by nix and home-manager

Emacs: reformat to outshine style

Alan Pearce
commit

6aa8ab5de3bb204b807348f192e3cbdd7311a656

parent

b8e3ec3e8314eafc35f825cd79f59fa1b072d1cb

1 file changed, 149 insertions(+), 149 deletions(-)

jump to
M emacs/.emacs.d/main.elemacs/.emacs.d/main.el
@@ -7,8 +7,8 @@ ;; #+PROPERTY: header-args :comments link
;;; Header: ;; This is a living document, detailing my Emacs configuration using org-mode ;;; Code: -;; ** Basics -;; *** Startup +;;;;; Basics +;;;;;; Startup ;; Open Emacs with just a plain window. No graphics or messages, please! ;; #+BEGIN_SRC emacs-lisp (setq inhibit-startup-screen t)
@@ -30,7 +30,7 @@ (when (string-match "Microsoft$" (buffer-string))
(setq system-type 'gnu/linux/windows)))) ;; #+END_SRC -;; *** Compatibility +;;;;;; Compatibility ;; #+BEGIN_SRC emacs-lisp (if (version< emacs-version "25.0")
@@ -38,7 +38,7 @@ (defmacro with-eval-after-load (file &rest body)
`(eval-after-load ,file (lambda () ,@body)))) ;; #+END_SRC -;; *** Scratch buffers +;;;;;; Scratch buffers ;; I usually use scratch buffers for any sort of text. If I need a ;; programming mode in one, then I’ll just call it manually. I also like ;; the buffer to be empty.
@@ -47,15 +47,15 @@ (setq initial-scratch-message ""
initial-major-mode 'text-mode) ;; #+END_SRC -;; *** Personal Information +;;;;;; Personal Information ;; #+BEGIN_SRC emacs-lisp (setq user-mail-address "alan@alanpearce.eu" user-full-name "Alan Pearce") ;; #+end_src -;; ** Packaging +;;;;; Packaging -;; *** Use-package +;;;;;; Use-package ;; #+BEGIN_SRC emacs-lisp (eval-and-compile
@@ -101,9 +101,9 @@ use-package-always-demand (daemonp)
package-enable-at-startup nil) ;; #+END_SRC -;; *** Helpers +;;;;;; Helpers -;; **** Hook Helpers +;;;;;;; Hook Helpers ;; An improvement over add-hook with lamda functions that allows ;; modification and removal, without the boilerplate of an extra function
@@ -114,7 +114,7 @@ (eval-and-compile
(use-package hook-helpers)) ;; #+END_SRC -;; ** Customize +;;;;; Customize ;; I don’t really like using customize for normal configuration. ;; Instead, I use it for things that get saved automatically. That’s why ;; I use a different file, which is ignored by the VCS. It also means
@@ -126,7 +126,7 @@ (setq custom-file "~/.emacs.d/custom.el")
(load custom-file :noerror :nomessage) ;; #+END_SRC -;; ** Styles +;;;;; Styles ;; I prefer an always-visible cursor. Feels less distracting. ;; #+BEGIN_SRC emacs-lisp
@@ -156,7 +156,7 @@ '(isearch-abort abort-recursive-edit exit-minibuffer keyboard-quit undo-tree-undo))
(ding)))) ;; #+END_SRC -;; *** Colours +;;;;;; Colours ;; White-theme. Sounds like a good idea.
@@ -181,7 +181,7 @@ (use-package highlight-stages
:diminish highlight-stages-mode) ;; #+END_SRC -;; *** Fonts +;;;;;; Fonts ;; When possible, set up fonts. I don’t have any settings here for X11, ;; because I manage those in my [[file:~/projects/dotfiles/tag-xresources/xresources/main][XResources file]].
@@ -247,7 +247,7 @@ (mac-auto-operator-composition-mode +1))
(global-prettify-symbols-mode +1)) ;; #+END_SRC -;; *** Page Breaks +;;;;;; Page Breaks ;; By default, Emacs displays page breaks as ^L. Lines look much nicer. ;; On Windows, Emacs incorrectly detects that U+2500 (Box Drawings Light
@@ -265,7 +265,7 @@ (set-fontset-font "fontset-default"
(cons page-break-lines-char page-break-lines-char) (face-attribute 'default :family))))) ;; #+END_SRC -;; *** Modeline +;;;;;; Modeline ;; #+BEGIN_SRC emacs-lisp (column-number-mode -1)
@@ -295,7 +295,7 @@ '(buffer-file-name " — %f")
'(dired-directory (" — " dired-directory)))) ;; #+END_SRC -;; *** Chrome +;;;;;; Chrome ;; Sometimes I like to hide clutter. Other times, it's useful.
@@ -353,7 +353,7 @@ (add-hook 'minibuffer-setup-hook #'show-mode-line)
(add-hook 'minibuffer-exit-hook #'hide-mode-line) ;; #+END_SRC -;; *** Highlight Changes +;;;;;; Highlight Changes ;; Highlight what just changed when I undo, yank, and so on.
@@ -364,7 +364,7 @@ :config (progn
(volatile-highlights-mode t))) ;; #+END_SRC -;; *** Beacon +;;;;;; Beacon ;; I was against the idea of having flashy animations inside Emacs, but ;; this one is useful. It highlights the cursor when scrolling or
@@ -381,7 +381,7 @@ beacon-size 20
beacon-color "#a1b56c"))) ;; #+END_SRC -;; *** Renaming major modes +;;;;;; Renaming major modes ;; Diminishing major modes does not happen in the same manner as minor ;; modes.
@@ -406,7 +406,7 @@ (cyphejor-mode 1))))
;; #+END_SRC -;; ** Environment Variables +;;;;; Environment Variables ;; MacOS doesn’t have a reasonable way to set environment variables and ;; read them automatically any more. So, let’s use the
@@ -427,7 +427,7 @@ (setq exec-path-from-shell-arguments '("-l"))
(exec-path-from-shell-initialize))) ;; #+END_SRC -;; *** NixOS sandboxes +;;;;;; NixOS sandboxes ;; I'm currently exploring using nix to create sandboxes for ;; development. This package allows using tools from inside sandboxes,
@@ -451,7 +451,7 @@ (nix-executable-find (nix-current-sandbox) cmd)
(executable-find cmd))))))) ;; #+END_SRC -;; ** Keybindings +;;;;; Keybindings ;; I think =set-keyboard-coding-system= stops OS X from doing something ;; annoying to add accents. The modifier setup is to match my
@@ -505,7 +505,7 @@ (bind-key* "C-x M-x" #'execute-extended-command)
(set-register ?z `(file . ,(expand-file-name ".config/zsh/zshrc" "~"))) ;; #+END_SRC -;; *** Crux +;;;;;; Crux ;; I can replace most of the simple helper/wrapper functions in my ;; configuration with crux.el
@@ -524,7 +524,7 @@ (defalias 'delete-current-buffer-file #'crux-delete-file-and-buffer)
(defalias 'rename-current-buffer-file #'crux-rename-file-and-buffer))) ;; #+END_SRC -;; ** Projects +;;;;; Projects ;; #+BEGIN_SRC emacs-lisp (defun switch-to-dotfiles ()
@@ -533,7 +533,7 @@ (interactive)
(projectile-switch-project-by-name (car (split-string (shell-command-to-string "ghq list --full-path dotfiles"))))) ;; #+END_SRC -;; *** The Silver Searcher +;;;;;; The Silver Searcher ;; #+BEGIN_SRC emacs-lisp (use-package ag
@@ -544,7 +544,7 @@ (use-package wgrep-ag
:after ag) ;; #+END_SRC -;; *** Ripgrep +;;;;;; Ripgrep ;; Step over Silver Search, here comes a new challenger.
@@ -558,7 +558,7 @@ :if (executable-find "rg")
:bind (("C-c p s r" . projectile-ripgrep))) ;; #+END_SRC -;; *** Projectile +;;;;;; Projectile ;; Projectile is awesome for working in projects, especially VCS-backed ;; ones.
@@ -634,7 +634,7 @@ (call-interactively #'counsel-projectile-rg))
(define-key projectile-mode-map [remap counsel-projectile-ag] #'counsel-projectile-rg))) ;; #+END_SRC -;; *** vc +;;;;;; vc ;; This is nice for some things that magit doesn’t do, and for those rare ;; occasions that I’m working with something other than git.
@@ -650,7 +650,7 @@ vc-ignore-dir-regexp
tramp-file-name-regexp)))) ;; #+END_SRC -;; *** git-gutter-fringe +;;;;;; git-gutter-fringe ;; It’s nice to be able to see at a glance which lines of a file have ;; changed. This package colours the fringe. I have it set to the right
@@ -678,7 +678,7 @@ "....XXXX")
(setq git-gutter-fr:side 'right-fringe))) ;; #+END_SRC -;; *** magit +;;;;;; magit ;; Magit is my favourite way to use git. I use selective staging all the ;; time. Make sure to set it up with a nice =completing-read-function=
@@ -695,7 +695,7 @@ (add-to-list 'magit-no-confirm 'safe-with-wip))
:init (add-hook 'magit-mode-hook #'magit-load-config-extensions)) ;; #+END_SRC -;; *** git-messenger +;;;;;; git-messenger ;; Popup the last commit that changed the line at point.
@@ -706,7 +706,7 @@ :config (progn
(setq git-messenger:use-magit-popup t))) ;; #+END_SRC -;; *** git-timemachine +;;;;;; git-timemachine ;; This package allow me to go through a file’s history with just a few ;; keys. It makes it very easy to figure what what exactly was in a file
@@ -718,7 +718,7 @@ (use-package git-timemachine
:commands git-timemachine) ;; #+END_SRC -;; *** ghq +;;;;;; ghq ;; [[https://github.com/motemen/ghq][=ghq=]] clones VCS-backed projects to a common directory. It should ;; seem familiar to anyone who's used =go get= before. [[https://github.com/rcoedo/emacs-ghq][=emacs-ghq=]] is a
@@ -729,9 +729,9 @@ (use-package ghq
:if (executable-find "ghq")) ;; #+END_SRC -;; ** Files +;;;;; Files -;; *** Auto-saving +;;;;;; Auto-saving ;; Auto-save everything to a temporary directory, instead of cluttering ;; the filesystem. I don’t want emacs-specific lockfiles, either.
@@ -740,7 +740,7 @@ ;; #+BEGIN_SRC emacs-lisp
(setq auto-save-file-name-transforms `((".*" ,temporary-file-directory t)) create-lockfiles nil) ;; #+END_SRC -;; *** Backups +;;;;;; Backups ;; I like to keep my backups out of regular folders. I tell emacs to use ;; a subfolder of its configuration directory for that. Also, use the
@@ -761,7 +761,7 @@ nil 0 nil
file)))) ;; #+END_SRC -;; *** autorevert +;;;;;; autorevert ;; #+BEGIN_SRC emacs-lisp (use-package autorevert
@@ -772,7 +772,7 @@ (setq auto-revert-verbose nil
auto-revert-use-notify (not (eq system-type 'darwin))))) ;; #+END_SRC -;; *** Encoding +;;;;;; Encoding ;; UTF-8 is usually appropriate. Note that =prefer-coding-system= expects ;; only a coding system, not a coding system and line ending combination.
@@ -782,7 +782,7 @@ (prefer-coding-system 'utf-8)
(setq-default buffer-file-coding-system 'utf-8-auto-unix) ;; #+END_SRC -;; *** Buffer-file management +;;;;;; Buffer-file management ;; Ask if I want to create a directory when it doesn’t exist. This is ;; especially nice when starting new projects.
@@ -814,7 +814,7 @@ (other-window 1))
(kill-buffer buf))))) ;; #+END_SRC -;; *** Whitespace +;;;;;; Whitespace ;; Show bad whitespace, so that I can fix it.
@@ -831,7 +831,7 @@ (add-hook 'prog-mode-hook #'show-trailing-whitespace-on)
(add-hook 'text-mode-hook #'show-trailing-whitespace-on) ;; #+END_SRC -;; *** shrink-whitespace +;;;;;; shrink-whitespace ;; DWIM whitespace removal. So I don’t need =M-SPC=, =M-\= and =C-x o= ;; for similar things any more.
@@ -841,7 +841,7 @@ (use-package shrink-whitespace
:bind ("M-SPC" . shrink-whitespace)) ;; #+END_SRC -;; *** Tramp +;;;;;; Tramp ;; Tramp is awesome. It makes SSH feel Unix-y. The proxy setup is so ;; that I can sudo on remote machines
@@ -868,7 +868,7 @@ (add-to-list 'tramp-default-proxies-alist `(,(regexp-quote (system-name)) nil nil))
(add-to-list 'tramp-default-proxies-alist '("localhost" nil nil)))) ;; #+END_SRC -;; *** ediff +;;;;;; ediff ;; I like a horizonal diff setup, with everything in one frame.
@@ -880,7 +880,7 @@ (setq ediff-split-window-function 'split-window-horizontally
ediff-window-setup-function 'ediff-setup-windows-plain))) ;; #+END_SRC -;; ** Indentation +;;;;; Indentation ;; Ah, a complicated topic. One day we’ll all be using elastic ;; tabstops. I’ve recently switched to using two spaces, since elastic
@@ -893,7 +893,7 @@ (electric-indent-mode +1)
;; #+END_SRC -;; *** smart-tabs-mode +;;;;;; smart-tabs-mode ;; Not related to [[smart-tab][=smart-tab=]], this mode indents with tabs and aligns ;; with spaces. Perfect!
@@ -907,7 +907,7 @@ (define-hook-helper php-mode ()
(smart-tabs-mode indent-tabs-mode)))) ;; #+END_SRC -;; *** editorconfig +;;;;;; editorconfig ;; #+BEGIN_SRC emacs-lisp (use-package editorconfig
@@ -915,7 +915,7 @@ :diminish "EC"
:config (editorconfig-mode 1)) ;; #+END_SRC -;; *** dtrt-indent-mode +;;;;;; dtrt-indent-mode ;; Sometimes people use different indentation settings. [[https://github.com/jscheid/dtrt-indent][dtrt-indent]] ;; guesses the correct settings for me.
@@ -931,9 +931,9 @@ (defadvice dtrt-indent-try-set-offset (after toggle-smart-tabs activate)
(smart-tabs-mode (or indent-tabs-mode -1))))) ;; #+END_SRC -;; ** Security +;;;;; Security -;; *** password-store +;;;;;; password-store ;; This is a frontend to the GPG-powered =pass= program. ;; #+BEGIN_SRC emacs-lisp
@@ -942,9 +942,9 @@ :defer 15
:config (progn (setq password-store-password-length 16))) ;; #+END_SRC -;; ** Buffers +;;;;; Buffers -;; *** Ibuffer +;;;;;; Ibuffer ;; Ibuffer is quite nice for listing all buffers. ;; #+BEGIN_SRC emacs-lisp
@@ -980,7 +980,7 @@ " "
filename-and-process))))) ;; #+END_SRC -;; *** Relative Buffer names +;;;;;; Relative Buffer names ;; #+BEGIN_SRC emacs-lisp (use-package relative-buffers
@@ -988,7 +988,7 @@ :defer 15
:config (progn (global-relative-buffers-mode))) ;; #+END_SRC -;; *** Narrowing +;;;;;; Narrowing ;; Enable it without prompting
@@ -998,7 +998,7 @@ (put 'narrow-to-page 'disabled nil)
(put 'narrow-to-region 'disabled nil) ;; #+END_SRC -;; *** ace-window +;;;;;; ace-window ;; I don’t often have many windows open at once, but when I do, ;; =ace-window= is really nice to jump around them in the same way that
@@ -1021,7 +1021,7 @@ (?. winner-redo))
aw-keys '(?a ?r ?s ?t ?n ?e ?i ?o)))) ;; #+END_SRC -;; ** Windows +;;;;; Windows ;; Scrolling is tricky. I use this setup to help me keep track of the ;; point whilst I’m moving about.
@@ -1038,7 +1038,7 @@ (if (boundp 'ns-pop-up-frames)
(setq ns-pop-up-frames nil)) ;; #+END_SRC -;; *** eyebrowse +;;;;;; eyebrowse ;; Workspaces, a bit like dwm. On Windows and Linux (at least the WMs ;; I'm likely to use), super+{0-9} are taken from the OS, so use meta
@@ -1075,9 +1075,9 @@ ("M-9" . eyebrowse-switch-to-window-config-9))
(eyebrowse-mode +1))) ;; #+END_SRC -;; ** Sessions +;;;;; Sessions -;; *** Desktop +;;;;;; Desktop ;; Save my Emacs session and restore it on startup. ;; #+BEGIN_SRC emacs-lisp
@@ -1096,7 +1096,7 @@ (make-directory desktop-dirname))
(desktop-save-mode 1))) ;; #+END_SRC -;; *** winner +;;;;;; winner ;; Undo, for window-based commands.
@@ -1107,7 +1107,7 @@ :init (progn
(winner-mode 1))) ;; #+END_SRC -;; *** windmove +;;;;;; windmove ;; Directional window movement
@@ -1118,7 +1118,7 @@ ("S-<right>" . windmove-right)
("S-<up>" . windmove-up) ("S-<down>" . windmove-down))) ;; #+END_SRC -;; ** Blogging +;;;;; Blogging ;; I have a [[https://alanpearce.uk][blog]] that I publish with hugo.
@@ -1129,7 +1129,7 @@ easy-hugo-url "https://alanpearce.uk"
easy-hugo-default-ext ".md")) ;; #+END_SRC -;; ** Completion +;;;;; Completion ;; Make built-in completion a bit more intelligent, by adding substring ;; and initial-based completion and ignoring case.
@@ -1140,7 +1140,7 @@ completion-ignore-case t
tab-always-indent 'complete) ;; #+END_SRC -;; *** Company +;;;;;; Company ;; The main choices for automatic completion in Emacs are company and ;; auto-complete-mode. I’ve not tried auto-complete-mode as company
@@ -1176,7 +1176,7 @@ ;; #+END_SRC
;;; ** Dates & Times -;; *** Calendar +;;;;;; Calendar ;; Weeks start on Monday for me and I prefer ISO-style dates. ;; #+BEGIN_SRC emacs-lisp
@@ -1215,7 +1215,7 @@ "Provide the date/time 24 hours before the time now in the format of `current-time'."
(timer-relative-time (current-time) -86400)) ;; #+END_SRC -;; ** Directories +;;;;; Directories ;; Dired works quite nicely, but not always in the way I want. I don’t ;; like having so many prompts for recursive operations. Also, when I
@@ -1282,7 +1282,7 @@ (bind-key "^" #'dired-subtree-maybe-up dired-mode-map)
(bind-key "i" #'dired-subtree-toggle dired-mode-map)))) ;; #+END_SRC -;; *** Disk usage +;;;;;; Disk usage ;; Combine dired and du (disk usage).
@@ -1293,7 +1293,7 @@ :config (progn
(setq dired-du-size-format t))) ;; #+END_SRC -;; *** Dired-narrow +;;;;;; Dired-narrow ;; One can already use dired with wildcards to browse a filtered ;; directory listing, but it opens a new buffer. Dired-narrow is a ;; slightly nicer interface: with a currently-open dired buffer, use =/=
@@ -1307,15 +1307,15 @@ :bind (:map dired-mode-map
("/" . dired-narrow)))) ;; #+END_SRC -;; ** Documentation +;;;;; Documentation -;; *** helpful +;;;;;; helpful ;; #+BEGIN_SRC emacs-lisp (use-package helpful) ;; #+END_SRC -;; *** ehelp +;;;;;; ehelp ;; ehelp is a less well-known package that’s part of Emacs and slightly ;; improves the normal help commands, mostly by making quitting them easier.
@@ -1325,7 +1325,7 @@ (use-package ehelp
:bind-keymap ("C-h" . ehelp-map)) ;; #+END_SRC -;; *** discover-my-major +;;;;;; discover-my-major ;; A nicer way to browse keybindings for major modes.
@@ -1334,7 +1334,7 @@ (use-package discover-my-major
:bind ("<f1>" . discover-my-major)) ;; #+END_SRC -;; *** which-key +;;;;;; which-key ;; Popup keybindings following a prefix automatically.
@@ -1346,7 +1346,7 @@ (which-key-mode 1)
(which-key-setup-side-window-right-bottom))) ;; #+END_SRC -;; *** eldoc +;;;;;; eldoc ;; Documentation in the echo-area (where the minibuffer is displayed) is ;; rather useful.
@@ -1359,9 +1359,9 @@ :config (progn
(setq eldoc-idle-delay 0.1) (eldoc-add-command 'paredit-backward-delete 'paredit-close-round))) ;; #+END_SRC -;; ** Mail +;;;;; Mail -;; *** Basics +;;;;;; Basics ;; #+BEGIN_SRC emacs-lisp (with-eval-after-load "mailcap"
@@ -1376,7 +1376,7 @@ (with-eval-after-load "mml-sec"
(setq mml-secure-openpgp-encrypt-to-self t)) ;; #+END_SRC -;; *** mu +;;;;;; mu ;; #+BEGIN_SRC emacs-lisp (when (executable-find "mu")
@@ -1465,7 +1465,7 @@ (local-set-key (kbd "<tab>") 'shr-next-link)
(local-set-key (kbd "<backtab>") 'shr-previous-link))))) ;; #+END_SRC -;; ** Misc +;;;;; Misc ;; #+BEGIN_SRC emacs-lisp (defvar *init-file*
@@ -1517,7 +1517,7 @@ (bind-key* "M-!" #'shell-execute)
(bind-key* "C-x r M-w" #'copy-rectangle) ;; #+END_SRC -;; *** Auxillary Configuration +;;;;;; Auxillary Configuration ;; #+BEGIN_SRC emacs-lisp (require 'pinentry)
@@ -1580,7 +1580,7 @@
(add-hook 'first-frame-hook #'load-private-data) ;; #+END_SRC -;; ** Minibuffer +;;;;; Minibuffer ;; Sometimes I want to use the minibuffer, but I’m already inside it. ;; Fortunately, this is possible. Of course, I need to know how many
@@ -1604,7 +1604,7 @@ (defalias 'exit-emacs #'delete-frame)
(defalias 'exit-emacs #'save-buffers-kill-emacs)) ;; #+END_SRC -;; *** swiper/ivy +;;;;;; swiper/ivy ;; Ivy is the new kid on the completion block. It seems to be a strong ;; replacement for helm so far.
@@ -1627,7 +1627,7 @@ "kill")))
(add-to-list 'ivy-initial-inputs-alist '(counsel-M-x . "")))) ;; #+END_SRC -;; *** counsel +;;;;;; counsel ;; #+BEGIN_SRC emacs-lisp (use-package counsel
@@ -1650,7 +1650,7 @@ (setq counsel-rg-base-command "rg -i --no-heading --line-number --hidden %s .")))
;; #+END_SRC -;; *** smex +;;;;;; smex ;; Smex is my favourite way to use =M-x=. Counsel’s =counsel-M-x= ;; function uses it internally, so I’m keeping it around, even though I
@@ -1675,7 +1675,7 @@ smex-save-file (concat user-emacs-directory
"smex-items")))) ;; #+END_SRC -;; *** cmd-to-echo +;;;;;; cmd-to-echo ;; I’ve been looking for some way to run programming projects (mostly ;; node.js) inside emacs. =cmd-to-echo= seems great for this, as new
@@ -1686,7 +1686,7 @@ (use-package cmd-to-echo
:commands (cmd-to-echo) :config (setq cmd-to-echo-add-output-to-process-buffers t)) ;; #+END_SRC -;; ** Modes +;;;;; Modes ;; Setup some modes for systemd files ;; #+BEGIN_SRC emacs-lisp
@@ -1755,7 +1755,7 @@ (define-derived-mode saltstack-mode yaml-mode "Salt")
(add-to-list 'auto-mode-alist '("\\.sls\\'" . saltstack-mode)) ;; #+END_SRC -;; *** ledger +;;;;;; ledger ;; I use [[http://ledger-cli.org/][=ledger=]] to manage my finances. It has an Emacs mode, which ;; works really nicely.
@@ -1798,7 +1798,7 @@ ("payee" "ledger -f %(ledger-file) reg @%(payee)")
("account" "ledger -f %(ledger-file) reg %(account)"))))) ;; #+END_SRC -;; *** Beancount +;;;;;; Beancount ;; #+BEGIN_SRC emacs-lisp (let ((beancount-dir (car (split-string (shell-command-to-string "ghq list --full-path beancount")))))
@@ -1810,7 +1810,7 @@ :defines (beancount-use-ido)
:config (setq beancount-use-ido nil)))) ;; #+END_SRC -;; *** Markdown +;;;;;; Markdown ;; #+BEGIN_SRC emacs-lisp (use-package markdown-mode
@@ -1819,7 +1819,7 @@ :config (progn
(add-hook 'markdown-mode-hook #'turn-on-auto-fill))) ;; #+END_SRC -;; *** Outshine +;;;;;; Outshine ;; Org-ified source code. I think this might work better than ;; lentic-mode, whilst also being more general.
@@ -1837,7 +1837,7 @@ (add-hook 'ledger-mode-hook #'outline-minor-mode)
(add-hook 'sh-mode-hook #'outline-minor-mode))) ;; #+END_SRC -;; *** Org +;;;;;; Org ;; Org is wünderbar.
@@ -1897,7 +1897,7 @@ :config (progn
(bind-key "C-x C-s" #'org-edit-src-exit org-src-mode-map))) ;; #+END_SRC -;; ***** org-babel +;;;;;;;* org-babel ;; Org’s babel feature is really nice. I use it for this file, and I can ;; use it to communicate between programming languages. Sometime I hope
@@ -1917,7 +1917,7 @@ org-edit-src-content-indentation 0
org-src-preserve-indentation t))) ;; #+END_SRC -;; ***** org-journal +;;;;;;;* org-journal ;; I can use this to keep a journal. I should use it.
@@ -1943,8 +1943,8 @@ (org-journal-read-or-display-entry (yesterday-time)))))
;; #+END_SRC -;; ** Programming -;; *** flycheck +;;;;; Programming +;;;;;; flycheck ;; On-the-fly error checking in programming modes? Yes please.
@@ -1963,7 +1963,7 @@ (if (executable-find "eslint_d")
(setq flycheck-javascript-eslint-executable "eslint_d")))) ;; #+END_SRC -;; **** flycheck-pos-tip +;;;;;;; flycheck-pos-tip ;; Show flycheck errors in a little popup, so I don't lose my place
@@ -1975,7 +1975,7 @@ (setq flycheck-display-errors-delay 0.5)
(flycheck-pos-tip-mode 1))) ;; #+END_SRC -;; **** flycheck-flow +;;;;;;; flycheck-flow ;; #+BEGIN_SRC emacs-lisp (use-package flycheck-flow
@@ -1985,7 +1985,7 @@ :config (progn
(flycheck-add-next-checker 'javascript-eslint 'javascript-flow))) ;; #+END_SRC -;; *** golang +;;;;;; golang ;; Go has a few packages to inter-operate with other emacs packages.
@@ -2012,7 +2012,7 @@
;; #+END_SRC -;; *** ggtags +;;;;;; ggtags ;; A nice completion backend for programming modes.
@@ -2030,7 +2030,7 @@ (ggtags-mode 1))
(add-hook 'c-mode-common-hook #'turn-on-ggtags-mode))) ;; #+END_SRC -;; *** dumb-jump +;;;;;; dumb-jump ;; A "clever" way of implementing go-to-definition across languages: use ;; a project-wide text search and apply heuristics to the results to
@@ -2045,7 +2045,7 @@ ("M-g z" . dumb-jump-go-prefer-external-other-window))
:config (setq dumb-jump-selector 'ivy)) ;; #+END_SRC -;; *** imenu-anywhere +;;;;;; imenu-anywhere ;; This is like imenu, but shows functions (or similar top-level ;; entities) across buffers in the same project. Neat!
@@ -2054,9 +2054,9 @@ ;; #+BEGIN_SRC emacs-lisp
(use-package imenu-anywhere :bind ("C-x C-." . ivy-imenu-anywhere)) ;; #+END_SRC -;; *** Lisps +;;;;;; Lisps -;; **** All +;;;;;;; All ;; Lisp modes don’t seem to have a common ancestor. So I made a custom ;; hook which I trigger in every lispy-mode.
@@ -2075,7 +2075,7 @@ clojure-mode-hook)
(run-hooks 'lisp-mode-common-hook)) ;; #+END_SRC -;; ***** Redshank +;;;;;;;* Redshank ;; Lisp syntax allows for really easy refactoring. Redshank gives some ;; operations that aren’t part of paredit, like extracting variables into
@@ -2088,7 +2088,7 @@ :config (progn
(add-hook 'lisp-mode-common-hook #'turn-on-redshank-mode))) ;; #+END_SRC -;; **** Emacs Lisp +;;;;;;; Emacs Lisp ;; Customise the modeline-display of =emacs-lisp-mode=. Then make sure ;; it runs the common lisp hooks.
@@ -2118,7 +2118,7 @@ (define-hook-helper ielm-mode ()
(run-hooks 'lisp-mode-common-hook)))) ;; #+END_SRC -;; **** Scheme & Lisp +;;;;;;; Scheme & Lisp ;; I don’t work with these as often as I would like
@@ -2128,7 +2128,7 @@ (set (make-local-variable 'lisp-indent-function)
#'common-lisp-indent-function)) ;; #+END_SRC -;; ***** geiser +;;;;;;;* geiser ;; A REPL thing for Scheme. Hopefully I’ll get to use it more in the ;; future.
@@ -2141,7 +2141,7 @@ run-geiser
run-racket)) ;; #+END_SRC -;; ***** slime +;;;;;;;* slime ;; A REPL thing (and more) for Lisp.
@@ -2158,7 +2158,7 @@ inferior-lisp-program (or (executable-find "sbcl")
(executable-find "ccl64"))))) ;; #+END_SRC -;; **** Clojure +;;;;;;; Clojure ;; #+BEGIN_SRC emacs-lisp (use-package clojure-mode
@@ -2177,7 +2177,7 @@ (define-hook-helper clojure-mode ()
(clj-refactor-mode 1)))) ;; #+END_SRC -;; ***** cider +;;;;;;;* cider ;; A REPL thing for Clojure
@@ -2190,7 +2190,7 @@ (unbind-key "C-c C-f" cider-mode-map)
(add-hook 'cider-mode-hook #'eldoc-mode))) ;; #+END_SRC -;; *** Auto-compile +;;;;;; Auto-compile ;; Auto-compile emacs lisp when saving. ;; #+BEGIN_SRC emacs-lisp
@@ -2199,7 +2199,7 @@ :defer t
:init (add-hook 'emacs-lisp-mode-hook #'auto-compile-on-save-mode)) ;; #+END_SRC -;; *** cc-mode +;;;;;; cc-mode ;; Although I don’t use C or C++, setting up the mode is helpful because ;; quite a few other modes are derived from it.
@@ -2215,7 +2215,7 @@ c-basic-offset 4)
(c-set-offset 'case-label '+))) ;; #+END_SRC -;; *** quickrun +;;;;;; quickrun ;; It’s nice to be able to quickly evaluate some code. Although I don’t ;; really seem to use it.
@@ -2224,7 +2224,7 @@ (use-package quickrun
:bind (("C-c C-e" . quickrun))) ;; #+END_SRC -;; *** Scala +;;;;;; Scala ;; Let’s try using Scala.
@@ -2238,9 +2238,9 @@ ;; #+BEGIN_SRC emacs-lisp
(use-package ensime) ;; #+END_SRC -;; *** Web development +;;;;;; Web development -;; **** js2-mode +;;;;;;; js2-mode ;; This mode is really great for editing Javascript. It turns code into ;; an AST internally, so it can work with it almost like a lisp.
@@ -2266,7 +2266,7 @@ js2-highlight-level 1
js2-strict-missing-semi-warning nil))) ;; #+END_SRC -;; ***** rjsx-mode +;;;;;;;* rjsx-mode ;; A set of advice for js2-jsx-mode to work better with React.
@@ -2277,7 +2277,7 @@ :if (fboundp #'js2--struct-put)
:mode (("\\.jsx\\'" . rjsx-mode))) ;; #+END_SRC -;; ***** js2-refactor +;;;;;;;* js2-refactor ;; Thanks to the AST provided by js2-mode, refactoring is possible. This ;; library implements some refactorings.
@@ -2291,7 +2291,7 @@ (add-hook 'js2-mode-hook #'js2-refactor-mode)
(js2r-add-keybindings-with-prefix "C-c C-m"))) ;; #+END_SRC -;; ***** add-node-modules-path +;;;;;;;* add-node-modules-path ;; Inside a javascript project, it's common to install tools locally to ;; the project. This will allows emacs to find their executables.
@@ -2307,7 +2307,7 @@ (when (executable-find "standard")
(setq flycheck-javascript-standard-executable "standard"))))) ;; #+END_SRC -;; ***** Flow +;;;;;;;* Flow ;; #+BEGIN_SRC emacs-lisp (use-package flow-minor-mode
@@ -2316,7 +2316,7 @@ :config (progn
(add-hook 'js2-mode-hook #'flow-minor-enable-automatically))) ;; #+END_SRC -;; ***** Indium +;;;;;;;* Indium ;; Javascript with an inferior node.js process and a debugger? Awesome.
@@ -2341,7 +2341,7 @@ :config (progn
(add-hook 'js2-mode-hook #'indium-interaction-mode))) ;; #+END_SRC -;; **** tern +;;;;;;; tern ;; Tern understands javascript. It adds really clever documented ;; completions, besides other IDE-like things.
@@ -2362,7 +2362,7 @@ (with-eval-after-load 'tern
(use-package company-tern)) ;; #+END_SRC -;; **** json-mode +;;;;;;; json-mode ;; #+BEGIN_SRC emacs-lisp (use-package json-mode
@@ -2372,7 +2372,7 @@ ("composer\\.lock\\'" . json-mode)
("\\.tern-project\\'" . json-mode))) ;; #+END_SRC -;; **** restclient +;;;;;;; restclient ;; Restclient is really nice. It’s like a scratchpad for HTTP api ;; calls. Feels a bit like using =org-babel=. I wonder if there’s an
@@ -2393,7 +2393,7 @@ :after (company restclient)
:init (add-to-list 'company-backends #'company-restclient t)) ;; #+END_SRC -;; **** sgml-mode +;;;;;;; sgml-mode ;; This is for HTML, since old versions of HTML were derived from SGML. ;; #+BEGIN_SRC emacs-lisp
@@ -2402,7 +2402,7 @@ :defer t
:config (setq sgml-basic-offset 2)) ;; #+END_SRC -;; **** emmet-mode +;;;;;;; emmet-mode ;; Emmet is really nice to write HTML quickly. Especially with ;; frameworks that require multiple nested elements to do anything useful.
@@ -2418,7 +2418,7 @@ (add-hook 'web-mode-hook #'emmet-mode)
(add-hook 'css-mode-hook #'emmet-mode))) ;; #+END_SRC -;; **** web-mode +;;;;;;; web-mode ;; This mode handles just about every templating language out ther, which ;; is really nice, because it handles the HTML part the same way in all
@@ -2443,7 +2443,7 @@ web-mode-enable-auto-quoting nil)
(sp-local-pair '(web-mode) "<%" "%>"))) ;; #+END_SRC -;; *** Live coding +;;;;;; Live coding ;; Sometimes I might want to show off my emacs usage.
@@ -2461,7 +2461,7 @@ (ap/set-fonts-according-to-system)
(global-command-log-mode -1)) ;; #+END_SRC -;; **** command-log-mode +;;;;;;; command-log-mode ;; #+BEGIN_SRC emacs-lisp (use-package command-log-mode
@@ -2472,7 +2472,7 @@ command-log-mode-auto-show t
command-log-mode-is-global t))) ;; #+END_SRC -;; ** Spelling +;;;;; Spelling ;; #+BEGIN_SRC emacs-lisp (use-package ispell
@@ -2490,7 +2490,7 @@ ;; #+END_SRC
;; #+BEGIN_SRC emacs-lisp (use-package flyspell - :diminish "﹏" + :diminish " ﹏" :config (progn (defun flyspell-detect-ispell-args (&optional run-together) "If RUN-TOGETHER is true, spell check the CamelCase words.
@@ -2536,7 +2536,7 @@ (add-hook 'text-mode-hook 'fly-text-mode-hook-setup)
(add-hook 'prog-mode-hook #'flyspell-prog-mode))) ;; #+END_SRC -;; *** Style checking +;;;;;; Style checking ;; [[https://github.com/ValeLint/vale][Vale]] is a linter, but for prose. Neat idea! Salesman is a bad term.
@@ -2549,7 +2549,7 @@ (add-to-list 'flycheck-vale-modes 'org-journal-mode)
(flycheck-vale-setup))) ;; #+END_SRC -;; ** Scripting +;;;;; Scripting ;; Make a shell-script buffer executable after saving it, if it has a shebang.
@@ -2570,7 +2570,7 @@ ;; #+BEGIN_SRC emacs-lisp
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on) ;; #+END_SRC -;; *** eshell +;;;;;; eshell ;; I should try to get into the habit of using this more. It’s really ;; nice, when I remember to use it.
@@ -2613,7 +2613,7 @@
;; #+END_SRC -;; **** Shells +;;;;;;; Shells ;; #+BEGIN_SRC emacs-lisp (use-package shell
@@ -2636,7 +2636,7 @@ (kill-buffer)
(comint-delchar-or-maybe-eof arg))) ;; #+END_SRC -;; ** Text editing +;;;;; Text editing ;; Emacs has an editor within.
@@ -2648,7 +2648,7 @@ line-move-visual nil)
(setq-default truncate-lines t) ;; #+END_SRC -;; *** align +;;;;;; align ;; =Align= is a useful command to line things up, once given some rules. ;; The most important one for me is JSON property alignment.
@@ -2664,7 +2664,7 @@ (regexp . ":\\(\\s-*\\)")
(modes . '(js2-mode)))))) ;; #+END_SRC -;; *** Clipboard +;;;;;; Clipboard ;; I like to use the clipboard more than the primary selection in X11.
@@ -2677,7 +2677,7 @@ (when (boundp 'x-select-request-type)
(setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING))) ;; #+END_SRC -;; *** Selection +;;;;;; Selection ;; I’m quite used to deleting text by selecting it and typing. Emacs has ;; a mode for that.
@@ -2714,7 +2714,7 @@ :bind ("C-M-SPC" . er/expand-region)
:config (setq expand-region-fast-keys-enabled nil)) ;; #+END_SRC -;; *** avy +;;;;;; avy ;; Avy is a really nice way to move around files, like ace-jump-mode, but ;; somehow I prefer it.
@@ -2733,7 +2733,7 @@ (setq avy-all-windows nil
avy-keys '(?a ?r ?s ?t ?d ?h ?n ?e ?i ?\;)))) ;; #+END_SRC -;; **** ace-link +;;;;;;; ace-link ;; Visit any link. Despite the name, this works with avy.
@@ -2744,7 +2744,7 @@ :config (progn
(ace-link-setup-default))) ;; #+END_SRC -;; *** goto-chg +;;;;;; goto-chg ;; This is like popping the mark, only it filters to only change areas ;; and doesn’t go back to the same place more than once.
@@ -2754,7 +2754,7 @@ (use-package goto-chg
:bind ("C-c C-SPC" . goto-last-change)) ;; #+END_SRC -;; *** beginend +;;;;;; beginend ;; In special buffers, I would rather have =M->= and =M-<= goto the ;; logical beginning/end rather than the physical ones.
@@ -2765,7 +2765,7 @@ :config (progn
(beginend-setup-all))) ;; #+END_SRC -;; *** multiple-cursors +;;;;;; multiple-cursors ;; I mentioned before that I’d used Sublime Text before. Multiple ;; cursors was one of my favourite features, so I was really happy when I
@@ -2781,7 +2781,7 @@ ("C-<f3>" . mc/mark-more-like-this-extended)
("C-S-L" . mc/edit-lines))) ;; #+END_SRC -;; *** paredit +;;;;;; paredit ;; Balanced parentheses in lisps are nice, but all the refactoring and ;; movement commands are much more interesting.
@@ -2796,7 +2796,7 @@ (put #'paredit-backward-delete 'delete-selection 'supersede)
(add-hook 'eval-expression-minibuffer-setup-hook #'enable-paredit-mode))) ;; #+END_SRC -;; *** smartparens +;;;;;; smartparens ;; I like to use smartparens where paredit isn’t already useful. Somehow ;; I didn’t find smartparens’ implementation of paredit style to be as
@@ -2831,7 +2831,7 @@ (smartparens-mode -1))))
;; #+END_SRC -;; *** move-text +;;;;;; move-text ;; Transposing lines, made easier.
@@ -2840,7 +2840,7 @@ (use-package move-text
:config (move-text-default-bindings)) ;; #+END_SRC -;; *** undo-tree +;;;;;; undo-tree ;; Emacs’ default handling of undo is a bit confusing. Undo-tree makes ;; it much clearer. It’s especially helpful for protoyping and refactoring.
@@ -2863,14 +2863,14 @@ ad-do-it)))
:diminish undo-tree-mode) ;; #+END_SRC -;; *** replace +;;;;;; replace ;; #+BEGIN_SRC emacs-lisp (with-eval-after-load "replace.el" (setq case-replace nil)) ;; #+END_SRC -;; *** visual-regexp +;;;;;; visual-regexp ;; I don’t always remember exactly how Emacs’ regular expressions work, ;; so this package is pretty useful because it highlights everything in
@@ -2883,7 +2883,7 @@ ("C-c q" . vr/query-replace)
("C-c m" . vc/mc-mark))) ;; #+END_SRC -;; ** End +;;;;; End ;; Start a server if possible. A daemon is already a server. ;; #+BEGIN_SRC emacs-lisp