Use with-eval-after-load and avoid require

This commit is contained in:
Lars Tveito 2020-03-10 20:26:50 +01:00
parent 19403733de
commit 7053ac1333

View File

@ -440,13 +440,12 @@
I smuggled some configurations from [[https://github.com/torenord/.emacs.d/][torenord]], providing a cleaner look. I smuggled some configurations from [[https://github.com/torenord/.emacs.d/][torenord]], providing a cleaner look.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(require 'git-gutter-fringe) (with-eval-after-load 'git-gutter-fringe
(dolist (p '((git-gutter:added . "#0c0")
(dolist (p '((git-gutter:added . "#0c0") (git-gutter:deleted . "#c00")
(git-gutter:deleted . "#c00") (git-gutter:modified . "#c0c")))
(git-gutter:modified . "#c0c"))) (set-face-foreground (car p) (cdr p))
(set-face-foreground (car p) (cdr p)) (set-face-background (car p) (cdr p))))
(set-face-background (car p) (cdr p)))
#+END_SRC #+END_SRC
New in Emacs 24.4 is the =prettify-symbols-mode=! It's neat. New in Emacs 24.4 is the =prettify-symbols-mode=! It's neat.
@ -505,27 +504,30 @@
near the end of the configuration). near the end of the configuration).
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(require 'helm)
(require 'helm-config) (require 'helm-config)
(with-eval-after-load 'helm
(setq helm-split-window-in-side-p t
helm-M-x-fuzzy-match t
helm-buffers-fuzzy-matching t
helm-recentf-fuzzy-match t
helm-move-to-line-cycle-in-source t
projectile-completion-system 'helm
helm-mini-default-sources '(helm-source-buffers-list
helm-source-recentf
helm-source-bookmarks
helm-source-buffer-not-found))
(setq helm-split-window-in-side-p t (when (executable-find "ack")
helm-M-x-fuzzy-match t (setq helm-grep-default-command
helm-buffers-fuzzy-matching t "ack -Hn --no-group --no-color %e %p %f"
helm-recentf-fuzzy-match t helm-grep-default-recurse-command
helm-move-to-line-cycle-in-source t "ack -H --no-group --no-color %e %p %f"))
projectile-completion-system 'helm)
(when (executable-find "ack") (set-face-attribute 'helm-selection nil :background "cyan")
(setq helm-grep-default-command
"ack -Hn --no-group --no-color %e %p %f"
helm-grep-default-recurse-command
"ack -H --no-group --no-color %e %p %f"))
(set-face-attribute 'helm-selection nil :background "cyan") (helm-mode 1)
(helm-projectile-on)
(helm-mode 1) (helm-adaptive-mode 1))
(helm-projectile-on)
(helm-adaptive-mode 1)
#+END_SRC #+END_SRC
*** Helm dash *** Helm dash
@ -1355,9 +1357,10 @@
(define-key custom-bindings-map (kbd "M-i") 'helm-swoop) (define-key custom-bindings-map (kbd "M-i") 'helm-swoop)
(define-key custom-bindings-map (kbd "M-I") 'helm-multi-swoop-all) (define-key custom-bindings-map (kbd "M-I") 'helm-multi-swoop-all)
(define-key helm-map (kbd "<tab>") 'helm-execute-persistent-action) (with-eval-after-load 'helm
(define-key helm-map (kbd "C-i") 'helm-execute-persistent-action) (define-key helm-map (kbd "<tab>") 'helm-execute-persistent-action)
(define-key helm-map (kbd "C-z") 'helm-select-action) (define-key helm-map (kbd "C-i") 'helm-execute-persistent-action)
(define-key helm-map (kbd "C-z") 'helm-select-action))
#+END_SRC #+END_SRC
** Bindings for built-ins ** Bindings for built-ins