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:
2
init.el
2
init.el
@@ -20,10 +20,10 @@
|
|||||||
(require 'init-elpa)
|
(require 'init-elpa)
|
||||||
(require 'init-base)
|
(require 'init-base)
|
||||||
(require 'init-edit)
|
(require 'init-edit)
|
||||||
|
(require 'init-completion)
|
||||||
(require 'init-package)
|
(require 'init-package)
|
||||||
(require 'init-org)
|
(require 'init-org)
|
||||||
(require 'init-prog)
|
(require 'init-prog)
|
||||||
(require 'init-completion)
|
|
||||||
(require 'init-window)
|
(require 'init-window)
|
||||||
(require 'init-exwm)
|
(require 'init-exwm)
|
||||||
(require 'init-dired)
|
(require 'init-dired)
|
||||||
|
|||||||
@@ -115,6 +115,11 @@
|
|||||||
("App" (mode . exwm-mode))
|
("App" (mode . exwm-mode))
|
||||||
("Scratch" (or
|
("Scratch" (or
|
||||||
(name . "^*scratch")))
|
(name . "^*scratch")))
|
||||||
|
("eww" (or
|
||||||
|
(mode . eww-mode)
|
||||||
|
(mode . eww-bookmark-mode)
|
||||||
|
(mode . eww-buffers-mode)
|
||||||
|
(mode . eww-history-mode)))
|
||||||
("Shell" (or
|
("Shell" (or
|
||||||
(mode . eshell-mode)
|
(mode . eshell-mode)
|
||||||
(mode . eat-mode)
|
(mode . eat-mode)
|
||||||
@@ -210,6 +215,25 @@
|
|||||||
(setq kill-whole-line t ;kill-line删除换行符
|
(setq kill-whole-line t ;kill-line删除换行符
|
||||||
set-mark-command-repeat-pop t)) ;更方便地pop mark
|
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)
|
(provide 'init-base)
|
||||||
|
|
||||||
;;; init-base.el ends here
|
;;; init-base.el ends here
|
||||||
|
|||||||
@@ -134,6 +134,9 @@ targets."
|
|||||||
(use-package corfu
|
(use-package corfu
|
||||||
:autoload
|
:autoload
|
||||||
(corfu-quit consult-completion-in-region)
|
(corfu-quit consult-completion-in-region)
|
||||||
|
:bind
|
||||||
|
(:map corfu-map
|
||||||
|
("M-d" . corfu-popupinfo-documentation))
|
||||||
:custom
|
:custom
|
||||||
(corfu-auto t)
|
(corfu-auto t)
|
||||||
(corfu-auto-prefix 2)
|
(corfu-auto-prefix 2)
|
||||||
|
|||||||
@@ -19,7 +19,9 @@
|
|||||||
mouse-drag-and-drop-region-cross-program t
|
mouse-drag-and-drop-region-cross-program t
|
||||||
dired-compress-file-default-suffix ".zip"
|
dired-compress-file-default-suffix ".zip"
|
||||||
dired-kill-when-opening-new-dired-buffer nil
|
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))
|
(put 'dired-find-alternate-file 'disabled nil))
|
||||||
|
|
||||||
;; dirvish
|
;; dirvish
|
||||||
|
|||||||
@@ -6,7 +6,9 @@
|
|||||||
|
|
||||||
(when *is-linux*
|
(when *is-linux*
|
||||||
(use-package exwm
|
(use-package exwm
|
||||||
:defer t
|
:hook
|
||||||
|
(exwm-init . restart-fcitx5)
|
||||||
|
(exwm-init . my-desktop-init)
|
||||||
:config
|
:config
|
||||||
(setq pop-up-windows nil)
|
(setq pop-up-windows nil)
|
||||||
(setq exwm-workspace-number 1)
|
(setq exwm-workspace-number 1)
|
||||||
@@ -127,11 +129,6 @@
|
|||||||
(desktop-environment-screenshot-partial-command
|
(desktop-environment-screenshot-partial-command
|
||||||
"import ~/Pictures/screenshot-$(date +%Y%m%d-%H%M%S).png"))
|
"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
|
(use-package xdg-launcher
|
||||||
:demand t
|
:demand t
|
||||||
:after exwm
|
:after exwm
|
||||||
|
|||||||
@@ -59,6 +59,11 @@ Disable jinx-mode if it's enable and global-jinx-mode is disable , otherwise tog
|
|||||||
nil 0 nil
|
nil 0 nil
|
||||||
(file-name-directory (expand-file-name file)))))
|
(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 ()
|
(defun consult-fd-home ()
|
||||||
"Search for all files in home folder use fd."
|
"Search for all files in home folder use fd."
|
||||||
(interactive)
|
(interactive)
|
||||||
@@ -66,11 +71,6 @@ Disable jinx-mode if it's enable and global-jinx-mode is disable , otherwise tog
|
|||||||
(default-directory "~/"))
|
(default-directory "~/"))
|
||||||
(consult-fd)))
|
(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()
|
(defun org-cycle-parent-subtree()
|
||||||
"Cycle parent org subtree."
|
"Cycle parent org subtree."
|
||||||
(interactive)
|
(interactive)
|
||||||
@@ -145,6 +145,33 @@ Disable jinx-mode if it's enable and global-jinx-mode is disable , otherwise tog
|
|||||||
(interactive)
|
(interactive)
|
||||||
(my-blog-publish "~/org/my-org-note/"))
|
(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()
|
(defun my-dired-next-line()
|
||||||
"Move to forward line in dired buffer"
|
"Move to forward line in dired buffer"
|
||||||
(interactive)
|
(interactive)
|
||||||
|
|||||||
@@ -239,7 +239,15 @@
|
|||||||
"C-c o b" 'denote-backlinks
|
"C-c o b" 'denote-backlinks
|
||||||
"C-c o B" 'denote-org-backlinks-for-heading
|
"C-c o B" 'denote-org-backlinks-for-heading
|
||||||
"C-a" 'mwim-beginning
|
"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
|
;; hs-hide-mode
|
||||||
(general-def hs-minor-mode-map
|
(general-def hs-minor-mode-map
|
||||||
@@ -286,6 +294,11 @@
|
|||||||
"p" 'previous-line
|
"p" 'previous-line
|
||||||
"P" 'discomfort-poweroff)
|
"P" 'discomfort-poweroff)
|
||||||
|
|
||||||
|
;; eww
|
||||||
|
(general-def eww-mode-map
|
||||||
|
"M-n" 'forward-paragraph
|
||||||
|
"M-p" 'backward-paragraph)
|
||||||
|
|
||||||
;; global map with C-c prefix
|
;; global map with C-c prefix
|
||||||
(general-def
|
(general-def
|
||||||
:prefix "C-c"
|
:prefix "C-c"
|
||||||
|
|||||||
@@ -247,6 +247,9 @@ See `org-capture-templates' for more information."
|
|||||||
(file+headline "~/org/hugo/this-is-my-blog/all-blog.org" "Blog Ideas")
|
(file+headline "~/org/hugo/this-is-my-blog/all-blog.org" "Blog Ideas")
|
||||||
(function org-hugo-new-subtree-post-capture-template))))))
|
(function org-hugo-new-subtree-post-capture-template))))))
|
||||||
|
|
||||||
|
;; presentation
|
||||||
|
(use-package org-tree-slide)
|
||||||
|
|
||||||
;; 农历日历
|
;; 农历日历
|
||||||
(use-package cal-china-x
|
(use-package cal-china-x
|
||||||
:after calendar
|
:after calendar
|
||||||
|
|||||||
@@ -111,6 +111,9 @@
|
|||||||
(setq magit-bind-magit-project-status nil
|
(setq magit-bind-magit-project-status nil
|
||||||
magit-diff-refine-hunk 'all))
|
magit-diff-refine-hunk 'all))
|
||||||
|
|
||||||
|
(use-package magit-prime
|
||||||
|
:hook after-init)
|
||||||
|
|
||||||
;; git-timemachine
|
;; git-timemachine
|
||||||
(use-package git-timemachine)
|
(use-package git-timemachine)
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,11 @@
|
|||||||
:delight
|
:delight
|
||||||
:hook
|
:hook
|
||||||
(org-mode . olivetti-mode)
|
(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
|
;; rainbow mode
|
||||||
(use-package rainbow-mode)
|
(use-package rainbow-mode)
|
||||||
|
|||||||
@@ -46,6 +46,8 @@
|
|||||||
"\\*gptel-agent:.*\\*"
|
"\\*gptel-agent:.*\\*"
|
||||||
"^magit"
|
"^magit"
|
||||||
"\\*discomfort\\*"
|
"\\*discomfort\\*"
|
||||||
|
"\\*eww bookmarks\\*"
|
||||||
|
"\\*eww history\\*"
|
||||||
bookmark-bmenu-mode
|
bookmark-bmenu-mode
|
||||||
lsp-bridge-ref-mode
|
lsp-bridge-ref-mode
|
||||||
comint-mode
|
comint-mode
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
`(org-block-end-line ((,class (:foreground ,base01 :slant italic))))
|
`(org-block-end-line ((,class (:foreground ,base01 :slant italic))))
|
||||||
`(org-priority ((,class (:foreground ,green :weight bold))))
|
`(org-priority ((,class (:foreground ,green :weight bold))))
|
||||||
`(org-checkbox ((,class (:foreground ,base0 :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))))
|
`(denote-journal-calendar ((,class (:foreground ,cyan :slant italic))))
|
||||||
`(calendar-month-header ((,class (:foreground ,base0 :weight bold))))
|
`(calendar-month-header ((,class (:foreground ,base0 :weight bold))))
|
||||||
`(holiday ((,class (:underline (:style line :color ,yellow)))))
|
`(holiday ((,class (:underline (:style line :color ,yellow)))))
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
`(org-block-end-line ((,class (:foreground ,base01 :slant italic))))
|
`(org-block-end-line ((,class (:foreground ,base01 :slant italic))))
|
||||||
`(org-priority ((,class (:foreground ,green :weight bold))))
|
`(org-priority ((,class (:foreground ,green :weight bold))))
|
||||||
`(org-checkbox ((,class (:foreground ,base0 :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))))
|
`(denote-journal-calendar ((,class (:foreground ,cyan :slant italic))))
|
||||||
`(calendar-month-header ((,class (:foreground ,base0 :weight bold))))
|
`(calendar-month-header ((,class (:foreground ,base0 :weight bold))))
|
||||||
`(holiday ((,class (:underline (:style line :color ,yellow)))))
|
`(holiday ((,class (:underline (:style line :color ,yellow)))))
|
||||||
|
|||||||
Reference in New Issue
Block a user