summary refs log tree commit diff stats
path: root/tag-emacs/emacs.d/init.org
diff options
context:
space:
mode:
authorAlan Pearce2016-02-08 09:45:00 +0100
committerAlan Pearce2016-02-08 09:45:00 +0100
commit0b94384382c0fb6e83d85feb1f6a0548f778c84b (patch)
treecf64ee9c20483d4e0f04909dff778ff944493754 /tag-emacs/emacs.d/init.org
parente743a4e8d3949bd1e64907485bec741cfb00a08b (diff)
parent90aaf93d952a5f56755379d50f6a8999322e37c4 (diff)
downloadnixfiles-0b94384382c0fb6e83d85feb1f6a0548f778c84b.tar.lz
nixfiles-0b94384382c0fb6e83d85feb1f6a0548f778c84b.tar.zst
nixfiles-0b94384382c0fb6e83d85feb1f6a0548f778c84b.zip
Merge branch 'master' of github.com:alanpearce/dotfiles
Diffstat (limited to 'tag-emacs/emacs.d/init.org')
-rw-r--r--tag-emacs/emacs.d/init.org105
1 files changed, 32 insertions, 73 deletions
diff --git a/tag-emacs/emacs.d/init.org b/tag-emacs/emacs.d/init.org
index f234042a..28bd5396 100644
--- a/tag-emacs/emacs.d/init.org
+++ b/tag-emacs/emacs.d/init.org
@@ -118,12 +118,23 @@ I quite like solarized.  I don’t think it’s perfect, but it supports a
 lot of modes.
 #+BEGIN_SRC emacs-lisp
   (use-package solarized-theme
+    :disabled t
     :config (progn
               (setq solarized-distinct-fringe-background t)
               (setq solarized-high-contrast-mode-line t)
               (load-theme 'solarized-light t)))
 #+END_SRC
 
+Let’s try spacemacs-light for a while.
+
+#+BEGIN_SRC emacs-lisp
+  (use-package spacemacs-common
+    :ensure spacemacs-theme
+    :config (progn
+              (setq spacemacs-theme-org-highlight t)
+              (load-theme 'spacemacs-light t)))
+#+END_SRC
+
 Colourise colour names in certain types of buffer.  I don’t use this
 in modes for webdev because [[web-mode]] includes that functionality.
 #+BEGIN_SRC emacs-lisp
@@ -335,57 +346,6 @@ modes.
     :config (setq ag-project-root-function #'projectile-project-root))
 #+END_SRC
 
-** The Platinum Searcher
-
-[[https://github.com/monochromegane/the_platinum_searcher][The Platinum Searcher]] is a code search tool similar to ack and
-the_silver_searcher(ag). It supports multi platforms and multi
-encodings.
-
-#+BEGIN_SRC sh :tangle no
-brew install pt
-#+END_SRC
-
-#+BEGIN_SRC emacs-lisp
-  (use-package pt
-    :pin melpa-stable
-    :bind* ("C-c p s s" . ap/projectile-pt)
-    :config (progn
-              (defun pt (string directory &optional args)
-                (interactive (list (read-from-minibuffer "Pt search for: " (thing-at-point 'symbol))
-                                   (read-directory-name "Directory: ")))
-                (let ((default-directory directory))
-                  (compilation-start
-                   (mapconcat 'identity
-                              (append (list pt-executable)
-                                      pt-arguments
-                                      args
-                                      '("--nogroup" "--nocolor" "--")
-                                      (list (shell-quote-argument string) ".")) " "))))
-
-              (defun ap/projectile-pt (search-term &optional arg)
-                "Run a pt search with SEARCH-TERM in the project.
-
-  With an optional prefix argument ARG SEARCH-TERM is interpreted as a
-  regular expression."
-                (interactive
-                 (list (read-from-minibuffer
-                        (projectile-prepend-project-name (format "Pt %ssearch for: " (if current-prefix-arg "regexp " "")))
-                        (projectile-symbol-or-selection-at-point))
-                       current-prefix-arg))
-                (if (require 'pt nil 'noerror)
-                    (let ((pt-command (if arg 'pt-regexp 'pt))
-                          (ignore-list (-map #'shell-quote-argument
-                                             (ag/format-ignore
-                                              (-union ag-ignore-list
-                                                      (append
-                                                       (projectile-ignored-files-rel) (projectile-ignored-directories-rel)
-                                                       grep-find-ignored-files grep-find-ignored-directories)))))
-                          ;; reset the prefix arg, otherwise it will affect the pt-command
-                          (current-prefix-arg nil))
-                      (funcall pt-command search-term (projectile-project-root) ignore-list))
-                  (error "Package 'pt' is not available")))))
-#+END_SRC
-
 ** Projectile
 
 Projectile is awesome for working in projects, especially VCS-backed
@@ -473,7 +433,9 @@ changed.  This package colours the fringe
     :defer 2
     :config (progn
               (global-diff-hl-mode 1)
-              (add-hook 'magit-refresh-file-buffer-hook #'diff-hl-update)))
+              (add-hook 'dired-mode-hook (lambda ()
+                                           (diff-hl-dired-mode 1)))
+              (add-hook 'magit-post-refresh-hook #'diff-hl-magit-post-refresh)))
 #+END_SRC
 
 ** magit
@@ -680,6 +642,8 @@ that I can sudo on remote machines
   (use-package tramp
     :defer 7
     :config (progn
+              (unless (getenv "SSH_AUTH_SOCK")
+                (setenv "SSH_AUTH_SOCK" "/run/user/1000/ssh-agent.socket"))
               (setq tramp-default-method (if (eq system-type 'windows-nt) "plinkx" "ssh")
                     tramp-default-user-alist '(("\\`su\\(do\\)?\\'" nil "root"))
                     tramp-backup-directory-alist backup-directory-alist
@@ -752,6 +716,8 @@ whitespace-sensitive language, of course.
               (add-to-list 'auto-indent-disabled-modes-list 'saltstack-mode)
               (add-to-list 'auto-indent-disabled-modes-list 'nix-mode)
               (add-to-list 'auto-indent-disabled-modes-list 'coffee-mode)
+              (add-to-list 'auto-indent-disabled-modes-list 'yaml-mode)
+              (add-to-list 'auto-indent-disabled-modes-list 'ansible-mode)
               (auto-indent-global-mode)))
 #+END_SRC
 
@@ -1065,19 +1031,6 @@ copying/moving files between them.
             (put 'dired-find-alternate-file 'disabled nil)))
 #+END_SRC
 
-I work with a lot of git projects.  Dired-k adds colours based upon
-the file’s git status.
-#+BEGIN_SRC emacs-lisp
-  (use-package dired-k
-    :defer 5
-    :init (progn
-            (add-hook 'dired-initial-position-hook #'dired-k))
-    :config (progn
-              (setq dired-k-human-readable t)
-              (bind-key "g" #'dired-k dired-mode-map)))
-#+END_SRC
-
-
 Don’t show uninteresting files in dired listings.
 
 #+BEGIN_SRC emacs-lisp
@@ -1526,11 +1479,12 @@ works really nicely.
                     ledger-clear-whole-transactions t
                     ledger-narrow-on-reconcile t
                     ledger-default-date-format "%Y-%m-%d"
-                    ledger-reports '(("Monthly Expenses" "ledger -f %(ledger-file) reg -M Expenses -l \"commodity == '€'\"")
-                                     ("Forecast:Next Month" "ledger -f %(ledger-file) bal --forecast 'format_date(d, \"%Y%m%d\")<(to_string(to_int(format_date(now, \"%Y%m01\"))+100))' --limit 'format_date(date, \"%Y%m%d\")>(to_string(to_int(format_date(now, \"%Y%m01\"))+200))' ^Expenses: ^Funds:")
-                                     ("Expenses:This Month" "ledger -f %(ledger-file) bal ^Expenses -p \"this month\"")
-                                     ("Asset & Liability Balances" "ledger -f %(ledger-file) bal --current -R :Budget: Assets:Receivable Liabilities:Personal")
-                                     ("Budget" "ledger -f %(ledger-file) bal ^Funds")
+                    ledger-reports '(("Monthly Expenses" "ledger -f %(ledger-file) reg -M Expenses --real -l \"payee != 'Opening Balances'\"")
+                                     ("Expenses:This Month" "ledger -f %(ledger-file) bal \\^Expenses -p \"this month\"")
+                                     ("On-budget Balances" "ledger -f %(ledger-file) bal --current -R :Budget: Assets:Receivable Liabilities:Personal")
+                                     ("All Account Balances" "ledger -f %(ledger-file) bal --current -R \\^Assets \\^Liabilities")
+                                     ("Budget (Current Month)" "ledger -f %(ledger-file) bal --current \\^Funds")
+                                     ("Budget (All)" "ledger -f %(ledger-file) bal \\^Funds")
                                      ("bal" "ledger -f %(ledger-file) bal")
                                      ("reg" "ledger -f %(ledger-file) reg")
                                      ("equity" "ledger -f %(ledger-file) equity")
@@ -1681,7 +1635,7 @@ 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 ()
+                  (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))))))))
@@ -2299,9 +2253,14 @@ type them.
 #+BEGIN_SRC emacs-lisp
   (use-package typo
     :config (progn
-              (typo-global-mode 1))
+              (typo-global-mode 1)
+              (typo-change-language "English"))
     :init (progn
-            (add-hook 'text-mode-hook #'typo-mode)))
+            (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)))
 #+END_SRC
 
 ** avy