commit f2fc7e2c672aa2084b972947950a527bbfce5fcd
parent f3c545655f1b388f7349a5a35e6edfcbfdc85df2
Author: andsy10 <andsy1016@gmail.com>
Date: Sat, 12 Sep 2026 16:01:58 +0800
Update functions and keybindings
Diffstat:
6 files changed, 29 insertions(+), 25 deletions(-)
diff --git a/lisp/init-dired.el b/lisp/init-dired.el
@@ -102,12 +102,12 @@ the hardcoded fallback recipe."
:description
(lambda ()
(format "Gitignore filter (%s)"
- (if dired-gitignore-mode
+ (if dired-gitignore--global-mode-active
(propertize "+" 'face 'transient-value)
(propertize "-" 'face 'transient-inactive-value))))
:transient t
(interactive)
- (dired-gitignore-mode 'toggle))
+ (dired-gitignore-global-mode))
(transient-append-suffix 'dirvish-vc-menu "v"
'("i" dirvish-toggle-gitignore)))
diff --git a/lisp/init-elpa.el b/lisp/init-elpa.el
@@ -5,7 +5,6 @@
;;; Code:
;; straight.el
-
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name
diff --git a/lisp/init-kbd-func.el b/lisp/init-kbd-func.el
@@ -19,7 +19,7 @@ With a prefix ARG create a new *scratch* buffer."
(funcall initial-major-mode))
(scratch-buffer)))
-(defun disable-truncate-lines ()
+(defun enable-truncate-lines ()
(toggle-truncate-lines 1))
(defun other-window-backward ()
@@ -32,10 +32,13 @@ With a prefix ARG create a new *scratch* buffer."
(let ((case-fold-search nil))
(call-interactively #'query-replace)))
-(defun my-show-utc-time ()
+(defun my-show-utc-time (&optional arg)
"Display current UTC time in echo area."
- (interactive)
- (message (format-time-string "%Y-%m-%d %H:%M UTC" nil t)))
+ (interactive "P")
+ (let ((time (format-time-string "%Y-%m-%d %H:%M UTC" nil t)))
+ (if arg
+ (progn (kill-new time) (message "Save '%s' to kill ring." time))
+ (message time))))
(defun my-straight-packages-count ()
"Count how many straight.el package are currently installed."
@@ -97,9 +100,9 @@ With a prefix ARG create a new *scratch* buffer."
(message "Push successfully %s" timestamp)))))
(defun my-note-push ()
- "Git add/commit/push in `~/org/my-org-note/'."
+ "Git add/commit/push in 'org-directory'."
(interactive)
- (my-push-with-timestamp "~/org/my-org-note/"))
+ (my-push-with-timestamp org-directory))
(defun my-org-publish ()
"Git add/commit/push in `my-blog-directory'."
diff --git a/lisp/init-kbd.el b/lisp/init-kbd.el
@@ -121,6 +121,7 @@
"C" #'calendar
"c" #'org-capture
"d" #'denote
+ "D" #'denote-date
"r" #'denote-rename-file-date
"R" #'denote-rename-file
"m" #'my-denote-open-metanote
@@ -246,12 +247,14 @@
"C-q" #'ghostel-send-next-key)
(general-def ghostel-char-mode-map
- "M-]" nil)
+ "M-]" nil
+ "C-M-SPC" #'ghostel--send-event)
(general-def ghostel-semi-char-mode-map
"M-o" nil
"C-c h" #'consult-ghostel-history
- "C-k" #'my-ghostel-send-C-k-and-kill)
+ "C-k" #'my-ghostel-send-C-k-and-kill
+ "C-M-SPC" #'ghostel--send-event)
;; embark
(general-def embark-file-map
@@ -360,6 +363,7 @@
"<mouse-5>" #'next-buffer
"M-[" #'previous-buffer
"M-]" #'next-buffer
+ "C-x 4 b" #'consult-buffer-other-window
"C-x C-b" #'ibuffer-other-window
"C-x K" #'crux-kill-other-buffers
"C-x b" #'consult-buffer
diff --git a/lisp/init-org.el b/lisp/init-org.el
@@ -105,7 +105,7 @@
(defun my-denote-find-file (&optional arg)
"Find file use denote-open-or-create."
(interactive "P")
- (let ((denote-excluded-files-regexp (if arg nil "=journal\\|=archive")))
+ (let ((denote-excluded-files-regexp (if arg nil (concat denote-excluded-files-regexp "\\|=journal"))))
(call-interactively #'denote-open-or-create)))
(defun my-denote-find-backlink-with-location ()
@@ -120,6 +120,7 @@
(setq denote-directory org-directory
denote-org-store-link-to-heading 'context
+ denote-date-prompt-use-org-read-date t
denote-prompts '(title signature keywords))
(setq denote-title-history nil
denote-signature-history
@@ -188,6 +189,8 @@
(denote-journal-new-or-existing-entry)
(find-file entry))))
+ (advice-add 'calendar-redraw :after #'denote-journal-calendar-mark-dates)
+
(setq denote-journal-directory (expand-file-name "journal" denote-directory))
(setq denote-journal-keyword nil)
(setq denote-journal-signature "journal")
@@ -228,7 +231,7 @@
(use-package org-agenda
:straight nil
:hook
- (org-agenda-finalize . disable-truncate-lines)
+ (org-agenda-finalize . enable-truncate-lines)
:config
(setq org-agenda-prefix-format '((agenda . " %?-12t% s")
(todo . " ")
@@ -318,7 +321,7 @@
(blink-cursor-mode -1)
(cnfonts-increase-fontsize 5)
(hl-line-mode 'toggle)
- (read-only-mode 1)
+ (view-mode 1)
(jinx-mode -1)
(org-tree-slide-mode 1)))
@@ -330,7 +333,7 @@
(blink-cursor-mode 1)
(cnfonts-decrease-fontsize 5)
(hl-line-mode 1)
- (read-only-mode -1)
+ (view-mode -1)
(jinx-mode 1)
(org-tree-slide-mode -1))))
diff --git a/lisp/init-package.el b/lisp/init-package.el
@@ -255,7 +255,7 @@ Like normal Emacs `C-k'. Kill to end of line and put content in kill-ring."
;; syncthing
(use-package syncthing
:hook
- (syncthing-mode . disable-truncate-lines))
+ (syncthing-mode . enable-truncate-lines))
;; pinentry
(if *is-linux*
@@ -311,22 +311,17 @@ Like normal Emacs `C-k'. Kill to end of line and put content in kill-ring."
;; hyperbole
(use-package hyperbole
+ :straight (hyperbole :type git :host github :repo "rswgnu/hyperbole")
:defer 5
:delight
(hywiki-mode nil hywiki)
(hyperbole-mode nil hyperbole)
:bind
- (("C-h h" . hyperbole)
- ("M-RET" . my-hkey-either-lazy))
+ (("C-h h" . hyperbole))
:custom
(hsys-org-enable-smart-keys :buttons)
- :init
- (defun my-hkey-either-lazy (&optional arg)
- (interactive "P")
- (require 'hyperbole)
- (hyperbole-mode 1)
- (keymap-global-unset "M-RET")
- (hkey-either arg)))
+ :config
+ (hyperbole-mode 1))
;; elfeed
(use-package elfeed