General minor refactor

This commit is contained in:
Henrik Lissner 2017-07-18 22:12:50 +02:00
parent f2d8681ef4
commit e6658b7d8e
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
4 changed files with 32 additions and 40 deletions

View file

@ -1,6 +1,6 @@
;;; private/hlissner/config.el -*- lexical-binding: t; -*-
(when (featurep 'evil)
(when (featurep! :feature evil)
(load! +bindings) ; my key bindings
(load! +commands)) ; my custom ex commands
@ -41,8 +41,7 @@
(after! yasnippet
(setq yas-snippet-dirs
(append (list '+hlissner-snippets-dir)
(delete 'yas-installed-snippets-dir
yas-snippet-dirs))))
(delq 'yas-installed-snippets-dir yas-snippet-dirs))))
;; app/irc

View file

@ -118,7 +118,8 @@ whose dimensions may not be fully initialized by the time this is run."
(let ((old-pwd (or dir default-directory)))
(with-current-buffer (doom-fallback-buffer)
(with-silent-modifications
(+doom-dashboard-mode)
(unless (eq major-mode '+doom-dashboard-mode)
(+doom-dashboard-mode))
(erase-buffer)
(setq default-directory old-pwd)
(let ((+doom-dashboard--width (window-width))
@ -177,30 +178,26 @@ whose dimensions may not be fully initialized by the time this is run."
(file-exists-p (expand-file-name persp-auto-save-fname persp-save-dir)))))
(mapc (lambda (btn)
(when btn
(let ((label (car btn))
(icon (nth 1 btn))
(fn (nth 2 btn)))
(cl-destructuring-bind (label icon fn) btn
(insert
(with-temp-buffer
(insert-text-button
(concat (all-the-icons-octicon
icon
:face 'font-lock-keyword-face)
(concat (all-the-icons-octicon icon :face 'font-lock-keyword-face)
(propertize (concat " " label) 'face 'font-lock-keyword-face))
'action fn
'action `(lambda (_) ,fn)
'follow-link t)
(+doom-dashboard-center (1- +doom-dashboard--width) (buffer-string))))
(insert "\n\n"))))
(+doom-dashboard-center (1- +doom-dashboard--width) (buffer-string)))
"\n\n"))))
`(("Homepage" "mark-github"
(lambda (_) (browse-url "https://github.com/hlissner/.emacs.d")))
(browse-url "https://github.com/hlissner/.emacs.d"))
,(when last-session-p
'("Reload last session" "history"
(lambda (_) (+workspace/load-session))))
("Recently opened files" "file-text"
(lambda (_) (call-interactively (command-remapping 'recentf))))
(call-interactively (command-remapping 'recentf)))
("Recent opened projects" "briefcase"
(lambda (_) (call-interactively (command-remapping 'projectile-switch-project))))
(call-interactively (command-remapping 'projectile-switch-project)))
("Jump to bookmark" "bookmark"
(lambda (_) (call-interactively (command-remapping 'bookmark-jump))))
(call-interactively (command-remapping 'bookmark-jump)))
("Edit emacs.d" "tools"
(lambda (_) (find-file (expand-file-name "init.el" doom-emacs-dir))))))))
(find-file (expand-file-name "init.el" doom-emacs-dir)))))))

View file

@ -17,10 +17,10 @@
(add-hook 'doom-pre-reload-theme-hook #'+doom|reload-theme)
;; blink mode-line on errors
(add-hook 'doom-post-init-hook #'doom-themes-visual-bell-config)
(add-hook 'doom-init-ui-hook #'doom-themes-visual-bell-config)
;; Add file icons to doom-neotree
(add-hook 'doom-post-init-hook #'doom-themes-neotree-config)
(add-hook 'doom-init-ui-hook #'doom-themes-neotree-config)
(setq doom-neotree-enable-variable-pitch t
doom-neotree-file-icons 'simple
doom-neotree-line-spacing 2)
@ -44,8 +44,7 @@
;; Prevent color glitches when reloading either DOOM or the theme
(defun +doom|reset-solaire-mode (&rest _) (solaire-mode-reset))
(advice-add #'load-theme :after #'+doom|reset-solaire-mode)
(add-hook 'doom-reload-hook #'solaire-mode-reset)
(add-hook 'doom-init-ui-hook #'solaire-mode-reset)
(add-hook! '(doom-init-ui-hook doom-reload-hook) #'solaire-mode-reset)
;; Extra modes to activate doom-buffer-mode in
(add-hook! (gist-mode