[emacs] Modification for emacs.

This commit is contained in:
Mikaël Capelle 2020-01-07 10:33:31 +01:00
parent f3a1c670d9
commit 15d2e259e3
3 changed files with 119 additions and 7 deletions

View File

@ -40,9 +40,112 @@
(eval-when-compile (eval-when-compile
(require 'init-const)) (require 'init-const))
;; ATIPac (use-package all-the-icons
(use-package all-the-icons :if *sys/gui*) :if *sys/gui*
;; -ATIPac :config
(with-no-warnings
;; FIXME: Align the directory icons
;; @see https://github.com/domtronn/all-the-icons.el/pull/173
(defun all-the-icons-icon-for-dir (dir &optional chevron padding)
"Format an icon for DIR with CHEVRON similar to tree based directories."
(let* ((matcher (all-the-icons-match-to-alist (file-name-base (directory-file-name dir)) all-the-icons-dir-icon-alist))
(path (expand-file-name dir))
(chevron (if chevron (all-the-icons-octicon (format "chevron-%s" chevron) :height 0.8 :v-adjust -0.1) ""))
(padding (or padding "\t"))
(icon (cond
((file-symlink-p path)
(all-the-icons-octicon "file-symlink-directory" :height 1.0 :v-adjust 0.0))
((all-the-icons-dir-is-submodule path)
(all-the-icons-octicon "file-submodule" :height 1.0 :v-adjust 0.0))
((file-exists-p (format "%s/.git" path))
(format "%s" (all-the-icons-octicon "repo" :height 1.1 :v-adjust 0.0)))
(t (apply (car matcher) (list (cadr matcher) :v-adjust 0.0))))))
(format "%s%s%s%s%s" padding chevron padding icon padding)))
(defun all-the-icons-reset ()
"Reset (unmemoize/memoize) the icons."
(interactive)
(dolist (f '(all-the-icons-icon-for-file
all-the-icons-icon-for-mode
all-the-icons-icon-for-url
all-the-icons-icon-family-for-file
all-the-icons-icon-family-for-mode
all-the-icons-icon-family))
(ignore-errors
(memoize-restore f)
(memoize f)))
(message "Reset all-the-icons")))
(add-to-list 'all-the-icons-mode-icon-alist
'(bongo-playlist-mode all-the-icons-material "playlist_play" :height 1.2 :v-adjust -0.2 :face 'all-the-icons-green))
(add-to-list 'all-the-icons-mode-icon-alist
'(bongo-library-mode all-the-icons-material "library_music" :height 1.1 :v-adjust -0.2 :face 'all-the-icons-dgreen))
(add-to-list 'all-the-icons-mode-icon-alist
'(gnus-group-mode all-the-icons-fileicon "gnu" :face 'all-the-icons-silver))
(add-to-list 'all-the-icons-mode-icon-alist
'(gnus-summary-mode all-the-icons-octicon "inbox" :height 1.0 :v-adjust 0.0 :face 'all-the-icons-orange))
(add-to-list 'all-the-icons-mode-icon-alist
'(gnus-article-mode all-the-icons-octicon "mail" :height 1.1 :v-adjust 0.0 :face 'all-the-icons-lblue))
(add-to-list 'all-the-icons-mode-icon-alist
'(message-mode all-the-icons-octicon "mail" :height 1.1 :v-adjust 0.0 :face 'all-the-icons-lblue))
(add-to-list 'all-the-icons-mode-icon-alist
'(diff-mode all-the-icons-octicon "git-compare" :v-adjust 0.0 :face all-the-icons-lred))
(add-to-list 'all-the-icons-mode-icon-alist
'(flycheck-error-list-mode all-the-icons-octicon "checklist" :height 1.1 :v-adjust 0.0 :face all-the-icons-lred))
(add-to-list 'all-the-icons-mode-icon-alist
'(elfeed-search-mode all-the-icons-faicon "rss-square" :v-adjust -0.1 :face all-the-icons-orange))
(add-to-list 'all-the-icons-mode-icon-alist
'(elfeed-show-mode all-the-icons-octicon "rss" :height 1.1 :v-adjust 0.0 :face all-the-icons-lorange))
(add-to-list 'all-the-icons-mode-icon-alist
'(newsticker-mode all-the-icons-faicon "rss-square" :v-adjust -0.1 :face all-the-icons-orange))
(add-to-list 'all-the-icons-mode-icon-alist
'(newsticker-treeview-mode all-the-icons-faicon "rss-square" :v-adjust -0.1 :face all-the-icons-orange))
(add-to-list 'all-the-icons-mode-icon-alist
'(newsticker-treeview-list-mode all-the-icons-octicon "rss" :height 1.1 :v-adjust 0.0 :face all-the-icons-orange))
(add-to-list 'all-the-icons-mode-icon-alist
'(newsticker-treeview-item-mode all-the-icons-octicon "rss" :height 1.1 :v-adjust 0.0 :face all-the-icons-lorange))
(add-to-list 'all-the-icons-icon-alist
'("\\.[bB][iI][nN]$" all-the-icons-octicon "file-binary" :v-adjust 0.0 :face all-the-icons-yellow))
(add-to-list 'all-the-icons-icon-alist
'("\\.c?make$" all-the-icons-fileicon "gnu" :face all-the-icons-dorange))
(add-to-list 'all-the-icons-icon-alist
'("\\.conf$" all-the-icons-octicon "settings" :v-adjust 0.0 :face all-the-icons-yellow))
(add-to-list 'all-the-icons-icon-alist
'("\\.toml$" all-the-icons-octicon "settings" :v-adjust 0.0 :face all-the-icons-yellow))
(add-to-list 'all-the-icons-mode-icon-alist
'(conf-mode all-the-icons-octicon "settings" :v-adjust 0.0 :face all-the-icons-yellow))
(add-to-list 'all-the-icons-mode-icon-alist
'(conf-space-mode all-the-icons-octicon "settings" :v-adjust 0.0 :face all-the-icons-yellow))
(add-to-list 'all-the-icons-mode-icon-alist
'(forge-topic-mode all-the-icons-alltheicon "git" :face all-the-icons-blue))
(add-to-list 'all-the-icons-icon-alist
'("\\.xpm$" all-the-icons-octicon "file-media" :v-adjust 0.0 :face all-the-icons-dgreen))
(add-to-list 'all-the-icons-mode-icon-alist
'(help-mode all-the-icons-faicon "info-circle" :height 1.1 :v-adjust -0.1 :face all-the-icons-purple))
(add-to-list 'all-the-icons-mode-icon-alist
'(helpful-mode all-the-icons-faicon "info-circle" :height 1.1 :v-adjust -0.1 :face all-the-icons-purple))
(add-to-list 'all-the-icons-mode-icon-alist
'(Info-mode all-the-icons-faicon "info-circle" :height 1.1 :v-adjust -0.1))
(add-to-list 'all-the-icons-icon-alist
'("NEWS$" all-the-icons-faicon "newspaper-o" :height 0.9 :v-adjust -0.2))
(add-to-list 'all-the-icons-icon-alist
'("Cask\\'" all-the-icons-fileicon "elisp" :height 1.0 :v-adjust -0.2 :face all-the-icons-blue))
(add-to-list 'all-the-icons-mode-icon-alist
'(cask-mode all-the-icons-fileicon "elisp" :height 1.0 :v-adjust -0.2 :face all-the-icons-blue))
(add-to-list 'all-the-icons-icon-alist
'(".*\\.ipynb\\'" all-the-icons-fileicon "jupyter" :height 1.2 :face all-the-icons-orange))
(add-to-list 'all-the-icons-mode-icon-alist
'(ein:notebooklist-mode all-the-icons-faicon "book" :face all-the-icons-lorange))
(add-to-list 'all-the-icons-mode-icon-alist
'(ein:notebook-mode all-the-icons-fileicon "jupyter" :height 1.2 :face all-the-icons-orange))
(add-to-list 'all-the-icons-mode-icon-alist
'(ein:notebook-multilang-mode all-the-icons-fileicon "jupyter" :height 1.2 :face all-the-icons-dorange))
(add-to-list 'all-the-icons-icon-alist
'("\\.epub\\'" all-the-icons-faicon "book" :height 1.0 :v-adjust -0.1 :face all-the-icons-green))
(add-to-list 'all-the-icons-mode-icon-alist
'(nov-mode all-the-icons-faicon "book" :height 1.0 :v-adjust -0.1 :face all-the-icons-green))
(add-to-list 'all-the-icons-mode-icon-alist
'(gfm-mode all-the-icons-octicon "markdown" :face all-the-icons-lblue)))
;; ATIDiredPac ;; ATIDiredPac
(use-package all-the-icons-dired (use-package all-the-icons-dired

View File

@ -61,7 +61,7 @@
(use-package elpy (use-package elpy
:after flycheck :after flycheck
:mode "\\.py\\" :mode "\\.py\\'"
:custom :custom
(flycheck-python-flake8-executable "python") (flycheck-python-flake8-executable "python")
(python-indent-offset 4) (python-indent-offset 4)

View File

@ -6,8 +6,8 @@
;; Copyright (C) 2019 Mingde (Matthew) Zeng ;; Copyright (C) 2019 Mingde (Matthew) Zeng
;; Created: Thu Mar 14 17:11:56 2019 (-0400) ;; Created: Thu Mar 14 17:11:56 2019 (-0400)
;; Version: 2.0.0 ;; Version: 2.0.0
;; Last-Updated: Fri Aug 23 10:49:38 2019 (-0400) ;; Last-Updated: Tue Jan 7 10:15:29 2020 (+0100)
;; By: Mingde (Matthew) Zeng ;; By: Mikaël Capelle
;; URL: https://github.com/MatthewZMD/.emacs.d ;; URL: https://github.com/MatthewZMD/.emacs.d
;; Keywords: M-EMACS .emacs.d doom-themes doom-modeline ;; Keywords: M-EMACS .emacs.d doom-themes doom-modeline
;; Compatibility: emacs-version >= 26.1 ;; Compatibility: emacs-version >= 26.1
@ -46,6 +46,12 @@
:custom-face :custom-face
(cursor ((t (:background "BlanchedAlmond")))) (cursor ((t (:background "BlanchedAlmond"))))
:config :config
(setq doom-themes-treemacs-enable-variable-pitch nil)
(setq doom-themes-treemacs-theme "doom-colors")
(doom-themes-treemacs-config)
(with-eval-after-load 'treemacs
(remove-hook 'treemacs-mode-hook #'doom-themes-hide-modeline))
;; flashing mode-line on errors ;; flashing mode-line on errors
(doom-themes-visual-bell-config) (doom-themes-visual-bell-config)
;; Corrects (and improves) org-mode's native fontification. ;; Corrects (and improves) org-mode's native fontification.
@ -65,6 +71,9 @@
(doom-modeline-height 15)) (doom-modeline-height 15))
;; -DoomModeline ;; -DoomModeline
(use-package hide-mode-line
:hook (((completion-list-mode completion-in-region-mode) . hide-mode-line-mode)))
(provide 'init-theme) (provide 'init-theme)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; init-theme.el ends here ;;; init-theme.el ends here