feat(base): Add magit-prime, org-tree-slide, pixel-scroll and eww config

- Install magit-prime package
- Add org-tree-slide with custom start/stop functions and keybindings
- Enable pixel-scroll-precision-mode
- Add basic eww configuration
This commit is contained in:
2026-06-10 03:56:07 +08:00
parent a524b13444
commit 2eae88527a
13 changed files with 95 additions and 15 deletions

View File

@@ -20,10 +20,10 @@
(require 'init-elpa)
(require 'init-base)
(require 'init-edit)
(require 'init-completion)
(require 'init-package)
(require 'init-org)
(require 'init-prog)
(require 'init-completion)
(require 'init-window)
(require 'init-exwm)
(require 'init-dired)

View File

@@ -115,6 +115,11 @@
("App" (mode . exwm-mode))
("Scratch" (or
(name . "^*scratch")))
("eww" (or
(mode . eww-mode)
(mode . eww-bookmark-mode)
(mode . eww-buffers-mode)
(mode . eww-history-mode)))
("Shell" (or
(mode . eshell-mode)
(mode . eat-mode)
@@ -209,6 +214,25 @@
:config
(setq kill-whole-line t ;kill-line删除换行符
set-mark-command-repeat-pop t)) ;更方便地pop mark
;; 滚动
(use-package pixel-scroll
:straight nil
:hook
(after-init . pixel-scroll-precision-mode)
:config
(setq scroll-preserve-screen-position t
scroll-conservatively 101))
;; eww
(use-package eww
:config
(setq eww-auto-rename-buffer t))
;; shr
(use-package shr
:config
(setq shr-inhibit-images nil))
(provide 'init-base)

View File

@@ -134,6 +134,9 @@ targets."
(use-package corfu
:autoload
(corfu-quit consult-completion-in-region)
:bind
(:map corfu-map
("M-d" . corfu-popupinfo-documentation))
:custom
(corfu-auto t)
(corfu-auto-prefix 2)

View File

@@ -19,7 +19,9 @@
mouse-drag-and-drop-region-cross-program t
dired-compress-file-default-suffix ".zip"
dired-kill-when-opening-new-dired-buffer nil
dired-auto-revert-buffer t)
dired-auto-revert-buffer t
dired-create-destination-dirs 'ask
dired-create-destination-dirs-on-trailing-dirsep t)
(put 'dired-find-alternate-file 'disabled nil))
;; dirvish

View File

@@ -6,7 +6,9 @@
(when *is-linux*
(use-package exwm
:defer t
:hook
(exwm-init . restart-fcitx5)
(exwm-init . my-desktop-init)
:config
(setq pop-up-windows nil)
(setq exwm-workspace-number 1)
@@ -126,11 +128,6 @@
"import -window root ~/Pictures/screenshot-$(date +%Y%m%d-%H%M%S).png")
(desktop-environment-screenshot-partial-command
"import ~/Pictures/screenshot-$(date +%Y%m%d-%H%M%S).png"))
(add-hook 'exwm-init-hook
(lambda ()
(restart-fcitx5)
(my-desktop-init)))
(use-package xdg-launcher
:demand t

View File

@@ -59,6 +59,11 @@ Disable jinx-mode if it's enable and global-jinx-mode is disable , otherwise tog
nil 0 nil
(file-name-directory (expand-file-name file)))))
(defun my-open-current-directory ()
"Open current directory in default file explorer."
(interactive)
(consult-directory-externally default-directory))
(defun consult-fd-home ()
"Search for all files in home folder use fd."
(interactive)
@@ -66,11 +71,6 @@ Disable jinx-mode if it's enable and global-jinx-mode is disable , otherwise tog
(default-directory "~/"))
(consult-fd)))
(defun my-open-current-directory ()
"Open current directory in default file explorer."
(interactive)
(consult-directory-externally default-directory))
(defun org-cycle-parent-subtree()
"Cycle parent org subtree."
(interactive)
@@ -145,6 +145,33 @@ Disable jinx-mode if it's enable and global-jinx-mode is disable , otherwise tog
(interactive)
(my-blog-publish "~/org/my-org-note/"))
(defun my-org-tree-slide-start ()
"Start `org-tree-slide'."
(interactive)
(when (eq major-mode 'org-mode)
(setq-local header-line-format nil
mode-line-format nil
cursor-type 'hbar
olivetti-body-width 100)
(blink-cursor-mode -1)
(cnfonts-increase-fontsize 3)
(hl-line-mode 'toggle)
(read-only-mode 1)
(jinx-mode -1)
(org-tree-slide-mode 1)))
(defun my-org-tree-slide-stop ()
"Stop `org-tree-slide'."
(interactive)
(when (and (eq major-mode 'org-mode) (memq 'org-tree-slide-mode local-minor-modes))
(org-mode-restart)
(blink-cursor-mode 1)
(cnfonts-decrease-fontsize 3)
(hl-line-mode 1)
(read-only-mode -1)
(jinx-mode 1)
(org-tree-slide-mode -1)))
(defun my-dired-next-line()
"Move to forward line in dired buffer"
(interactive)

View File

@@ -239,7 +239,15 @@
"C-c o b" 'denote-backlinks
"C-c o B" 'denote-org-backlinks-for-heading
"C-a" 'mwim-beginning
"C-e" 'mwim-end)
"C-e" 'mwim-end
"C-c o t" 'my-org-tree-slide-start)
;; org-tree-slide-mode
(general-def org-tree-slide-mode-map
"<left>" 'org-tree-slide-move-previous-tree
"<right>" 'org-tree-slide-move-next-tree
"C-c o t" 'my-org-tree-slide-stop
"ESC" 'my-org-tree-slide-stop)
;; hs-hide-mode
(general-def hs-minor-mode-map
@@ -286,6 +294,11 @@
"p" 'previous-line
"P" 'discomfort-poweroff)
;; eww
(general-def eww-mode-map
"M-n" 'forward-paragraph
"M-p" 'backward-paragraph)
;; global map with C-c prefix
(general-def
:prefix "C-c"

View File

@@ -247,6 +247,9 @@ See `org-capture-templates' for more information."
(file+headline "~/org/hugo/this-is-my-blog/all-blog.org" "Blog Ideas")
(function org-hugo-new-subtree-post-capture-template))))))
;; presentation
(use-package org-tree-slide)
;; 农历日历
(use-package cal-china-x
:after calendar

View File

@@ -111,6 +111,9 @@
(setq magit-bind-magit-project-status nil
magit-diff-refine-hunk 'all))
(use-package magit-prime
:hook after-init)
;; git-timemachine
(use-package git-timemachine)

View File

@@ -45,7 +45,11 @@
:delight
:hook
(org-mode . olivetti-mode)
(olivetti-mode . (lambda () (display-line-numbers-mode -1))))
(olivetti-mode . (lambda () (display-line-numbers-mode -1)))
:custom
(olivetti-body-width 80)
:config
(setq olivetti-body-width 80))
;; rainbow mode
(use-package rainbow-mode)

View File

@@ -46,6 +46,8 @@
"\\*gptel-agent:.*\\*"
"^magit"
"\\*discomfort\\*"
"\\*eww bookmarks\\*"
"\\*eww history\\*"
bookmark-bmenu-mode
lsp-bridge-ref-mode
comint-mode

View File

@@ -34,6 +34,7 @@
`(org-block-end-line ((,class (:foreground ,base01 :slant italic))))
`(org-priority ((,class (:foreground ,green :weight bold))))
`(org-checkbox ((,class (:foreground ,base0 :weight bold))))
`(org-dispatcher-highlight ((,class (:foreground "#c1a059" :background "#253224" :weight bold))))
`(denote-journal-calendar ((,class (:foreground ,cyan :slant italic))))
`(calendar-month-header ((,class (:foreground ,base0 :weight bold))))
`(holiday ((,class (:underline (:style line :color ,yellow)))))

View File

@@ -34,6 +34,7 @@
`(org-block-end-line ((,class (:foreground ,base01 :slant italic))))
`(org-priority ((,class (:foreground ,green :weight bold))))
`(org-checkbox ((,class (:foreground ,base0 :weight bold))))
`(org-dispatcher-highlight ((,class (:foreground "#6b561e" :background "#f0e6b8" :weight bold))))
`(denote-journal-calendar ((,class (:foreground ,cyan :slant italic))))
`(calendar-month-header ((,class (:foreground ,base0 :weight bold))))
`(holiday ((,class (:underline (:style line :color ,yellow)))))