X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=emacs_el%2Fconfiguration%2Fdon-configuration.org;h=7041c9eb7107c956a27223f17c772d488ed5ca21;hb=f332beaa8116b52c0d46c88c27a60ccce4df3b49;hp=3c981430d2bdd49cb9aef5a28be4087f96f67640;hpb=59e5e84dc6d62773e64bf7786dfe9fb7fde0bd50;p=lib.git diff --git a/emacs_el/configuration/don-configuration.org b/emacs_el/configuration/don-configuration.org index 3c98143..7041c9e 100644 --- a/emacs_el/configuration/don-configuration.org +++ b/emacs_el/configuration/don-configuration.org @@ -30,6 +30,9 @@ load [[https://github.com/jwiegley/use-package/][use-package]] even faster #+BEGIN_SRC emacs-lisp (setq package-enable-at-startup nil) (setq package--init-file-ensured t) + (setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/") + ("melpa" . "https://melpa.org/packages/") + ("org" . "http://orgmode.org/elpa/") )) (eval-and-compile (setq use-package-verbose (not (bound-and-true-p byte-compile-current-file)))) (mapc #'(lambda (add) (add-to-list 'load-path add)) @@ -49,9 +52,6 @@ load [[https://github.com/jwiegley/use-package/][use-package]] even faster nil)) load-path)))))) - (setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/") - ("melpa" . "https://melpa.org/packages/") - ("org" . "http://orgmode.org/elpa/") )) (require 'use-package) (require 'diminish) (require 'bind-key) @@ -774,14 +774,16 @@ This can be used to link things pretty quickly if necessary ** Tramp #+BEGIN_SRC emacs-lisp - (add-to-list 'tramp-methods '("vcsh" - (tramp-login-program "vcsh") - (tramp-login-args - (("enter") - ("%h"))) - (tramp-remote-shell "/bin/sh") - (tramp-remote-shell-args - ("-c")))) + (use-package tramp + :config + (add-to-list 'tramp-methods '("vcsh" + (tramp-login-program "vcsh") + (tramp-login-args + (("enter") + ("%h"))) + (tramp-remote-shell "/bin/sh") + (tramp-remote-shell-args + ("-c"))))) #+END_SRC ** Reftex #+BEGIN_SRC emacs-lisp @@ -917,7 +919,12 @@ This can be used to link things pretty quickly if necessary :mode ("\\.R\\'" . ess-r-mode) :bind (:map ess-mode-map ("C-c C-R" . dla/ess-region-remote-eval)) + :init + (autoload 'ess-r-mode "ess-site" nil t) + (autoload 'R "ess-site" nil t) :config + ; actually load the rest of ess + (require 'ess-site) (defun ess-change-directory (path) "Set the current working directory to PATH for both *R* and Emacs." (interactive "Directory to change to: ") @@ -977,6 +984,15 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori *** Outline magic #+BEGIN_SRC emacs-lisp (use-package outline-magic) +#+END_SRC +*** Outline mode +#+BEGIN_SRC emacs-lisp +;; change the outline mode prefix from C-c @ to C-c C-2 +(setq outline-minor-mode-prefix "C-c C-2") +;;(add-hook 'outline-minor-mode-hook +;; (lambda () (local-set-key (kbd "C-c C-2") +;; outline-mode-prefix-map))) + #+END_SRC ** Writeroom Mode #+BEGIN_SRC emacs-lisp @@ -1041,7 +1057,7 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori #+BEGIN_SRC emacs-lisp (use-package password-store :ensure f - :commands password-store-edit password-store-create + :commands password-store-edit password-store-generate ) #+END_SRC ** CSS mode @@ -1132,10 +1148,13 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori * Base emacs ** Reverting buffers #+BEGIN_SRC emacs-lisp - (setq global-auto-revert-non-file-buffers t - global-auto-revert-ignore-modes '(pdf-view-mode) - auto-revert-verbose nil) - (global-auto-revert-mode 1) + (use-package autorevert + :diminish auto-revert-mode + :config + (setq global-auto-revert-non-file-buffers t + global-auto-revert-ignore-modes '(pdf-view-mode) + auto-revert-verbose nil) + (global-auto-revert-mode 1)) #+END_SRC * Org Mode ** Use-package and load things @@ -1143,15 +1162,13 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori (use-package org :delight (org-mode "ø") - :config - + :mode ("\\.\\(org\\|org_archive\\|txt\\)\\'" . org-mode) + :bind (("C-c l" . org-store-link) + ("C-c a" . org-agenda) + ("C-c b" . org-iswitchb)) #+END_SRC ** Agenda Configuration #+BEGIN_SRC emacs-lisp - :mode ("\\.\\(org\\|org_archive\\|txt\\)\\'" . org-mode) - :bind (("C-c l" . org-store-link) - ("C-c a" . org-agenda) - ("C-c b" . org-iswitchb)) :config (setq-default org-log-done 'time) (setq-default org-agenda-ndays 5) @@ -1335,50 +1352,45 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori #+END_SRC ** Org mode key bindings #+BEGIN_SRC emacs-lisp - ; org mode configuration from http://doc.norang.ca/org-mode.html + ;; org mode configuration from http://doc.norang.ca/org-mode.html ;; Custom Key Bindings - (global-set-key (kbd "") 'org-agenda) - ; (global-set-key (kbd "") 'bh/org-todo) - (global-set-key (kbd "") 'bh/widen) - (global-set-key (kbd "") 'bh/set-truncate-lines) - (global-set-key (kbd "") 'org-cycle-agenda-files) - (global-set-key (kbd " ") 'bh/show-org-agenda) - (global-set-key (kbd " b") 'bbdb) - (global-set-key (kbd " c") 'calendar) - (global-set-key (kbd " f") 'boxquote-insert-file) - (global-set-key (kbd " h") 'bh/hide-other) - (global-set-key (kbd " n") 'bh/toggle-next-task-display) - (global-set-key (kbd " w") 'widen) - - ; change the outline mode prefix from C-c @ to C-c C-2 - (setq outline-minor-mode-prefix "C-c C-2") - ;(add-hook 'outline-minor-mode-hook - ; (lambda () (local-set-key (kbd "C-c C-2") - ; outline-mode-prefix-map))) - - (global-set-key (kbd " I") 'bh/punch-in) - (global-set-key (kbd " O") 'bh/punch-out) - - (global-set-key (kbd " o") 'bh/make-org-scratch) - - (global-set-key (kbd " r") 'boxquote-region) - (global-set-key (kbd " s") 'bh/switch-to-scratch) - - (global-set-key (kbd " t") 'bh/insert-inactive-timestamp) - (global-set-key (kbd " T") 'bh/toggle-insert-inactive-timestamp) - - (global-set-key (kbd " v") 'visible-mode) - (global-set-key (kbd " l") 'org-toggle-link-display) - (global-set-key (kbd " SPC") 'bh/clock-in-last-task) - (global-set-key (kbd "C-") 'previous-buffer) - (global-set-key (kbd "M-") 'org-toggle-inline-images) - (global-set-key (kbd "C-x n r") 'narrow-to-region) - (global-set-key (kbd "C-") 'next-buffer) - (global-set-key (kbd "") 'org-clock-goto) - (global-set-key (kbd "C-") 'org-clock-in) - (global-set-key (kbd "C-s-") 'bh/save-then-publish) - (global-set-key (kbd "C-c c") 'org-capture) - + :bind* ((" a" . org-agenda) + (" I" . bh/punch-in) + (" O" . bh/punch-out) + (" SPC" . bh/clock-in-last-task) + ("" . org-agenda) + ;; ("" . bh/org-todo) + ("" . bh/widen) + ("" . bh/set-truncate-lines) + ("" . org-cycle-agenda-files) + (" " . bh/show-org-agenda) + (" b" . bbdb) + (" c" . calendar) + (" f" . boxquote-insert-file) + (" h" . bh/hide-other) + (" n" . bh/toggle-next-task-display) + (" w" . widen) + + (" o" . bh/make-org-scratch) + + (" r" . boxquote-region) + (" s" . bh/switch-to-scratch) + + (" t" . bh/insert-inactive-timestamp) + (" T" . bh/toggle-insert-inactive-timestamp) + + (" v" . visible-mode) + (" l" . org-toggle-link-display) + (" SPC" . bh/clock-in-last-task) + ("C-" . previous-buffer) + ("M-" . org-toggle-inline-images) + ("C-x n r" . narrow-to-region) + ("C-" . next-buffer) + ("" . org-clock-goto) + ("C-" . org-clock-in) + ("C-s-" . bh/save-then-publish) + ("C-c c" . org-capture)) + :config #+END_SRC ** Utility Functions #+BEGIN_SRC emacs-lisp @@ -1419,6 +1431,11 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori do not already have one." (interactive) (org-map-entries 'org-id-get-create)) + (defun dla/org-update-ids-to-headlines-in-file () + "Add or replace ID properties to all headlines in the current file + (or narrowed region)." + (interactive) + (org-map-entries '(lambda () (org-id-get-create t)))) ; if we wanted to do this to every buffer, do the following: ; (add-hook 'org-mode-hook ; (lambda () @@ -2211,8 +2228,8 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori If the envvar EMACS_SERVER_NAME is set, consider this a separate emacs, and use a different desktop file to restore history #+BEGIN_SRC emacs-lisp - (use-package desktop-save - :defer f + (use-package emacs + :demand :config (setq desktop-base-file-name (convert-standard-filename @@ -2225,9 +2242,11 @@ emacs, and use a different desktop file to restore history (convert-standard-filename (concat desktop-base-file-name ".lock"))) - (desktop-save-mode 1) (setq desktop-auto-save-timeout 60) - (desktop-read) + (setq desktop-restore-eager 5) + (setq desktop-lazy-verbose nil) + (desktop-save-mode 1) + ; (desktop-read) ) #+END_SRC ** Misc (Uncharacterized) @@ -2386,7 +2405,7 @@ emacs, and use a different desktop file to restore history :config (setq server-name (or (getenv "EMACS_SERVER_NAME") - "emacs")) + "server")) (unless (server-running-p) (global-set-key "\C-xp" 'server-edit) (server-start)))