mirror of
http://github.com/JaeUs3792/dotfiles
synced 2025-12-13 23:51:34 +09:00
82 lines
3.4 KiB
EmacsLisp
82 lines
3.4 KiB
EmacsLisp
;;; init-utils.el -*- lexical-binding: t -*-
|
|
(use-package rg
|
|
:straight t
|
|
:ensure t
|
|
:defer t)
|
|
|
|
;; text mode directory tree
|
|
(use-package ztree
|
|
:straight t
|
|
:ensure t
|
|
:defer t
|
|
:custom-face
|
|
(ztreep-header-face ((t (:inherit diff-header))))
|
|
(ztreep-arrow-face ((t (:inherit font-lock-comment-face))))
|
|
(ztreep-leaf-face ((t (:inherit diff-index))))
|
|
(ztreep-node-face ((t (:inherit font-lock-variable-name-face))))
|
|
(ztreep-expand-sign-face ((t (:inherit font-lock-function-name-face))))
|
|
(ztreep-diff-header-face ((t (:inherit (diff-header bold)))))
|
|
(ztreep-diff-header-small-face ((t (:inherit diff-file-header))))
|
|
(ztreep-diff-model-normal-face ((t (:inherit font-lock-doc-face))))
|
|
(ztreep-diff-model-ignored-face ((t (:inherit font-lock-doc-face :strike-through t))))
|
|
(ztreep-diff-model-diff-face ((t (:inherit diff-removed))))
|
|
(ztreep-diff-model-add-face ((t (:inherit diff-nonexistent))))
|
|
:pretty-hydra
|
|
((:title (pretty-hydra-title "Ztree" 'octicon "nf-oct-diff" :face 'nerd-icons-green)
|
|
:color pink :quit-key ("q" "C-g"))
|
|
("Diff"
|
|
(("C" ztree-diff-copy "copy" :exit t)
|
|
("h" ztree-diff-toggle-show-equal-files "show/hide equals" :exit t)
|
|
("H" ztree-diff-toggle-show-filtered-files "show/hide ignores" :exit t)
|
|
("D" ztree-diff-delete-file "delete" :exit t)
|
|
("v" ztree-diff-view-file "view" :exit t)
|
|
("d" ztree-diff-simple-diff-files "simple diff" :exit t)
|
|
("r" ztree-diff-partial-rescan "partial rescan" :exit t)
|
|
("R" ztree-diff-full-rescan "full rescan" :exit t))
|
|
"View"
|
|
(("RET" ztree-perform-action "expand/collapse or view" :exit t)
|
|
("SPC" ztree-perform-soft-action "expand/collapse or view in other" :exit t)
|
|
("TAB" ztree-jump-side "jump side" :exit t)
|
|
("g" ztree-refresh-buffer "refresh" :exit t)
|
|
("x" ztree-toggle-expand-subtree "expand/collapse" :exit t)
|
|
("<backspace>" ztree-move-up-in-tree "go to parent" :exit t))))
|
|
:bind (:map ztreediff-mode-map
|
|
("<f6>" . ztree-hydra/body))
|
|
:init (setq ztree-draw-unicode-lines t
|
|
ztree-show-number-of-children t))
|
|
|
|
(use-package list-environment
|
|
:straight t
|
|
:ensure t
|
|
:defer t
|
|
:hook (list-environment-mode . (lambda ()
|
|
(setq tabulated-list-format
|
|
(vconcat `(("" ,(if (icons-displayable-p) 2 0)))
|
|
tabulated-list-format))
|
|
(tabulated-list-init-header)))
|
|
:init
|
|
(with-no-warnings
|
|
(defun my-list-environment-entries ()
|
|
"Generate environment variable entries list for tabulated-list."
|
|
(mapcar (lambda (env)
|
|
(let* ((kv (split-string env "="))
|
|
(key (car kv))
|
|
(val (mapconcat #'identity (cdr kv) "=")))
|
|
(list key (vector
|
|
""
|
|
;;(if (icons-displayable-p)
|
|
;; (nerd-icons-octicon "key" :height 0.8 :v-adjust -0.05)
|
|
;; "")
|
|
`(,key face font-lock-keyword-face)
|
|
`(,val face font-lock-string-face)))))
|
|
process-environment))
|
|
(advice-add #'list-environment-entries :override #'my-list-environment-entries)))
|
|
|
|
;; (unless ON-WINDOWS
|
|
;; (use-package daemons) ; system services/daemons
|
|
;; (use-package tldr))
|
|
|
|
|
|
(provide 'init-utils)
|
|
;;; init-utils.el ends here
|