X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=emacs_el%2Fconfiguration%2Fdon-configuration.org;h=9feb84b0cfe744f80938a529c6266ba0bbea8e11;hb=f3b208423d1bef1d7a6fa4fcfbadb1eef1cb99c4;hp=46938a949cbcfec471d8c67b67a0f079e2a58902;hpb=ccba224ad52feefa16f86b8a208884241833667f;p=lib.git diff --git a/emacs_el/configuration/don-configuration.org b/emacs_el/configuration/don-configuration.org index 46938a9..9feb84b 100644 --- a/emacs_el/configuration/don-configuration.org +++ b/emacs_el/configuration/don-configuration.org @@ -26,16 +26,20 @@ #+END_SRC ** [[https://github.com/jwiegley/use-package/][use-package]] #+BEGIN_SRC emacs-lisp - (require 'use-package) (package-initialize) + (require 'use-package) #+END_SRC ** Paradox #+BEGIN_SRC emacs-lisp - (package-initialize) (use-package paradox :ensure paradox ) #+END_SRC +* Disable custom-vars +#+BEGIN_SRC emacs-lisp + ;; Set the custom file to /dev/null and don't bother to load it + (setq custom-file "/dev/null") +#+END_SRC * Misc functions ** with-library #+BEGIN_SRC emacs-lisp @@ -47,7 +51,17 @@ (put 'with-library 'lisp-indent-function 1) #+END_SRC - +* Variables +** Safe Local Variables +#+BEGIN_SRC emacs-lisp + (setq safe-local-variable-values + (quote ((auto-save-default) + (make-backup-files) + (cperl-indent-level . 4) + (indent-level . 4) + (indent-tabs-mode . f) + ))) +#+END_SRC * Memory #+BEGIN_SRC emacs-lisp (setq global-mark-ring-max 128 @@ -239,7 +253,6 @@ value, scrolling continues until there is no more output. #+END_SRC ** Snippets - *** Yasnippet #+BEGIN_SRC emacs-lisp (use-package yasnippet @@ -251,9 +264,21 @@ value, scrolling continues until there is no more output. (define-key yas-minor-mode-map (kbd "") nil) (define-key yas-minor-mode-map (kbd "TAB") nil) (define-key yas-minor-mode-map (kbd "") 'yas-expand) - )) + (setq yas-snippet-dirs '("~/lib/emacs_el/snippets/" + "~/lib/emacs_el/yasnippet-snippets/snippets/")) + (add-to-list 'hippie-expand-try-functions-list + 'yas-hippie-try-expand) + ) + ) +#+END_SRC +*** Auto-YASnippet +#+BEGIN_SRC emacs-lisp + (use-package auto-yasnippet + :bind (("H-w" . aya-create) + ("H-y" . aya-expand) + ) + ) #+END_SRC - ** Helm Flx [[https://github.com/PythonNut/helm-flx][helm-flx]] implements intelligent helm fuzzy sorting, provided by [[https://github.com/lewang/flx][flx]]. @@ -488,10 +513,6 @@ value, scrolling continues until there is no more output. ) #+END_SRC -** Org -#+BEGIN_SRC emacs-lisp - (require 'org-mode-configuration) -#+END_SRC *** Org-Gcal #+BEGIN_SRC emacs-lisp (use-package calfw @@ -511,7 +532,36 @@ value, scrolling continues until there is no more output. #+BEGIN_SRC emacs-lisp (use-package ess :ensure t - :config (require 'ess_configuration)) + :config + (defun ess-change-directory (path) + "Set the current working directory to PATH for both *R* and Emacs." + (interactive "DDirectory to change to: ") + + (when (file-exists-p path) + (ess-command (concat "setwd(\"" path "\")\n")) + ;; use file-name-as-directory to ensure it has trailing / + (setq default-directory (file-name-as-directory path)))) + (add-hook 'ess-mode-hook 'flyspell-prog-mode) + ;; outlining support for ess modes + (add-hook + 'ess-mode-hook + '(lambda () + (outline-minor-mode) + (setq outline-regexp "\\(^#\\{4,5\\} \\)\\|\\(^[a-zA-Z0-9_\.]+ ?<- ?function\\)") + (defun outline-level () + (cond ((looking-at "^##### ") 1) + ((looking-at "^#### ") 2) + ((looking-at "^[a-zA-Z0-9_\.]+ ?<- ?function(.*{") 3) + (t 1000))) + )) + (add-hook 'ess-mode-hook + '(lambda () + (local-set-key (kbd "C-c C-R") + 'dla/ess-region-remote-eval))) + + ;; Don't restore history or save workspace image + '(inferior-R-args "--no-restore-history --no-save") + ) #+END_SRC ** Rainbowmode @@ -555,6 +605,19 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori :config (atomic-chrome-start-server) ) #+END_SRC +** Multiple Cursors + :PROPERTIES: + :ID: 6fcf218b-a762-4c37-9339-a8202ddeb544 + :END: +[[https://github.com/magnars/multiple-cursors.el][Multiple Cursors]] +#+BEGIN_SRC emacs-lisp + (use-package multiple-cursors + :bind (("C-;" . mc/mark-all-dwim) + ("C-<" . mc/mark-previous-like-this) + ("C->" . mc/mark-next-like-this) + ("C-S-c C-S-c" . mc/edit-lines)) + ) +#+END_SRC * Org Mode ** Use-package and load things #+BEGIN_SRC emacs-lisp @@ -1253,6 +1316,21 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori (when (member (org-get-todo-state) org-todo-keywords-1) (setq has-subtask t)))) (and is-a-task (not has-subtask))))) + (defun bh/is-project-p () + "Any task with a todo keyword subtask" + (save-restriction + (widen) + (let ((has-subtask) + (subtree-end (save-excursion (org-end-of-subtree t))) + (is-a-task (member (nth 2 (org-heading-components)) org-todo-keywords-1))) + (save-excursion + (forward-line 1) + (while (and (not has-subtask) + (< (point) subtree-end) + (re-search-forward "^\*+ " subtree-end t)) + (when (member (org-get-todo-state) org-todo-keywords-1) + (setq has-subtask t)))) + (and is-a-task has-subtask)))) (defun bh/is-subproject-p () "Any task which is a subtask of another project" @@ -1523,7 +1601,6 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori (setq ps-print-footer t) (setq ps-print-footer-frame nil) (setq ps-print-only-one-header t) - (setq safe-local-variable-values (quote ((auto-save-default) (make-backup-files)))) (setq sentence-end "[.?!][]\"')]*\\($\\| \\| \\)[ ]*") (setq sentence-end-double-space nil) @@ -1771,11 +1848,6 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori ; don't use the multi-window configuration (setq ediff-window-setup-function 'ediff-setup-windows-plain) - ; use iedit - (require 'iedit) - (define-key global-map (kbd "C-;") 'iedit-mode) - (global-set-key (kbd "C-;") 'iedit-mode) - ; fix up css mode to not be silly ; from http://www.stokebloke.com/wordpress/2008/03/21/css-mode-indent-buffer-fix/ (setq cssm-indent-level 4) @@ -1928,7 +2000,7 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori (defvar my-keys-minor-mode-map (make-keymap) "my-keys-minor-mode keymap.") ; use iedit everywhere - (define-key my-keys-minor-mode-map (kbd "C-;") 'iedit-mode) + (define-key my-keys-minor-mode-map (kbd "C-;") 'mc/mark-all-dwim) (define-minor-mode my-keys-minor-mode "A minor mode so that my key settings override annoying major modes."