233 lines
6.4 KiB
EmacsLisp
233 lines
6.4 KiB
EmacsLisp
;;; init-package.el --- some other packages -*- lexical-binding: t -*-
|
||
|
||
;;; Commentary:
|
||
|
||
;;; Code:
|
||
|
||
;; keycast,按键广播
|
||
(if use-package-always-defer
|
||
(use-package keycast))
|
||
|
||
;; anzu,显示isearch匹配数字
|
||
(use-package anzu
|
||
:delight
|
||
:hook
|
||
(after-init . global-anzu-mode))
|
||
|
||
;; wgrep,writable grep
|
||
(use-package wgrep)
|
||
|
||
;; ripgrep
|
||
(use-package rg)
|
||
|
||
;; hydra
|
||
(use-package hydra
|
||
:config
|
||
;; multiple-cursors hydra
|
||
(defhydra hydra-multiple-cursors ()
|
||
"
|
||
^Mark^ ^Unmark^ ^Other^
|
||
------------------------------------------------------------------
|
||
_p_ : prev line _P_ : previous _c_ : edit lines
|
||
_n_ : next line _N_ : next _._ : pop
|
||
_b_ : prev word _q_ : quit
|
||
_f_ : next word _i_ : insert numbers
|
||
_B_ : prev symbol
|
||
_F_ : next symbol
|
||
_s_ : in region
|
||
_a_ : all dwim
|
||
"
|
||
("p" mc/mark-previous-like-this)
|
||
("n" mc/mark-next-like-this)
|
||
("b" mc/mark-previous-like-this-word)
|
||
("f" mc/mark-next-like-this-word)
|
||
("B" mc/mark-previous-like-this-symbol)
|
||
("F" mc/mark-next-like-this-symbol)
|
||
("P" mc/unmark-previous-like-this)
|
||
("N" mc/unmark-next-like-this)
|
||
("a" mc/mark-all-dwim)
|
||
("s" mc/mark-all-in-region)
|
||
("c" mc/edit-lines)
|
||
("i" mc/insert-numbers)
|
||
("." mc/mark-pop)
|
||
("q" nil)))
|
||
|
||
;; jinx,拼写检查
|
||
(unless *is-windows*
|
||
(use-package jinx
|
||
:delight
|
||
(jinx-mode " Jinx" jinx)
|
||
:bind
|
||
([remap ispell-word] . jinx-correct)
|
||
:config
|
||
(setq jinx-languages "en_US")
|
||
(add-to-list 'jinx-exclude-regexps '(t "\\cc"))
|
||
(with-eval-after-load 'jinx
|
||
(dolist (range '((#x4E00 . #x9FFF)
|
||
(#x3400 . #x4DBF)
|
||
(#x3000 . #x303F)
|
||
(#xFF00 . #xFFEF)
|
||
(#x20000 . #x2A6DF)))
|
||
(let ((start (car range))
|
||
(end (cdr range)))
|
||
(dotimes (i (- end start))
|
||
(modify-syntax-entry (+ start i) "_" jinx--syntax-table))))))
|
||
|
||
(use-package consult-jinx
|
||
:straight
|
||
(consult-jinx
|
||
:type git
|
||
:host github
|
||
:repo "Andsy10/consult-jinx"
|
||
:protocol ssh)))
|
||
|
||
;; eat,终端
|
||
(unless *is-windows*
|
||
(use-package eat
|
||
:straight
|
||
(eat :type git
|
||
:host codeberg
|
||
:repo "akib/emacs-eat"
|
||
:files ("*.el"
|
||
("term" "term/*.el")
|
||
"*.texi"
|
||
"*.ti"
|
||
("terminfo/e" "terminfo/e/*")
|
||
("terminfo/65" "terminfo/65/*")
|
||
("integration" "integration/*")
|
||
(:exclude ".dir-locals.el" "*-tests.el")))
|
||
:hook
|
||
(eshell-load . eat-eshell-mode)
|
||
(eshell-load . eat-eshell-visual-command-mode)
|
||
(eat-mode . toggle-truncate-lines)
|
||
:config
|
||
(setq eat-term-terminfo-directory eat--terminfo-path)))
|
||
|
||
;; perspective,工作区管理
|
||
(use-package perspective
|
||
:bind
|
||
("C-x M-b" . persp-list-buffers)
|
||
:custom
|
||
(persp-mode-prefix-key (kbd "C-c p"))
|
||
:hook
|
||
(after-init . persp-mode)
|
||
:config
|
||
(setq persp-switch-to-buffer-behavior 'switch)
|
||
(with-eval-after-load 'consult
|
||
(consult-customize consult-source-buffer :hidden t :default nil)
|
||
(add-to-list 'consult-buffer-sources persp-consult-source))
|
||
(setq switch-to-prev-buffer-skip
|
||
(lambda (win buff bury-or-kill)
|
||
(or (not (persp-is-current-buffer buff))
|
||
(cl-some (lambda (re) (string-match-p re (buffer-name buff)))
|
||
consult-buffer-filter))))
|
||
(setq persp-initial-frame-name "main"))
|
||
|
||
;; magit
|
||
(use-package magit
|
||
:config
|
||
(setq magit-bind-magit-project-status nil)
|
||
(unless *is-windows*
|
||
(setq magit-diff-refine-hunk 'all)))
|
||
|
||
;; git-timemachine
|
||
(use-package git-timemachine)
|
||
|
||
;; ediff
|
||
(use-package ediff
|
||
:config
|
||
(setq ediff-window-setup-function 'ediff-setup-windows-plain
|
||
ediff-split-window-function 'split-window-horizontally))
|
||
|
||
;; diff-hl
|
||
(use-package diff-hl
|
||
:hook
|
||
(diff-hl-mode . diff-hl-margin-mode)
|
||
(diff-hl-mode . global-diff-hl-show-hunk-mouse-mode)
|
||
(diff-hl-mode . diff-hl-flydiff-mode))
|
||
|
||
;; project
|
||
(use-package project
|
||
:config
|
||
(setq project-switch-commands (assq-delete-all 'project-vc-dir project-switch-commands))
|
||
(setq project-switch-commands
|
||
(seq-uniq (append project-switch-commands
|
||
'((magit-project-status "Magit" ?v)
|
||
(eat-project "Eat" ?E)
|
||
(project-query-replace-regexp "Query Replace" ?R)
|
||
(consult-ripgrep "Ripgrep" ?r)
|
||
(consult-project-buffer "Buffers" ?b)
|
||
(project-ibuffer "Ibuffer" ?i)
|
||
(opencode "OpenCode" ?a))))))
|
||
|
||
(use-package project-ibuffer
|
||
:straight
|
||
(project-ibuffer :type git
|
||
:host github
|
||
:repo "Andsy10/project-ibuffer"
|
||
:protocol ssh))
|
||
|
||
;; emms
|
||
(use-package emms
|
||
:commands
|
||
(emms-playlist-mode-switch-buffer)
|
||
:config
|
||
(emms-all)
|
||
(setq emms-player-list '(emms-player-vlc)
|
||
emms-info-functions '(emms-info-native))
|
||
(emms-history-load))
|
||
|
||
;; tokei
|
||
(use-package tokei)
|
||
|
||
;; helpful
|
||
(use-package helpful
|
||
:bind
|
||
(([remap describe-function] . helpful-callable)
|
||
([remap describe-command] . helpful-command)
|
||
([remap describe-variable] . helpful-variable)
|
||
([remap describe-key] . helpful-key)
|
||
([remap describe-symbol] . helpful-symbol)
|
||
:map emacs-lisp-mode-map
|
||
("C-c C-d C-d" . helpful-at-point)
|
||
:map lisp-interaction-mode-map
|
||
("C-c C-d C-d" . helpful-at-point)
|
||
:map helpful-mode-map
|
||
("C-x K" . helpful-kill-buffers)
|
||
("r" . remove-hook-at-point)))
|
||
|
||
;; typit,打字游戏
|
||
(use-package typit)
|
||
|
||
;; power-mode
|
||
(use-package power-mode)
|
||
|
||
;; guix
|
||
(if *is-linux*
|
||
(use-package guix))
|
||
|
||
;; proced,进程管理器
|
||
(use-package proced
|
||
:straight nil
|
||
:custom
|
||
(proced-auto-update-flag t)
|
||
(proced-goal-attribute nil)
|
||
(proced-show-remote-processes t)
|
||
(proced-enable-color-flag t)
|
||
(proced-format 'custom)
|
||
:config
|
||
(add-to-list
|
||
'proced-format-alist
|
||
'(custom user pid ppid sess tree pcpu pmem rss start time state (args comm)))
|
||
(setq proced-low-memory-usage-threshold 0.025
|
||
proced-medium-memory-usage-threshold 0.125))
|
||
|
||
;; syncthing
|
||
(use-package syncthing
|
||
:hook
|
||
(syncthing-mode . disable-truncate-lines))
|
||
|
||
(provide 'init-package)
|
||
|
||
;;; init-package.el ends here
|