summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2016-05-19 20:27:12 +0200
committerAlan Pearce2016-05-19 20:27:12 +0200
commit93be44615b0177b103685706e633a0a25a6bfb1f (patch)
treee8c95a9a7a9fec2e8d40ca3cb5fd921820d218c2
parent1b00e6986da83a489c211b7f128fb335dd218ee7 (diff)
parentaceb35a7305b36a7be4b5f10bdd15e21d079b948 (diff)
downloadnixfiles-93be44615b0177b103685706e633a0a25a6bfb1f.tar.lz
nixfiles-93be44615b0177b103685706e633a0a25a6bfb1f.tar.zst
nixfiles-93be44615b0177b103685706e633a0a25a6bfb1f.zip
Merge branch 'master' of home:projects/dotfiles
-rw-r--r--tag-emacs/emacs.d/init.org98
1 files changed, 28 insertions, 70 deletions
diff --git a/tag-emacs/emacs.d/init.org b/tag-emacs/emacs.d/init.org
index d11798ad..2ec219d7 100644
--- a/tag-emacs/emacs.d/init.org
+++ b/tag-emacs/emacs.d/init.org
@@ -205,6 +205,17 @@ By default, Emacs displays page breaks as ^L.  Lines look much nicer.
           '("%f" (dired-directory dired-directory)))
 #+END_SRC
 
+** Highlight Changes
+
+Highlight what just changed when I undo, yank, and so on.
+
+#+BEGIN_SRC emacs-lisp
+  (use-package volatile-highlights
+    :diminish volatile-highlights-mode
+    :config (progn
+              (volatile-highlights-mode t)))
+#+END_SRC
+
 ** Renaming major modes
 
 Diminishing major modes does not happen in the same manner as minor
@@ -327,14 +338,7 @@ based upon some folder conventions I use.
                                                  projectile-project-root-files-functions))
                                 (-filter #'file-directory-p (directory-files dir t "\\<")))))
 
-              (defun ap/-add-known-subfolder-projects (dir)
-                (-map #'projectile-add-known-project (--map (concat (file-name-as-directory dir) it) (ap/subfolder-projects dir))))
-
-              (defun ap/add-known-subfolder-projects ()
-                (interactive)
-                (ap/-add-known-subfolder-projects (read-directory-name "Add projects under: ")))
-
-              (defun ap/open-subfolder-project (from-dir &optional arg)
+               (defun ap/open-subfolder-project (from-dir &optional arg)
                 (let ((project-dir (projectile-completing-read "Open project: "
                                                                (ap/subfolder-projects from-dir))))
                   (projectile-switch-project-by-name (expand-file-name project-dir from-dir) arg)))
@@ -352,14 +356,6 @@ based upon some folder conventions I use.
                     projectile-completion-system 'ivy)))
 #+END_SRC
 
-I use [[https://github.com/direnv/direnv][direnv]] to automatically assign environment variables in project
-directories.  Now I can have them set inside emacs too.
-
-#+BEGIN_SRC emacs-lisp
-  (use-package projectile-direnv
-    :config (add-hook 'projectile-mode-hook #'projectile-direnv-export-variables))
-#+END_SRC
-
 ** perspective
 
 This package makes buffer-switching inside of projects make sense, by
@@ -729,9 +725,12 @@ guesses the correct settings for me.
 #+BEGIN_SRC emacs-lisp
   (use-package dtrt-indent
     :config (progn
-              (dtrt-indent-mode 1)
-              (add-hook 'editorconfig-custom-hooks (lambda ()
-                                                     (dtrt-indent-undo)))
+              (defun ap/dtrt-adapt-if-needed ()
+                (unless editorconfig-mode
+                  (dtrt-indent-adapt)))
+              (if (fboundp #'editorconfig-mode)
+                  (add-hook 'after-change-major-mode-hook #'ap/dtrt-adapt-if-needed)
+                (add-hook 'after-change-major-mode-hook #'dtrt-indent-adapt))
               (defadvice dtrt-indent-try-set-offset (after toggle-smart-tabs activate)
                 (smart-tabs-mode (or indent-tabs-mode -1)))))
 #+END_SRC
@@ -991,8 +990,7 @@ Don’t show uninteresting files in dired listings.
     :defer 5
     :config (progn
               (diredp-toggle-find-file-reuse-dir 1)
-              (unbind-key "C-h C-m" dired-mode-map)
-              (bind-key "." #'diredp-describe-file dired-mode-map)))
+              (unbind-key "C-h C-m" dired-mode-map)))
 #+END_SRC
 
 Expand subfolders like a tree inside the parent
@@ -1504,9 +1502,12 @@ I can use this to keep a journal.  I should use it.
 **** org-mobile
 
 #+BEGIN_SRC emacs-lisp
+  (defun ap/org-mobile-pull (descriptor action file)
+    (org-mobile-pull))
   (use-package org-mobile
     :defer 30
     :ensure nil
+    :disabled t
     :config (progn
               (setq org-mobile-directory "~/Mobile/Org"
                     org-mobile-inbox-for-pull "~/Mobile/Org/from-mobile.org")
@@ -1537,8 +1538,6 @@ I can use this to keep a journal.  I should use it.
                                  (concat
                                   (file-name-as-directory org-mobile-directory)
                                   org-mobile-capture-file))))
-                  (defun ap/org-mobile-pull (descriptor action file)
-                    (org-mobile-pull))
                   (setq org-mobile-watcher
                         (file-notify-add-watch org-file '(change) #'ap/org-mobile-pull))))))))
 #+END_SRC
@@ -1753,6 +1752,7 @@ A REPL thing (and more) for Lisp.
 
   (use-package clj-refactor
     :defer t
+    :functions (clj-refactor-mode cljr-add-keybindings-with-prefix)
     :config (progn
               (cljr-add-keybindings-with-prefix "C-c C-m"))
     :init (progn
@@ -1874,7 +1874,8 @@ completions, besides other IDE-like things.
   (use-package json-mode
     :mode (("\\.json\\'" . json-mode)
            ("\\.sailsrc\\'" . json-mode)
-           ("composer\\.lock\\'" . json-mode)))
+           ("composer\\.lock\\'" . json-mode)
+           ("\\.tern-project\\'" . json-mode)))
 #+END_SRC
 
 *** restclient
@@ -1912,8 +1913,7 @@ frameworks that require multiple nested elements to do anything useful.
   :commands (emmet-mode)
   :diminish (emmet-mode . " >")
   :init (progn
-          (if (functionp 'web-mode)
-              (add-hook 'web-mode-hook #'emmet-mode))))
+          (add-hook 'web-mode-hook #'emmet-mode)))
 #+END_SRC
 
 *** web-mode
@@ -1944,46 +1944,6 @@ I derived a mode for twig, in order to use its =mode-hook=.
 (add-to-list 'auto-mode-alist '("\\.html\\.twig\\'" . twig-mode))
 #+END_SRC
 
-*** mmm-mode
-
-With =web-mode= being so good, I don’t really use this much.  It’s
-good for embedded SQL though.
-
-#+BEGIN_SRC emacs-lisp
-  (use-package mmm-auto
-    :ensure mmm-mode
-    :defer 20
-    :config (progn
-              (mmm-add-classes
-               '((php-sql
-                  :submode sql-mode
-                  :front "<<<SQL[\r\n]+"
-                  :back "SQL;?"
-                  :face mmm-code-submode-face)))
-              (mmm-add-mode-ext-class 'php-mode "\\.php$" 'php-sql)
-              (mmm-add-classes
-               '((markdown-toml
-                  :submode toml-mode
-                  :face mmm-declaration-submode-face
-                  :front "\\`+++[\n\r]+"
-                  :back "^+++$")
-                 (markdown-lisp
-                  :submode common-lisp-mode
-                  :face mmm-code-submode-face
-                  :front "^{{% highlight cl %}}[\r\n]+"
-                  :back "^{{% /highlight %}}$")
-                 (markdown-shell
-                  :submode shell-script-mode
-                  :face mmm-code-submode-face
-                  :front "^{{% highlight sh %}}[\r\n]+"
-                  :back "^{{% /highlight %}}$")))
-              (mmm-add-mode-ext-class 'markdown-mode nil 'markdown-toml)
-              (mmm-add-mode-ext-class 'markdown-mode nil 'markdown-lisp)
-              (mmm-add-mode-ext-class 'markdown-mode nil 'markdown-shell))
-    :init (setq mmm-global-mode 'maybe))
-#+END_SRC
-
-**** TODO Setup for javascript + SQL
 * Spelling
 
 #+BEGIN_SRC emacs-lisp
@@ -1994,8 +1954,6 @@ good for embedded SQL though.
                   ispell-dictionary "british")))
 #+END_SRC
 
-*** TODO Set up some functions to switch between en-GB and de-DE
-
 * Scripting
 
 Make a shell-script buffer executable after saving it, if it has a shebang.
@@ -2164,8 +2122,8 @@ type them.
               (add-hook 'text-mode-hook #'typo-mode)
               (defun typo-mode-turn-off ()
                 (typo-mode -1))
-              (add-hook 'yaml-mode-hook #'turn-off-typo-mode)
-              (add-hook 'jinja2-mode-hook #'turn-off-typo-mode)))
+              (add-hook 'yaml-mode-hook #'typo-mode-turn-off)
+              (add-hook 'jinja2-mode-hook #'typo-mode-turn-off)))
 #+END_SRC
 
 ** avy