From 9cbe4dc1877a9ad431a5b989710b2e0cff8f3f13 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 1 May 2017 19:26:42 +0200 Subject: Emacs: Fix hook-helper startup error --- emacs/.emacs.d/init.org | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'emacs/.emacs.d') diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index af8b5a6..7ac459d 100644 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -90,7 +90,8 @@ modification and removal, without the boilerplate of an extra function definition. #+BEGIN_SRC emacs-lisp -(use-package hook-helpers) +(eval-and-compile + (use-package hook-helpers)) #+END_SRC * Customize -- cgit 1.4.1 From 6b7459d44bb7a162b1439c761d6c5ace197555e4 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 1 May 2017 19:26:56 +0200 Subject: Emacs: Replace deprecated system-name var with fun --- emacs/.emacs.d/init.org | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'emacs/.emacs.d') diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index 7ac459d..2b12d72 100644 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -1314,8 +1314,8 @@ information here as well. ; startup and caches it. Don't want emacs daemon to hang because of gpg-agent. (defun load-private-data () (interactive) - (if (not (file-exists-p (expand-file-name (concat system-name ".el.gpg") user-emacs-directory))) - (message "No encrypted configuration matches system name `%s'" system-name) + (if (not (file-exists-p (expand-file-name (concat (system-name) ".el.gpg") user-emacs-directory))) + (message "No encrypted configuration matches system name `%s'" (system-name)) (if (not have-private-key) (message "ERROR: Private GPG key not found") (unless (or (getenv "GPG_AGENT_INFO") @@ -1327,7 +1327,7 @@ information here as well. (pinentry-start) (add-hook 'kill-emacs-hook 'pinentry-stop)) (add-to-list 'load-suffixes ".el.gpg") - (load-gpg (expand-file-name system-name user-emacs-directory))))) + (load-gpg (expand-file-name (system-name) user-emacs-directory))))) (defun first-frame-hook (frame) (remove-hook 'after-make-frame-functions #'first-frame-hook) -- cgit 1.4.1 From 755ccce37c2e1e72e3934fd66009d1f510b9c456 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 4 May 2017 10:40:12 +0200 Subject: Emacs: Use counsel instead of ivy for imenu --- emacs/.emacs.d/init.org | 1 + 1 file changed, 1 insertion(+) (limited to 'emacs/.emacs.d') diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index 2b12d72..0f33162 100644 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -1419,6 +1419,7 @@ replacement for helm so far. (bind-key "C-c M-x" #'execute-extended-command) (bind-key "C-x C-f" #'counsel-find-file) (bind-key "M-y" #'counsel-yank-pop) + (bind-key "C-x i" #'counsel-imenu) (bind-key "M-y" #'ivy-next-line ivy-minibuffer-map) (defadvice counsel-find-file (after find-file-sudo activate) "Find file as root if necessary." -- cgit 1.4.1 From e4afa65a2fa90ba330b03f34e21cafa0b12b877b Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 4 May 2017 11:23:43 +0200 Subject: Emacs: Use counsel-imenu --- emacs/.emacs.d/init.org | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'emacs/.emacs.d') diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index 0f33162..72db3f1 100644 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -1371,7 +1371,6 @@ replacement for helm so far. (use-package swiper :bind (("C-s" . swiper) ("C-r" . swiper) - ("C-x i" . ivy-imenu-goto) ("C-=" . swiper)) :diminish ivy-mode :demand t @@ -1379,28 +1378,6 @@ replacement for helm so far. (ivy-mode 1) (setq ivy-re-builders-alist '((t . ivy--regex-plus)) ivy-extra-directories '("./")) - (defun ivy-imenu-get-candidates-from (alist &optional prefix) - (cl-loop for elm in alist - nconc (if (imenu--subalist-p elm) - (ivy-imenu-get-candidates-from - (cl-loop for (e . v) in (cdr elm) collect - (cons e (if (integerp v) (copy-marker v) v))) - (concat prefix (if prefix ".") (car elm))) - (and (cdr elm) ; bug in imenu, should not be needed. - (setcdr elm (copy-marker (cdr elm))) ; Same as [1]. - (list (cons (concat prefix (if prefix ".") (car elm)) - (copy-marker (cdr elm)))))))) - - (defun ivy-imenu-goto () - "Go to buffer position" - (interactive) - (let ((imenu-auto-rescan t) items) - (unless (featurep 'imenu) - (require 'imenu nil t)) - (setq items (imenu--make-index-alist t)) - (ivy-read "imenu items:" - (ivy-imenu-get-candidates-from (delete (assoc "*Rescan*" items) items)) - :action (lambda (k) (goto-char k))))) (ivy-set-actions 'ivy-switch-buffer '(("k" (lambda (x) (kill-buffer x) (ivy--reset-state ivy-last)) -- cgit 1.4.1 From a25863baab734e3ec7e9957823196158fc944281 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 4 May 2017 13:20:01 +0200 Subject: Emacs: Install and configure eyebrowse --- emacs/.emacs.d/init.org | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'emacs/.emacs.d') diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index 72db3f1..786411b 100644 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -906,6 +906,27 @@ point whilst I’m moving about. (setq ns-pop-up-frames nil)) #+END_SRC +** eyebrowse + +Workspaces, a bit like dwm. + +#+BEGIN_SRC emacs-lisp +(use-package eyebrowse + :bind (("s-0" . eyebrowse-switch-to-window-config-0) + ("s-1" . eyebrowse-switch-to-window-config-1) + ("s-2" . eyebrowse-switch-to-window-config-2) + ("s-3" . eyebrowse-switch-to-window-config-3) + ("s-4" . eyebrowse-switch-to-window-config-4) + ("s-5" . eyebrowse-switch-to-window-config-5) + ("s-6" . eyebrowse-switch-to-window-config-6) + ("s-7" . eyebrowse-switch-to-window-config-7) + ("s-8" . eyebrowse-switch-to-window-config-8) + ("s-9" . eyebrowse-switch-to-window-config-9)) + :config (progn + (setq eyebrowse-new-workspace t) + (eyebrowse-mode +1))) +#+END_SRC + ** winner Undo, for window-based commands. -- cgit 1.4.1 From 9934d6381e2b8fcf313f67986adae9de97e89fc8 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 5 May 2017 14:56:45 +0200 Subject: Emacs: Unset cursor type A new version of multiple-cursors tries to mimic a bar cursor, but it uses a taller character in the Monaco-10 font, so the lines jump around. --- emacs/.emacs.d/init.org | 1 - 1 file changed, 1 deletion(-) (limited to 'emacs/.emacs.d') diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index 786411b..aad14dc 100644 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -180,7 +180,6 @@ Let’s try a basic theme. (setq-default mode-line-format nil) (setq mode-line-default-hidden t))) - (setq-default cursor-type '(bar . 1)) (setq-default cursor-in-non-selected-windows nil) (defun hide-clutter () -- cgit 1.4.1 From e4300ae832559cf882db393e3ca9348ff9bf7864 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 5 May 2017 14:58:56 +0200 Subject: Emacs: Auto-add node_modules bin folders to path --- emacs/.emacs.d/init.org | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'emacs/.emacs.d') diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index aad14dc..b9dbfe0 100644 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -1999,6 +1999,17 @@ library implements some refactorings. (js2r-add-keybindings-with-prefix "C-c C-m"))) #+END_SRC +**** 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. + +#+BEGIN_SRC emacs-lisp +(use-package add-node-modules-path + :config (progn + (add-hook 'js2-mode-hook #'add-node-modules-path))) +#+END_SRC + **** jade (not pug) Javascript with an inferior node.js process and a debugger? Awesome. -- cgit 1.4.1 From 52efa35ec7babf988fc81048d89d367005ceee24 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 5 May 2017 21:23:00 +0200 Subject: Emacs: Re-enable melpa I keep reading that melpa-stable isn't really supposed to be used. I'm not sure what it's purpose is, therefore. I liked the idea of having only versioned plugins as it had a reduced chance of breaking things. --- emacs/.emacs.d/init.org | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'emacs/.emacs.d') diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index b9dbfe0..1ff42a2 100644 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -56,10 +56,10 @@ the buffer to be empty. package-pinned-packages '(("use-package" . melpa-stable) ("diminish" . melpa-stable) ("bind-key" . melpa-stable)) - package-archive-priorities '(("melpa-stable" . 10) + package-archive-priorities '(("melpa" . 10) ("gnu" . 10) - ("marmalade" . 5) - ("melpa" . 0)) + ("melpa-stable" . 5) + ("marmalade" . 0)) package-menu-async t package-menu-hide-low-priority t) (when (eq system-type 'darwin) -- cgit 1.4.1 From b4aa77214316958742e5e45b03a443e5b39d877d Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 8 May 2017 14:02:19 +0200 Subject: Emacs: Remove org-page setup It doesn't seem suitable for me. It includes javascript, in particular for code snippet rendering and doesn't allow templates to be defined. --- emacs/.emacs.d/init.org | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'emacs/.emacs.d') diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index 1ff42a2..67c842f 100644 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -1666,19 +1666,6 @@ I can use this to keep a journal. I should use it. (org-journal-read-or-display-entry (yesterday-time))))) #+END_SRC -**** org-page - -I would like to convert my website from using hugo to something else -that I can work with nicely from inside Emacs. I wonder if org-page -will do the trick. - -#+BEGIN_SRC emacs-lisp -(use-package org-page - :config (progn - (setq op/site-domain "https://alanpearce.uk/" - op/repository-directory "~/projects/alanpearce/" - op/personal-github-link "https://github.com/alanpearce"))) -#+END_SRC * Music Emacs actually supports playing music via mpd. -- cgit 1.4.1 From c84f0d2d15bb70946ef071f6def5f44e0f2656cf Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 8 May 2017 14:07:40 +0200 Subject: Emacs: Move window chrome configuration to own block It's not really related to a specific theme. --- emacs/.emacs.d/init.org | 116 +++++++++++++++++++++++++----------------------- 1 file changed, 61 insertions(+), 55 deletions(-) (limited to 'emacs/.emacs.d') diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index 67c842f..668fdb4 100644 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -161,61 +161,7 @@ Let’s try a basic theme. (set-face-background 'vertical-border "#a1b56c") (set-face-foreground 'vertical-border "#a1b56c") (set-face-background 'window-divider "#a1b56c") - (set-face-foreground 'window-divider "#a1b56c") - - (defvar mode-line-default-format mode-line-format) - (defvar mode-line-default-hidden nil - "Whether to hide the mode line by default") - - (defun show-mode-line () - (interactive) - (setq mode-line-format mode-line-default-format) - (when (called-interactively-p 'interactive) - (setq-default mode-line-format mode-line-default-format) - (setq mode-line-default-hidden nil))) - (defun hide-mode-line () - (interactive) - (setq mode-line-format nil) - (when (called-interactively-p 'interactive) - (setq-default mode-line-format nil) - (setq mode-line-default-hidden t))) - - (setq-default cursor-in-non-selected-windows nil) - - (defun hide-clutter () - (interactive) - (fringe-mode '(4 . 8)) - (hide-mode-line)) - - (defun show-clutter () - (interactive) - (fringe-mode '(8 . 8)) - (show-mode-line)) - (hide-clutter) - - (when mode-line-default-hidden - (call-interactively #'hide-mode-line)) - - (setq-default indicate-buffer-boundaries 'left) - - (defun hide-mode-line-if-default-hidden () - (if mode-line-default-hidden - (hide-mode-line) - (show-mode-line))) - - (add-to-list 'default-frame-alist '(border-width . 0)) - (add-to-list 'default-frame-alist '(internal-border-width . 0)) - (when (eq window-system 'x) - (setq window-divider-default-bottom-width 1 - window-divider-default-right-width 1 - window-divider-default-places t) - (setq mode-line-default-hidden t) - (window-divider-mode +1)) - - (add-hook 'after-change-major-mode-hook #'hide-mode-line-if-default-hidden) - - (add-hook 'minibuffer-setup-hook #'show-mode-line) - (add-hook 'minibuffer-exit-hook #'hide-mode-line))) + (set-face-foreground 'window-divider "#a1b56c"))) #+END_SRC Highlighting quasi-quoted expressions in lisps is quite useful, but I @@ -303,6 +249,66 @@ correct, at least for Liberation Mono. (setq frame-title-format '("%f" (dired-directory dired-directory))) #+END_SRC +** Chrome + +Sometimes I like to hide clutter. Other times, it's useful. + +#+BEGIN_SRC emacs-lisp +(defvar mode-line-default-format mode-line-format) +(defvar mode-line-default-hidden nil + "Whether to hide the mode line by default") + +(defun show-mode-line () + (interactive) + (setq mode-line-format mode-line-default-format) + (when (called-interactively-p 'interactive) + (setq-default mode-line-format mode-line-default-format) + (setq mode-line-default-hidden nil))) +(defun hide-mode-line () + (interactive) + (setq mode-line-format nil) + (when (called-interactively-p 'interactive) + (setq-default mode-line-format nil) + (setq mode-line-default-hidden t))) + +(setq-default cursor-in-non-selected-windows nil) + +(defun hide-clutter () + (interactive) + (fringe-mode '(4 . 8)) + (hide-mode-line)) + +(defun show-clutter () + (interactive) + (fringe-mode '(8 . 8)) + (show-mode-line)) +(hide-clutter) + +(when mode-line-default-hidden + (call-interactively #'hide-mode-line)) + +(setq-default indicate-buffer-boundaries 'left) + +(defun hide-mode-line-if-default-hidden () + (if mode-line-default-hidden + (hide-mode-line) + (show-mode-line))) + +(add-to-list 'default-frame-alist '(border-width . 0)) +(add-to-list 'default-frame-alist '(internal-border-width . 0)) +(when (eq window-system 'x) + (setq window-divider-default-bottom-width 1 + window-divider-default-right-width 1 + window-divider-default-places t) + (setq mode-line-default-hidden t) + (window-divider-mode +1)) + +(add-hook 'after-change-major-mode-hook #'hide-mode-line-if-default-hidden) + +(add-hook 'minibuffer-setup-hook #'show-mode-line) +(add-hook 'minibuffer-exit-hook #'hide-mode-line) +#+END_SRC + ** Highlight Changes Highlight what just changed when I undo, yank, and so on. -- cgit 1.4.1 From bb0338c94a1ce73394a3e9f4eb418110a8a29821 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 8 May 2017 14:08:19 +0200 Subject: Emacs: Increase font size I started working in a new office, with the screen further away. I don't think Monaco 10 will be comfortable for long periods of work --- emacs/.emacs.d/init.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'emacs/.emacs.d') diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index 668fdb4..07ce03a 100644 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -207,7 +207,7 @@ because I manage those in my [[file:~/projects/dotfiles/tag-xresources/xresource (let ((displays (string-to-number (shell-command-to-string "system_profiler SPDisplaysDataType | grep \"Online: Yes\" | wc -l")))) (if (eq displays 1) (ap/set-fonts "Lekton" 20 "Lucida Grande" 16 t) - (ap/set-fonts "Monaco" 10 "Lucida Grande" 12 nil 0.1)))) + (ap/set-fonts "Monaco" 14 "Lucida Grande" 12 nil 0.1)))) ((eq window-system 'x) (set-fontset-font "fontset-default" 'unicode (font-spec :name "Terminus" :size 14)) (ap/set-fonts "Fixed" 14 "Lucida" 14 nil)))) -- cgit 1.4.1 From e71d8e38157f7952f6c70f1c43110d67799b3fe5 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 8 May 2017 15:25:03 +0200 Subject: Emacs: Remove missing packages - xrdb-mode - smart-scan --- emacs/.emacs.d/init.org | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'emacs/.emacs.d') diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index 07ce03a..eb5bd2b 100644 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -1486,11 +1486,6 @@ set environment variables for projects. Some modes that I don’t really customise much, mostly for configuration files. #+BEGIN_SRC emacs-lisp -(use-package xrdb-mode - :ensure nil - :mode (("\\.Xdefaults\\'" . xrdb-mode) - ("\\.Xresources\\'" . xrdb-mode))) - (use-package haskell-mode :mode (("\\.hs\\'" . haskell-mode))) @@ -2475,16 +2470,6 @@ nice as the real version (add-hook 'coffee-mode-hook #'turn-off-smartparens-mode))) #+END_SRC -** smart-scan - -Move between instances of a symbol - -#+BEGIN_SRC emacs-lisp -(use-package smartscan - :config (progn - (global-smartscan-mode 1) - (setq smartscan-symbol-selector "symbol"))) -#+END_SRC ** move-text -- cgit 1.4.1 From 72551a93b109857bc9c2c044e253156ce90a75db Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 8 May 2017 17:07:53 +0200 Subject: Emacs: Try eziam-light-theme --- emacs/.emacs.d/init.org | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'emacs/.emacs.d') diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index eb5bd2b..e82c40e 100644 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -152,6 +152,7 @@ Let’s try a basic theme. #+BEGIN_SRC emacs-lisp (use-package basic-theme :if (display-graphic-p) + :disabled t :config (progn (load-theme 'basic t) @@ -164,6 +165,17 @@ Let’s try a basic theme. (set-face-foreground 'window-divider "#a1b56c"))) #+END_SRC +Eziam looks nice, too + +#+BEGIN_SRC emacs-lisp +(use-package eziam-light-theme + :ensure eziam-theme + :defines (eziam-scale-headings) + :config (progn + (setq eziam-scale-headings nil) + (load-theme 'eziam-light t))) +#+END_SRC + Highlighting quasi-quoted expressions in lisps is quite useful, but I don't need it all the time. I'll keep it around for a while so that I can enable it if needed. -- cgit 1.4.1 From 1e375acc1cb7d23775fd39df71c0206fc66392ac Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 8 May 2017 17:08:06 +0200 Subject: Emacs: Make macOS variable-pitch font size consistent --- emacs/.emacs.d/init.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'emacs/.emacs.d') diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index e82c40e..5d115d9 100644 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -219,7 +219,7 @@ because I manage those in my [[file:~/projects/dotfiles/tag-xresources/xresource (let ((displays (string-to-number (shell-command-to-string "system_profiler SPDisplaysDataType | grep \"Online: Yes\" | wc -l")))) (if (eq displays 1) (ap/set-fonts "Lekton" 20 "Lucida Grande" 16 t) - (ap/set-fonts "Monaco" 14 "Lucida Grande" 12 nil 0.1)))) + (ap/set-fonts "Monaco" 14 "Lucida Grande" 14 nil 0.1)))) ((eq window-system 'x) (set-fontset-font "fontset-default" 'unicode (font-spec :name "Terminus" :size 14)) (ap/set-fonts "Fixed" 14 "Lucida" 14 nil)))) -- cgit 1.4.1 From 4bdc613a8980602dd35ec0ead87c6411ae4590de Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 10 May 2017 10:45:03 +0200 Subject: Emacs: replace Jade (JS IDE) with Indium Jade was renamed due to trademark issues. --- emacs/.emacs.d/init.org | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'emacs/.emacs.d') diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index 5d115d9..129ac66 100644 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -2010,19 +2010,28 @@ the project. This will allows emacs to find their executables. (add-hook 'js2-mode-hook #'add-node-modules-path))) #+END_SRC -**** jade (not pug) +**** Indium Javascript with an inferior node.js process and a debugger? Awesome. To debug with node, use version 6.9.1 or later of node and run it with ~--inspect~ and, to break on the first line, ~--debug-brk~. -For Chrom*, it needs to be launched with ~--remote-debugging-port=9222~ +For Chrom*, it needs to be launched with +~--remote-debugging-port=9222~ + +Node will tell you to open an URL in Chrome: + +~chrome-devtools://inspector.html?...&ws=127.0.0.1:PORT/PATH~ + +Instead, do this: + +~M-x indium-connect-to-nodejs RET 127.0.0.1 RET PORT RET~ #+BEGIN_SRC emacs-lisp -(use-package jade +(use-package indium :config (progn - (add-hook 'js2-mode-hook #'jade-interaction-mode))) + (add-hook 'js2-mode-hook #'indium-interaction-mode))) #+END_SRC *** coffee-mode -- cgit 1.4.1 From 36cfb5b801d13bf3ff102a31512613366a296edc Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 10 May 2017 14:47:04 +0200 Subject: Emacs: Re-bind execute-extended-command Move it away from eval-defun, as C-u C-M-x is useful for debugging elisp --- emacs/.emacs.d/init.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'emacs/.emacs.d') diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index 129ac66..6f6b753 100644 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -437,7 +437,7 @@ Option/alt, then Control. (bind-key* "s-x" (define-prefix-command 'super-x-map)) (bind-key* "s-," #'switch-to-dotfiles) -(bind-key* "C-M-x" #'execute-extended-command) +(bind-key* "C-x M-x" #'execute-extended-command) (set-register ?z `(file . ,(expand-file-name ".config/zsh/zshrc" "~"))) #+END_SRC -- cgit 1.4.1 From 56b360cb19bb36c4be4b7d3b4013e519f1f0b9c3 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 10 May 2017 15:00:32 +0200 Subject: Update email addresses --- emacs/.emacs.d/init.org | 2 +- git/.config/git/config | 4 ++-- hg/.hgrc | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'emacs/.emacs.d') diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index 6f6b753..7cdf209 100644 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -37,7 +37,7 @@ the buffer to be empty. ** Personal Information #+BEGIN_SRC emacs-lisp -(setq user-mail-address "alan@alanpearce.co.uk" +(setq user-mail-address "alan@alanpearce.eu" user-full-name "Alan Pearce") #+end_src diff --git a/git/.config/git/config b/git/.config/git/config index 579c226..f3a62f6 100644 --- a/git/.config/git/config +++ b/git/.config/git/config @@ -1,5 +1,5 @@ [user] - email = alan@alanpearce.uk + email = alan@alanpearce.eu name = Alan Pearce [color] branch = auto @@ -21,7 +21,7 @@ pr = pull-request delete-merged = "!sh -c 'git branch --merged | grep -v "\\*" | grep -v master | grep -v dev | xargs -n 1 git branch -d'" [github] - user = alan@alanpearce.uk + user = alan@alanpearce.eu [ghq "ssh://alanpearce.eu/"] vcs = git [includeIf "gitdir:github.com/Spotcap/"] diff --git a/hg/.hgrc b/hg/.hgrc index 2f16f27..9cd0315 100644 --- a/hg/.hgrc +++ b/hg/.hgrc @@ -1,5 +1,5 @@ [ui] -username = Alan Pearce +username = Alan Pearce [extensions] purge = -- cgit 1.4.1 From b53d38cfcd688467a7133d6077d62467946522ee Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 10 May 2017 16:10:53 +0200 Subject: Emacs: Configure desktop mode Auto-save Emacs' state if a desktop file exists. This is probably as DWIM as I need. --- emacs/.emacs.d/init.org | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'emacs/.emacs.d') diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index 7cdf209..96b3fe9 100644 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -944,6 +944,27 @@ Workspaces, a bit like dwm. (eyebrowse-mode +1))) #+END_SRC +* Sessions + +** Desktop +Save my Emacs session and restore it on startup. + +#+BEGIN_SRC emacs-lisp +(use-package desktop + :ensure nil + :config (progn + (setq desktop-dirname (expand-file-name "desktop/" user-emacs-directory) + desktop-base-file-name "emacs.desktop" + desktop-base-lock-name "lock" + desktop-path (list desktop-dirname) + desktop-save 'if-exists + desktop-files-not-to-save "^$" + desktop-load-locked-desktop nil) + (unless (file-directory-p desktop-dirname) + (make-directory desktop-dirname)) + (desktop-save-mode 1))) +#+END_SRC + ** winner Undo, for window-based commands. -- cgit 1.4.1 From 3559998106d1fddaf20022509a003f3721026253 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 11 May 2017 11:58:28 +0200 Subject: Emacs: Improve org-mode navigation --- emacs/.emacs.d/init.org | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'emacs/.emacs.d') diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index 96b3fe9..afa594e 100644 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -1656,6 +1656,10 @@ Org is wünderbar. (plain-list-item . auto)) org-fontify-done-headline t + org-goto-interface 'outline-path-completion + + org-outline-path-complete-in-steps nil + org-todo-keywords '((sequence "BACKLOG(b)" "TODO(t)" "WAIT(w@/!)" "STARTED(s!)" "|" "DONE(d!)") (sequence "|" "CANCELLED(c@)")) org-log-into-drawer "LOGBOOK") -- cgit 1.4.1 From d072b85a000e9f81ff6685fb39422825ceb218c8 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 11 May 2017 11:58:45 +0200 Subject: Emacs: Setup beginend mode --- emacs/.emacs.d/init.org | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'emacs/.emacs.d') diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index afa594e..d9a9ab0 100644 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -2449,6 +2449,17 @@ and doesn’t go back to the same place more than once. :bind ("C-c C-SPC" . goto-last-change)) #+END_SRC +** beginend + +In special buffers, I would rather have =M->= and =M-<= goto the +logical beginning/end rather than the physical ones. + +#+BEGIN_SRC emacs-lisp +(use-package beginend + :config (progn + (beginend-setup-all))) +#+END_SRC + ** multiple-cursors I mentioned before that I’d used Sublime Text before. Multiple -- cgit 1.4.1 From 26ab88d706e7de3a10310ab0b50cea62b8b0f23a Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 12 May 2017 14:47:56 +0200 Subject: Emacs: Fix initialisation of tern-mode --- emacs/.emacs.d/init.org | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'emacs/.emacs.d') diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index d9a9ab0..d55445b 100644 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -2080,8 +2080,10 @@ completions, besides other IDE-like things. :defer 5 :config (progn (setq tern-command (list (executable-find "tern"))) - (add-hook 'js2-mode-hook #'tern-mode-enable) - (add-hook 'web-mode-hook #'tern-mode-enable))) + (create-hook-helper tern-mode-on () + :hooks (web-mode-hook + js2-mode-hook) + (tern-mode +1)))) (with-eval-after-load 'tern (use-package company-tern)) -- cgit 1.4.1 From 0aaf9b4337cee8847a1732b56224a15e7b9c4dc6 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 12 May 2017 15:50:52 +0200 Subject: Emacs: Use any eslint_d instead of global With the package add-node-modules-path, this allows using a local version of eslint_d --- emacs/.emacs.d/init.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'emacs/.emacs.d') diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index d55445b..f87f7c4 100644 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -1727,7 +1727,7 @@ On-the-fly error checking in programming modes? Yes please. (global-flycheck-mode) (setq flycheck-check-syntax-automatically '(save new-line mode-enabled)) (if (executable-find "eslint_d") - (setq flycheck-javascript-eslint-executable (executable-find "eslint_d"))))) + (setq flycheck-javascript-eslint-executable "eslint_d")))) #+END_SRC ** golang -- cgit 1.4.1 From 3b8e49259080ac24eb4015d9a8ce94aba753e123 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 12 May 2017 15:51:30 +0200 Subject: Emacs: Setup flycheck-flow --- emacs/.emacs.d/init.org | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'emacs/.emacs.d') diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index f87f7c4..628c90e 100644 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -1730,6 +1730,14 @@ On-the-fly error checking in programming modes? Yes please. (setq flycheck-javascript-eslint-executable "eslint_d")))) #+END_SRC +*** flycheck-flow + +#+BEGIN_SRC emacs-lisp +(use-package flycheck-flow + :config (progn + (flycheck-add-next-checker 'javascript-eslint 'javascript-flow))) +#+END_SRC + ** golang Go has a few packages to inter-operate with other emacs packages. -- cgit 1.4.1