Config: install olivetti to prettify org-mode, edit some keybindings

This commit is contained in:
2026-05-10 04:16:22 +08:00
parent 1b7d2d1e5e
commit 6b58f2928e
6 changed files with 28 additions and 17 deletions

View File

@@ -88,12 +88,6 @@ Disable jinx-mode if it's enable and global-jinx-mode is disable , otherwise tog
(org-back-to-heading) (org-back-to-heading)
(org-cycle))) (org-cycle)))
(defun consult-org-ripgrep ()
"Search in org files use consult-ripgrep."
(interactive)
(consult-ripgrep (unless *is-windows*
'("~/org/my-org-note/" "~/org/hugo/this-is-my-blog/all-blog.org"))))
(defun my-denote-journal-path-to-existing-entry (&optional date interval) (defun my-denote-journal-path-to-existing-entry (&optional date interval)
"Return the path of current denote journal if it exists, otherwise return nil." "Return the path of current denote journal if it exists, otherwise return nil."
(require 'denote-journal) (require 'denote-journal)

View File

@@ -59,11 +59,13 @@
:prefix "C-c o" :prefix "C-c o"
"f" 'consult-notes "f" 'consult-notes
"s" 'consult-org-agenda "s" 'consult-org-agenda
"g" 'consult-org-ripgrep "g" 'consult-notes-search-in-all-notes
"C" 'calendar "C" 'calendar
"c" 'org-capture "c" 'org-capture
"p" 'my-blog-publish "p" 'my-blog-publish
"v" 'my-blog-preview) "v" 'my-blog-preview
"d" 'denote
"r" 'denote-rename-file)
;; q for org-ql ;; q for org-ql
(general-def (general-def
@@ -153,7 +155,8 @@
"C-c t l" 'org-toggle-link-display "C-c t l" 'org-toggle-link-display
"M-{" 'org-previous-visible-heading "M-{" 'org-previous-visible-heading
"M-}" 'org-next-visible-heading "M-}" 'org-next-visible-heading
"C-," 'duplicate-and-move-to-next-line) "C-," 'duplicate-and-move-to-next-line
"C-c o l" 'denote-link)
;; calendar ;; calendar
(general-def calendar-mode-map (general-def calendar-mode-map

View File

@@ -41,8 +41,8 @@
;; 设置todo关键字 ;; 设置todo关键字
(setq org-todo-keywords (setq org-todo-keywords
(quote ((sequence "TODO(t)" "STARTED(s)" "|" "DONE(d!/!)") (quote ((sequence "TODO(t)" "STARTED(S)" "|" "DONE(d!/!)")
(sequence "WAITING(w@/!)" "SOMEDAY(S)" "|" "CANCELLED(c@/!)")))) (sequence "WAITING(w@/!)" "SOMEDAY(s)" "|" "CANCELLED(c@/!)"))))
;; agenda相关 ;; agenda相关
(with-eval-after-load 'recentf (with-eval-after-load 'recentf
@@ -175,13 +175,11 @@
'(("t" "TODO" entry '(("t" "TODO" entry
(file+headline "~/org/my-org-note/20260509T232442==agenda--all-my-todos__org.org" "Something to do") (file+headline "~/org/my-org-note/20260509T232442==agenda--all-my-todos__org.org" "Something to do")
"* TODO %<%m-%d> %?\n%T" "* TODO %<%m-%d> %?\n%T"
:empty-lines 1 :empty-lines 1)
:jump-to-captured t) ("s" "SOMEDAY" entry
("S" "someday" entry
(file+headline "~/org/my-org-note/20260509T232442==agenda--all-my-todos__org.org" "Something to do") (file+headline "~/org/my-org-note/20260509T232442==agenda--all-my-todos__org.org" "Something to do")
"* SOMEDAY %<%m-%d> %?\n%T" "* SOMEDAY %<%m-%d> %?\n%T"
:empty-lines 1 :empty-lines 1))))
:jump-to-captured t))))
(setq org-bookmark-names-plist nil) (setq org-bookmark-names-plist nil)

View File

@@ -30,6 +30,16 @@
colors)))) colors))))
(string-trim (car (split-string choice))))) (string-trim (car (split-string choice)))))
;; org-mode美化
(use-package olivetti
:config
(add-hook 'olivetti-mode-hook
(lambda ()
(display-line-numbers-mode -1)))
(add-hook 'org-mode-hook
(lambda ()
(olivetti-mode 1))))
;; rainbow mode ;; rainbow mode
(use-package rainbow-mode) (use-package rainbow-mode)

View File

@@ -45,6 +45,9 @@
`(dired-async-mode-message ((,class (:foreground ,red)))) `(dired-async-mode-message ((,class (:foreground ,red))))
`(dired-async-message ((,class (:foreground ,yellow)))) `(dired-async-message ((,class (:foreground ,yellow))))
`(consult-file ((,class (:foreground ,green)))) `(consult-file ((,class (:foreground ,green))))
`(consult-notes-name ((,class (:foreground ,base01 :weight bold))))
`(consult-notes-time ((,class (:foreground ,base01 :weight thin))))
`(consult-notes-size ((,class (:foreground ,base01 :weight thin))))
`(denote-faces-keywords ((,class (:foreground ,cyan)))) `(denote-faces-keywords ((,class (:foreground ,cyan))))
`(mode-line ((,class (:foreground ,base0 :background ,base02)))) `(mode-line ((,class (:foreground ,base0 :background ,base02))))
`(mode-line-inactive ((,class (:foreground ,base01 :background ,base03)))) `(mode-line-inactive ((,class (:foreground ,base01 :background ,base03))))

View File

@@ -33,7 +33,7 @@
`(org-block-end-line ((,class (:foreground ,base01 :overline t :slant italic :extend t)))) `(org-block-end-line ((,class (:foreground ,base01 :overline t :slant italic :extend t))))
`(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))))
`(denote-journal-calendar ((,class (:foreground ,red)))) `(denote-journal-calendar ((,class (:foreground ,red :slant italic))))
`(font-lock-keyword-face ((,class (:foreground ,cyan :weight bold)))) `(font-lock-keyword-face ((,class (:foreground ,cyan :weight bold))))
`(font-lock-doc-face ((,class (:foreground ,green :slant normal)))) `(font-lock-doc-face ((,class (:foreground ,green :slant normal))))
`(font-lock-string-face ((,class (:foreground ,green)))) `(font-lock-string-face ((,class (:foreground ,green))))
@@ -45,6 +45,9 @@
`(dired-async-mode-message ((,class (:foreground ,red)))) `(dired-async-mode-message ((,class (:foreground ,red))))
`(dired-async-message ((,class (:foreground ,yellow)))) `(dired-async-message ((,class (:foreground ,yellow))))
`(consult-file ((,class (:foreground ,green)))) `(consult-file ((,class (:foreground ,green))))
`(consult-notes-name ((,class (:foreground ,base01 :weight bold))))
`(consult-notes-time ((,class (:foreground ,base01 :weight thin))))
`(consult-notes-size ((,class (:foreground ,base01 :weight thin))))
`(denote-faces-keywords ((,class (:foreground ,cyan)))) `(denote-faces-keywords ((,class (:foreground ,cyan))))
`(mode-line ((,class (:foreground ,base0 :background ,base02)))) `(mode-line ((,class (:foreground ,base0 :background ,base02))))
`(mode-line-inactive ((,class (:foreground ,base01 :background ,base03)))) `(mode-line-inactive ((,class (:foreground ,base01 :background ,base03))))