summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--tag-emacs/emacs.d/init.org105
-rwxr-xr-xtag-zsh/config/zsh/zshrc8
2 files changed, 36 insertions, 77 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
diff --git a/tag-zsh/config/zsh/zshrc b/tag-zsh/config/zsh/zshrc
index 496a9756..73dad6df 100755
--- a/tag-zsh/config/zsh/zshrc
+++ b/tag-zsh/config/zsh/zshrc
@@ -30,7 +30,7 @@ hosts=(
 
 users=(alan root toor)
 
-if [[ $os == "gnu" ]]
+if [[ $os == "gnu" && -z $SSH_CLIENT ]]
 then
 	export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"
 fi
@@ -355,12 +355,12 @@ ec () {
 	fi
 }
 
-_FASD_DATA="$HOME/.cache/zsh/fasd-data"
-if [[ -e ~/.config/zsh/fasd.zsh ]]
+if [[ -n $commands[fasd] && -e ~/.config/zsh/fasd.zsh ]]
 then
+	_FASD_DATA="$HOME/.cache/zsh/fasd-data"
 	source ~/.config/zsh/fasd.zsh
 else
-	echo "fasd init file is missing."
+	echo "fasd not enabled."
 fi
 
 case $os in