diff options
-rw-r--r-- | tag-emacs/emacs.d/init.org | 77 |
1 files changed, 44 insertions, 33 deletions
diff --git a/tag-emacs/emacs.d/init.org b/tag-emacs/emacs.d/init.org index 739180b6..452a7347 100644 --- a/tag-emacs/emacs.d/init.org +++ b/tag-emacs/emacs.d/init.org @@ -313,6 +313,7 @@ based upon some folder conventions I use. ("s-x s-f" . projectile-find-file) ("C-x g" . projectile-vc) ("s-G" . projectile-vc)) + :demand t :diminish projectile-mode :config (progn (projectile-global-mode) @@ -366,12 +367,13 @@ it needs hooking into projectile and a key bound to switch between projects. #+BEGIN_SRC emacs-lisp (use-package perspective :bind* ("s-p" . persp-switch) - :init (progn - (setq persp-show-modestring t) - (persp-mode))) + :demand t + :config (progn + (setq persp-show-modestring t) + (persp-mode))) (use-package persp-projectile - :ensure nil) + :ensure t) #+END_SRC ** vc @@ -399,7 +401,10 @@ changed. This package colours the fringe (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))) + (add-hook 'magit-post-refresh-hook #'diff-hl-magit-post-refresh) + (add-hook 'magit-refresh-buffer-hook (lambda () + (message "test: %s" (buffer-file-name)) + (buffer-file-name))))) #+END_SRC ** magit @@ -695,6 +700,9 @@ with spaces. Perfect! (use-package smart-tabs-mode :defer 1 :config (progn + (smart-tabs-insinuate 'c 'cperl 'javascript 'python) + (add-hook 'php-mode-hook (lambda () + (smart-tabs-mode indent-tabs-mode))) (with-eval-after-load "align.el" (smart-tabs-mode/no-tabs-mode-advice align) (smart-tabs-mode/no-tabs-mode-advice align-regexp)) @@ -715,11 +723,14 @@ with spaces. Perfect! indent-relative-maybe)) (setq indent-tabs-mode nil)) ad-do-it) - ad-do-it)))) - :init (progn - (smart-tabs-insinuate 'c 'cperl 'javascript 'python) - (add-hook 'php-mode-hook (lambda () - (smart-tabs-mode indent-tabs-mode))))) + ad-do-it))))) +#+END_SRC + +** editorconfig + +#+BEGIN_SRC emacs-lisp + (use-package editorconfig + :config (editorconfig-mode 1)) #+END_SRC ** dtrt-indent-mode @@ -729,8 +740,8 @@ guesses the correct settings for me. #+BEGIN_SRC emacs-lisp (use-package dtrt-indent - :init (dtrt-indent-mode 1) :config (progn + (dtrt-indent-mode 1) (defadvice dtrt-indent-try-set-offset (after toggle-smart-tabs activate) (smart-tabs-mode (or indent-tabs-mode -1))))) #+END_SRC @@ -1196,7 +1207,9 @@ replace helm and ido. ("C-x i" . ivy-imenu-goto) ("C-=" . swiper)) :diminish ivy-mode + :demand t :config (progn + (ivy-mode 1) (setq ivy-use-virtual-buffers t ivy-re-builders-alist '((internal-complete-buffer . ivy--regex-fuzzy) (t . ivy--regex-plus))) @@ -1226,22 +1239,20 @@ replace helm and ido. (kill-buffer x) (ivy--reset-state ivy-last)) "kill"))) - (add-to-list 'ivy-initial-inputs-alist '(counsel-M-x . ""))) - :init (progn - (ivy-mode 1))) + (add-to-list 'ivy-initial-inputs-alist '(counsel-M-x . "")))) #+END_SRC ** counsel #+BEGIN_SRC emacs-lisp (use-package counsel - :bind (("M-x" . counsel-M-x) - ("<apps>" . counsel-M-x) - ("<menu>" . counsel-M-x) - ("C-c M-x" . execute-extended-command) - ("C-x C-f" . counsel-find-file) - ("C-x b" . counsel-switch-to-persp-buffer)) :config (progn + (bind-key "M-x" #'counsel-M-x) + (bind-key "<apps>" #'counsel-M-x) + (bind-key "<menu>" #'counsel-M-x) + (bind-key "C-c M-x" #'execute-extended-command) + (bind-key "C-x C-f" #'counsel-find-file) + (bind-key "C-x b" #'counsel-switch-to-persp-buffer) (defadvice counsel-find-file (after find-file-sudo activate) "Find file as root if necessary." (when (and buffer-file-name @@ -1644,11 +1655,11 @@ Lisp syntax allows for really easy refactoring. Redshank gives some operations that aren’t part of paredit, like extracting variables into let bindings. #+BEGIN_SRC emacs-lisp -(use-package redshank - :diminish " Λ" - :defer t - :init (progn - (add-hook 'lisp-mode-common-hook #'turn-on-redshank-mode))) + (use-package redshank + :diminish " Λ" + :after (paredit) + :config (progn + (add-hook 'lisp-mode-common-hook #'turn-on-redshank-mode))) #+END_SRC *** Emacs Lisp @@ -2156,13 +2167,12 @@ type them. (use-package typo :config (progn (typo-global-mode 1) - (typo-change-language "English")) - :init (progn - (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))) + (typo-change-language "English") + (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 @@ -2175,6 +2185,7 @@ somehow I prefer it. :bind* (("M-g g" . avy-goto-line) ("M-g M-g" . avy-goto-line) ("C-|" . avy-goto-line) + ("M-s" . avy-goto-word-1) ("C-c SPC" . avy-goto-char-timer)) :config (progn (avy-setup-default) @@ -2231,7 +2242,7 @@ I didn’t find smartparens’ implementation of paredit style to be as nice as the real version #+BEGIN_SRC emacs-lisp - (eval-when-compile (require 'smartparens)) + (eval-when-compile (require 'smartparens nil :noerror)) (use-package smartparens-config :ensure smartparens :config (progn |