From 64aad8e0919a1519e8f5bb78d714cb4aa55f736f Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 29 Jan 2016 19:07:54 +0100 Subject: zsh: Don’t run fasd if not installed --- tag-zsh/config/zsh/zshrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tag-zsh/config/zsh/zshrc b/tag-zsh/config/zsh/zshrc index 496a9756..98fcd5e1 100755 --- a/tag-zsh/config/zsh/zshrc +++ b/tag-zsh/config/zsh/zshrc @@ -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 -- cgit 1.4.1 From c8710ae46712b0b600d38d6c2f12ddf84b34d071 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 29 Jan 2016 19:08:23 +0100 Subject: Emacs: Don’t auto-indent in yaml-mode --- tag-emacs/emacs.d/init.org | 1 + 1 file changed, 1 insertion(+) diff --git a/tag-emacs/emacs.d/init.org b/tag-emacs/emacs.d/init.org index 73f7f942..e7cd732a 100644 --- a/tag-emacs/emacs.d/init.org +++ b/tag-emacs/emacs.d/init.org @@ -752,6 +752,7 @@ 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) (auto-indent-global-mode))) #+END_SRC -- cgit 1.4.1 From 53bc9ff3cf20191ad7b07f482ffb6418404e7dfd Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 1 Feb 2016 19:40:10 +0100 Subject: Emacs: Disable auto-indent in ansible-mode --- tag-emacs/emacs.d/init.org | 1 + 1 file changed, 1 insertion(+) diff --git a/tag-emacs/emacs.d/init.org b/tag-emacs/emacs.d/init.org index e7cd732a..ab234c95 100644 --- a/tag-emacs/emacs.d/init.org +++ b/tag-emacs/emacs.d/init.org @@ -753,6 +753,7 @@ whitespace-sensitive language, of course. (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 -- cgit 1.4.1 From 867e97a7c1bae699c5d043be26b44aff45fc68a0 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 1 Feb 2016 19:40:32 +0100 Subject: Emacs: Disable typo-mode in yaml and jinja modes --- tag-emacs/emacs.d/init.org | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tag-emacs/emacs.d/init.org b/tag-emacs/emacs.d/init.org index ab234c95..0451fe79 100644 --- a/tag-emacs/emacs.d/init.org +++ b/tag-emacs/emacs.d/init.org @@ -2313,7 +2313,11 @@ type them. :config (progn (typo-global-mode 1)) :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 -- cgit 1.4.1 From 4a0710cba5943f961fd89385008e23984b0492e5 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 3 Feb 2016 19:34:18 +0100 Subject: zsh: Don’t export ssh socket via SSH --- tag-zsh/config/zsh/zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tag-zsh/config/zsh/zshrc b/tag-zsh/config/zsh/zshrc index 98fcd5e1..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 -- cgit 1.4.1 From d16f4df11a799ae990c07629f60a11d5ad8d22ba Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 3 Feb 2016 19:34:37 +0100 Subject: Emacs: Set SSH_AUTH_SOCK --- tag-emacs/emacs.d/init.org | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tag-emacs/emacs.d/init.org b/tag-emacs/emacs.d/init.org index 0451fe79..2536223a 100644 --- a/tag-emacs/emacs.d/init.org +++ b/tag-emacs/emacs.d/init.org @@ -680,6 +680,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 -- cgit 1.4.1 From ed0669abc63b735fbbb482c63e8ccb9373a18ab1 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 5 Feb 2016 17:31:07 +0100 Subject: Emacs: Update ledger-mode reports --- tag-emacs/emacs.d/init.org | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tag-emacs/emacs.d/init.org b/tag-emacs/emacs.d/init.org index 2536223a..2fc1fe6a 100644 --- a/tag-emacs/emacs.d/init.org +++ b/tag-emacs/emacs.d/init.org @@ -1540,11 +1540,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") -- cgit 1.4.1 From 4f7e34a4c173b92db13e33bb660a189268d99554 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 5 Feb 2016 17:31:19 +0100 Subject: Emacs: Fix org-mobile file-watch warning --- tag-emacs/emacs.d/init.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tag-emacs/emacs.d/init.org b/tag-emacs/emacs.d/init.org index 2fc1fe6a..32984539 100644 --- a/tag-emacs/emacs.d/init.org +++ b/tag-emacs/emacs.d/init.org @@ -1696,7 +1696,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)))))))) -- cgit 1.4.1 From 42559922c6686ba73a7998d78a2c407c45b753ca Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 5 Feb 2016 18:19:59 +0100 Subject: Emacs: Ensure diff indicators are updated by magit --- tag-emacs/emacs.d/init.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tag-emacs/emacs.d/init.org b/tag-emacs/emacs.d/init.org index 32984539..4c197219 100644 --- a/tag-emacs/emacs.d/init.org +++ b/tag-emacs/emacs.d/init.org @@ -473,7 +473,7 @@ 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 'magit-post-refresh-hook #'diff-hl-magit-post-refresh))) #+END_SRC ** magit -- cgit 1.4.1 From 5357fa8e66c973a6958ae14bd4bfa30d6fd4c9b1 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 5 Feb 2016 18:30:58 +0100 Subject: Emacs: Use diff-hl-dired instead of dired-k --- tag-emacs/emacs.d/init.org | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/tag-emacs/emacs.d/init.org b/tag-emacs/emacs.d/init.org index 4c197219..a1417bb8 100644 --- a/tag-emacs/emacs.d/init.org +++ b/tag-emacs/emacs.d/init.org @@ -473,6 +473,8 @@ changed. This package colours the fringe :defer 2 :config (progn (global-diff-hl-mode 1) + (add-hook 'dired-mode-hook (lambda () + (diff-hl-dired-mode 1))) (add-hook 'magit-post-refresh-hook #'diff-hl-magit-post-refresh))) #+END_SRC @@ -1069,19 +1071,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 -- cgit 1.4.1 From 6ed795a7d9302fd37a0099fa14d0690c513cef75 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 5 Feb 2016 20:08:23 +0100 Subject: Emacs: Set typo-mode language to English --- tag-emacs/emacs.d/init.org | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tag-emacs/emacs.d/init.org b/tag-emacs/emacs.d/init.org index a1417bb8..09ffb127 100644 --- a/tag-emacs/emacs.d/init.org +++ b/tag-emacs/emacs.d/init.org @@ -2303,7 +2303,8 @@ 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) (defun typo-mode-turn-off () -- cgit 1.4.1 From 082804f6f1d5f51b7d25b97819151ab30073a742 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 6 Feb 2016 17:01:50 +0100 Subject: Emacs: Remove platinum configuration --- tag-emacs/emacs.d/init.org | 51 ---------------------------------------------- 1 file changed, 51 deletions(-) diff --git a/tag-emacs/emacs.d/init.org b/tag-emacs/emacs.d/init.org index 09ffb127..48880722 100644 --- a/tag-emacs/emacs.d/init.org +++ b/tag-emacs/emacs.d/init.org @@ -335,57 +335,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 -- cgit 1.4.1 From 7dd4cee66e185dd45021c157cfef2d2ba57b16c8 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 6 Feb 2016 18:51:28 +0100 Subject: Emacs: Switch theme to spacemacs-light --- tag-emacs/emacs.d/init.org | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tag-emacs/emacs.d/init.org b/tag-emacs/emacs.d/init.org index 48880722..a8675cfd 100644 --- a/tag-emacs/emacs.d/init.org +++ b/tag-emacs/emacs.d/init.org @@ -118,12 +118,22 @@ 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-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 -- cgit 1.4.1 From 90aaf93d952a5f56755379d50f6a8999322e37c4 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 6 Feb 2016 20:56:47 +0100 Subject: Emacs: Fix init of spacemacs-theme --- tag-emacs/emacs.d/init.org | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tag-emacs/emacs.d/init.org b/tag-emacs/emacs.d/init.org index a8675cfd..dccf62df 100644 --- a/tag-emacs/emacs.d/init.org +++ b/tag-emacs/emacs.d/init.org @@ -128,7 +128,8 @@ lot of modes. Let’s try spacemacs-light for a while. #+BEGIN_SRC emacs-lisp - (use-package spacemacs-theme + (use-package spacemacs-common + :ensure spacemacs-theme :config (progn (setq spacemacs-theme-org-highlight t) (load-theme 'spacemacs-light t))) -- cgit 1.4.1