commit c379740504dfed4c0fd453bf56ea9cfc1d868cbc
parent 25c15e3e88cdd6806dc7cd64e98af223e584a689
Author: andsy10 <andsy1016@gmail.com>
Date: Sat, 17 Oct 2026 23:34:34 +0800
Update keybindings
Diffstat:
4 files changed, 37 insertions(+), 10 deletions(-)
diff --git a/lisp/init-completion.el b/lisp/init-completion.el
@@ -37,6 +37,11 @@ With prefix ARG, search for all agenda headings."
(consult-org-heading t 'agenda)
(consult-org-heading "/!" 'agenda)))
+ (defun my-consult-org-agenda-games ()
+ "Jump to a TODO entry in `my-org-capture-game-file'."
+ (interactive)
+ (consult-org-heading t (list my-org-capture-game-file)))
+
(defun my-consult-git-grep-project ()
"Run `consult-git-grep' in current project's root."
(interactive)
diff --git a/lisp/init-elisp.el b/lisp/init-elisp.el
@@ -84,9 +84,7 @@ is no current file, eval the current buffer."
(if file
(progn
(let ((buf (current-buffer)))
- (save-some-buffers
- nil
- (lambda () (eq (current-buffer) buf))))
+ (save-some-buffers nil (lambda () (eq (current-buffer) buf))))
(load-file (buffer-file-name))
(message "Loaded %s" file))
(eval-buffer)
diff --git a/lisp/init-kbd-func.el b/lisp/init-kbd-func.el
@@ -31,6 +31,17 @@
(message "Save `%s' to kill ring." buf))
(message "Cannot find the name of the current buffer.")))
+(defun my-copy-file-path (arg)
+ "Copy the path of the current file.
+With a prefix ARG, copy the expanded file path."
+ (interactive "P")
+ (if-let* ((path (buffer-file-name)))
+ (progn
+ (unless arg (setq path (abbreviate-file-name path)))
+ (kill-new path)
+ (message "Save `%s' to kill ring." path))
+ (message "Cannot find the path of the current file.")))
+
(defun my-count-words-region (start end &optional totals)
"Count the number of words in the region.
With prefix ARG, report for the entire buffer rather than the region."
@@ -213,6 +224,7 @@ When a prefix ARG, do not delete the links from `org-stored-links'."
"Git add/commit/push in `my-blog-directory'."
(interactive)
(my-push-with-timestamp my-blog-directory))
+(defalias 'my-blog-push (symbol-function #'my-org-publish))
(provide 'init-kbd-func)
;;; init-kbd-func.el ends here
diff --git a/lisp/init-kbd.el b/lisp/init-kbd.el
@@ -68,10 +68,6 @@
"C-x r b" #'consult-bookmark
;; window
- "C-M-<left>" #'shrink-window-horizontally
- "C-M-<right>" #'enlarge-window-horizontally
- "C-M-<down>" #'shrink-window
- "C-M-<up>" #'enlarge-window
"M-`" #'popper-toggle
"C-M--" #'popper-toggle-type
"C-M-=" #'my-popper-toggle-type-delete-other-window
@@ -86,6 +82,7 @@
;; other
"C-h h" #'hyperbole
"C-c /" #'hui-search-web
+ "C-c \\" #'hycontrol-enable-windows-mode
"M-RET" #'my-hkey-either-lazy
"C-;" #'embark-act
"M-s M-b" #'eww-list-bookmarks
@@ -93,6 +90,10 @@
"<f8>" #'emms-pause
"<f7>" #'emms-previous
"<f9>" #'emms-next
+ "M-<f3>" #'profiler-start
+ "M-<f4>" #'profiler-stop
+ "C-x C-=" #'cnfonts-increase-fontsize
+ "C-x C--" #'cnfonts-decrease-fontsize
[remap count-words-region] #'my-count-words-region
[remap eval-expression] #'pp-eval-expression
[remap ispell-word] #'jinx-correct
@@ -204,7 +205,8 @@
;; flycheck
(general-def flycheck-command-map
- "a" #'flycheck-annotate-mode)
+ "g" #'flycheck-annotate-mode
+ "a" #'eglot-code-actions)
;; ghostel
(general-def (ghostel-mode-map
@@ -282,9 +284,15 @@
(general-def minibuffer-local-map
"C-c C-e" #'embark-export)
+;; olivetti
+(general-def olivetti-mode-map
+ "C-c \\" nil)
+
;; org-agenda
(general-def org-agenda-mode-map
"C-/" #'org-agenda-undo)
+(general-def org-ql-view-map
+ "q" #'org-agenda-quit)
;; org-mode
(general-def org-mode-map
@@ -298,7 +306,8 @@
"C-c o l" #'denote-link-or-create
"C-c o L" #'denote-org-link-to-heading
"C-c o B" #'my-denote-org-find-backlink-for-heading-with-location
- "C-c o t" #'my-org-tree-slide-start)
+ "C-c o t" #'my-org-tree-slide-start
+ "C-c \\" nil)
;; org-tree-slide-mode
(general-def org-tree-slide-mode-map
@@ -441,6 +450,7 @@
"g" #'my-consult-denote-grep
"G" #'my-blog-grep
"s" #'my-consult-org-agenda
+ "p" #'my-consult-org-agenda-games
"C" #'calendar
"c" #'org-capture
"n" #'denote
@@ -526,10 +536,12 @@
"g" #'gt-translate
"w" #'my-synosaurus-lookup)
+;; y for copy paste
(general-def
:prefix "C-c y"
"d" #'my-copy-function-name
- "b" #'my-copy-buffer-name)
+ "b" #'my-copy-buffer-name
+ "f" #'my-copy-file-path)
;;; other