add autoloads, clean up dashboard, load indent-guide for python
This commit is contained in:
@@ -160,8 +160,13 @@ DISPLAY-START: `integer', e.g. 3820"
|
|||||||
(gnuplot-mode)
|
(gnuplot-mode)
|
||||||
(my-view-gnuplot))))
|
(my-view-gnuplot))))
|
||||||
|
|
||||||
|
;; not working
|
||||||
|
;; (when (display-graphic-p)
|
||||||
|
;; (setq mode-line-format nil))
|
||||||
|
|
||||||
(use-package awesome-tray
|
(use-package awesome-tray
|
||||||
;;:after my-theme
|
:defer nil
|
||||||
|
:after my-theme
|
||||||
:hook (after-init . awesome-tray-mode)
|
:hook (after-init . awesome-tray-mode)
|
||||||
:config
|
:config
|
||||||
(setq awesome-tray-info-padding-right 1)
|
(setq awesome-tray-info-padding-right 1)
|
||||||
@@ -317,7 +322,8 @@ DISPLAY-START: `integer', e.g. 3820"
|
|||||||
:config
|
:config
|
||||||
(setq doc-view-continuous t))
|
(setq doc-view-continuous t))
|
||||||
|
|
||||||
(use-package restart-emacs)
|
(use-package restart-emacs
|
||||||
|
:commands (restart-emacs restart-emacs-start-new-emacs))
|
||||||
|
|
||||||
(use-package page-break-lines
|
(use-package page-break-lines
|
||||||
:delight (page-break-lines-mode "Pb") ;; "\u24C5\uFF42"
|
:delight (page-break-lines-mode "Pb") ;; "\u24C5\uFF42"
|
||||||
@@ -330,8 +336,9 @@ DISPLAY-START: `integer', e.g. 3820"
|
|||||||
:defer t)
|
:defer t)
|
||||||
|
|
||||||
(use-package all-the-icons
|
(use-package all-the-icons
|
||||||
:defer t
|
:defer nil
|
||||||
:if (display-graphic-p)
|
:if (display-graphic-p)
|
||||||
|
:init (require 'all-the-icons-autoloads)
|
||||||
:config
|
:config
|
||||||
(when (and (not (my-font-installed-p "all-the-icons"))
|
(when (and (not (my-font-installed-p "all-the-icons"))
|
||||||
(window-system))
|
(window-system))
|
||||||
@@ -340,8 +347,11 @@ DISPLAY-START: `integer', e.g. 3820"
|
|||||||
))
|
))
|
||||||
|
|
||||||
(use-package dashboard
|
(use-package dashboard
|
||||||
|
:defer nil
|
||||||
:delight (dashboard-mode "Db") ;; "\u01F153
|
:delight (dashboard-mode "Db") ;; "\u01F153
|
||||||
:hook (after-init . dashboard-setup-startup-hook) ;; activate `dashboard'
|
:after (all-the-icons)
|
||||||
|
:commands (dashboard-mode)
|
||||||
|
:init (require 'dashboard-autoloads)
|
||||||
:config
|
:config
|
||||||
;; see `dashboad-widget'
|
;; see `dashboad-widget'
|
||||||
(setq dashboard-icon-type 'all-the-icons)
|
(setq dashboard-icon-type 'all-the-icons)
|
||||||
@@ -354,7 +364,9 @@ DISPLAY-START: `integer', e.g. 3820"
|
|||||||
(bookmarks . "bookmark")
|
(bookmarks . "bookmark")
|
||||||
(agenda . "calendar")
|
(agenda . "calendar")
|
||||||
(projects . "rocket")
|
(projects . "rocket")
|
||||||
(registers . "database")))
|
(registers . "database")
|
||||||
|
(custom . "versions")
|
||||||
|
))
|
||||||
(setq dashboard-startupify-list
|
(setq dashboard-startupify-list
|
||||||
'(dashboard-insert-banner
|
'(dashboard-insert-banner
|
||||||
dashboard-insert-newline
|
dashboard-insert-newline
|
||||||
@@ -367,6 +379,21 @@ DISPLAY-START: `integer', e.g. 3820"
|
|||||||
dashboard-insert-items
|
dashboard-insert-items
|
||||||
dashboard-insert-newline
|
dashboard-insert-newline
|
||||||
dashboard-insert-footer))
|
dashboard-insert-footer))
|
||||||
|
(setq dashboard-items '(;; (recents . 10) ;; slow
|
||||||
|
(bookmarks . 5)
|
||||||
|
;; (projects . 5) ;; projectile or project.el
|
||||||
|
;; (agenda . 5) ;; will open org file (requires org-mode etc.)
|
||||||
|
(registers . 5)
|
||||||
|
(custom . 5)
|
||||||
|
))
|
||||||
|
(setq dashboard-item-shortcuts
|
||||||
|
'((recents . "r")
|
||||||
|
(bookmarks . "m")
|
||||||
|
(projects . "p")
|
||||||
|
(agenda . "a")
|
||||||
|
(registers . "e")
|
||||||
|
(custom . "b")))
|
||||||
|
|
||||||
(if (display-graphic-p)
|
(if (display-graphic-p)
|
||||||
(let ()
|
(let ()
|
||||||
(require 'all-the-icons)
|
(require 'all-the-icons)
|
||||||
@@ -444,19 +471,7 @@ DISPLAY-START: `integer', e.g. 3820"
|
|||||||
("" "My-Help" "my-help" (lambda (&rest _) (my-help)) dashboard-navigator "" "")
|
("" "My-Help" "my-help" (lambda (&rest _) (my-help)) dashboard-navigator "" "")
|
||||||
("" "Restart" "restart-emacs" (lambda (&rest _) (restart-emacs)) dashboard-navigator "" "")
|
("" "Restart" "restart-emacs" (lambda (&rest _) (restart-emacs)) dashboard-navigator "" "")
|
||||||
)))))
|
)))))
|
||||||
(setq dashboard-items '((recents . 10)
|
|
||||||
(bookmarks . 5)
|
|
||||||
;; (projects . 5)
|
|
||||||
(agenda . 5)
|
|
||||||
(registers . 5)
|
|
||||||
(custom . 5)))
|
|
||||||
(setq dashboard-item-shortcuts
|
|
||||||
'((recents . "r")
|
|
||||||
(bookmarks . "m")
|
|
||||||
(projects . "p")
|
|
||||||
(agenda . "a")
|
|
||||||
(registers . "e")
|
|
||||||
(custom . "b")))
|
|
||||||
;; because we use `use-package' include `use-package-statistics' if
|
;; because we use `use-package' include `use-package-statistics' if
|
||||||
;; computed
|
;; computed
|
||||||
(setq dashboard-init-info
|
(setq dashboard-init-info
|
||||||
@@ -475,52 +490,9 @@ DISPLAY-START: `integer', e.g. 3820"
|
|||||||
(format "Emacs started in %s" time)
|
(format "Emacs started in %s" time)
|
||||||
(format "%d packages loaded in %s" package-count time)))))
|
(format "%d packages loaded in %s" package-count time)))))
|
||||||
|
|
||||||
|
;;
|
||||||
;; custom section
|
;; custom section
|
||||||
|
;;
|
||||||
;; overwrite to supress an inserted whitespace if a pre-defined
|
|
||||||
;; heading is not found. This is used to include own icon, e.g. in
|
|
||||||
;; front of executing `dashboard-insert-section'.
|
|
||||||
(defun dashboard-insert-heading (heading &optional shortcut)
|
|
||||||
"Insert a widget HEADING in dashboard buffer, adding SHORTCUT if provided."
|
|
||||||
(when (and (display-graphic-p) dashboard-set-heading-icons)
|
|
||||||
;; Try loading `all-the-icons'
|
|
||||||
(unless (or (fboundp 'all-the-icons-octicon)
|
|
||||||
(require 'all-the-icons nil 'noerror))
|
|
||||||
(error "Package `all-the-icons' isn't installed"))
|
|
||||||
|
|
||||||
(insert (cond
|
|
||||||
((string-equal heading "Recent Files:")
|
|
||||||
(all-the-icons-octicon (cdr (assoc 'recents dashboard-heading-icons))
|
|
||||||
:height 1.2 :v-adjust 0.0 :face 'dashboard-heading))
|
|
||||||
((string-equal heading "Bookmarks:")
|
|
||||||
(all-the-icons-octicon (cdr (assoc 'bookmarks dashboard-heading-icons))
|
|
||||||
:height 1.2 :v-adjust 0.0 :face 'dashboard-heading))
|
|
||||||
((or (string-equal heading "Agenda for today:")
|
|
||||||
(string-equal heading "Agenda for the coming week:"))
|
|
||||||
(all-the-icons-octicon (cdr (assoc 'agenda dashboard-heading-icons))
|
|
||||||
:height 1.2 :v-adjust 0.0 :face 'dashboard-heading))
|
|
||||||
((string-equal heading "Registers:")
|
|
||||||
(all-the-icons-octicon (cdr (assoc 'registers dashboard-heading-icons))
|
|
||||||
:height 1.2 :v-adjust 0.0 :face 'dashboard-heading))
|
|
||||||
((string-equal heading "Projects:")
|
|
||||||
(all-the-icons-octicon (cdr (assoc 'projects dashboard-heading-icons))
|
|
||||||
:height 1.2 :v-adjust 0.0 :face 'dashboard-heading))
|
|
||||||
;; (t " "))) ;; REMOVED
|
|
||||||
(t ""))) ;; ADDED
|
|
||||||
(insert " "))
|
|
||||||
|
|
||||||
(insert (propertize heading 'face 'dashboard-heading))
|
|
||||||
|
|
||||||
;; Turn the inserted heading into an overlay, so that we may freely change
|
|
||||||
;; its name without breaking any of the functions that expect the default name.
|
|
||||||
;; If there isn't a suitable entry in `dashboard-item-names',
|
|
||||||
;; we fallback to using HEADING. In that case we still want it to be an
|
|
||||||
;; overlay to maintain consistent behavior (such as the point movement)
|
|
||||||
;; between modified and default headings.
|
|
||||||
(let ((ov (make-overlay (- (point) (length heading)) (point) nil t)))
|
|
||||||
(overlay-put ov 'display (or (cdr (assoc heading dashboard-item-names)) heading))
|
|
||||||
(overlay-put ov 'face 'dashboard-heading))
|
|
||||||
(when shortcut (insert (format " (%s)" shortcut))))
|
|
||||||
|
|
||||||
;;; define functions for the section
|
;;; define functions for the section
|
||||||
;; `clean-buffer-list'
|
;; `clean-buffer-list'
|
||||||
@@ -556,11 +528,6 @@ If INTERNAL non-nil then include internal buffers."
|
|||||||
|
|
||||||
Example `dashboard-insert-recent'.
|
Example `dashboard-insert-recent'.
|
||||||
See also `dashboard-insert-section' for the sequence of elements."
|
See also `dashboard-insert-section' for the sequence of elements."
|
||||||
;; insert icon
|
|
||||||
(when (display-graphic-p)
|
|
||||||
(insert (all-the-icons-octicon
|
|
||||||
"versions"
|
|
||||||
:height 1.2 :v-adjust 0.0 :face 'dashboard-heading)))
|
|
||||||
(dashboard-insert-section
|
(dashboard-insert-section
|
||||||
"Special Buffers:"
|
"Special Buffers:"
|
||||||
(my-buffer-name-list-special-only) ;; (my-buffer-name-list t)
|
(my-buffer-name-list-special-only) ;; (my-buffer-name-list t)
|
||||||
@@ -570,13 +537,18 @@ See also `dashboard-insert-section' for the sequence of elements."
|
|||||||
`(lambda (&rest _) (switch-to-buffer ,el))
|
`(lambda (&rest _) (switch-to-buffer ,el))
|
||||||
(abbreviate-file-name el)))
|
(abbreviate-file-name el)))
|
||||||
(add-to-list 'dashboard-item-generators '(custom . dashboard-insert-custom))
|
(add-to-list 'dashboard-item-generators '(custom . dashboard-insert-custom))
|
||||||
|
|
||||||
|
(dashboard-setup-startup-hook)
|
||||||
|
(dashboard-open)
|
||||||
)
|
)
|
||||||
|
|
||||||
;; too slow if all levels are displayed for a medium large file,
|
;; too slow if all levels are displayed for a medium large file,
|
||||||
;; therefore not all levels and if toggled on and mode default off
|
;; therefore not all levels and if toggled on and mode default off
|
||||||
(use-package indent-guide
|
(use-package indent-guide
|
||||||
:delight (indent-guide-mode "Ig") ;; "\u24BE\uFF47"
|
:delight (indent-guide-mode "Ig") ;; "\u24BE\uFF47"
|
||||||
|
:commands (indent-guide-mode)
|
||||||
;;:hook (prog-mode . indent-guide-mode) ;; problem if used in notmuch
|
;;:hook (prog-mode . indent-guide-mode) ;; problem if used in notmuch
|
||||||
|
:hook (python-mode . indent-guide-mode)
|
||||||
:config
|
:config
|
||||||
(set-face-attribute 'indent-guide-face nil :foreground "DarkSlateGray") ;; foreground #535353
|
(set-face-attribute 'indent-guide-face nil :foreground "DarkSlateGray") ;; foreground #535353
|
||||||
;;(setq indent-guide-char ":")
|
;;(setq indent-guide-char ":")
|
||||||
|
|||||||
Reference in New Issue
Block a user