Config: Update docs in init-kbd.el

This commit is contained in:
trogloxene
2026-03-31 07:28:48 +08:00
parent 494873e7f9
commit 25a95c87b2
2 changed files with 39 additions and 30 deletions

View File

@@ -11,7 +11,7 @@
;; 使用F2打开init.el
(defun open-init-file()
"Open user's init.el file in ~/.emacs.d"
"Open user's init.el file in ~/.emacs.d ."
(interactive)
(find-file "~/.emacs.d/init.el"))
@@ -86,6 +86,7 @@ Disable jinx-mode if it's enable and global-jinx-mode is disable , otherwise tog
;; 快速复制当前行
(defun duplicate-and-move-to-next-line()
"Duplicate current line and move to next line."
(interactive)
(progn
(duplicate-line)
@@ -95,12 +96,12 @@ Disable jinx-mode if it's enable and global-jinx-mode is disable , otherwise tog
;; 切换buffer
(defun my-tab-line-buffers ()
"Get list of buffers shown in tab-line."
(mapcar (lambda (tab)
(mapcar (lambda (tab)
(if (consp tab) (cdr tab) tab))
(funcall tab-line-tabs-function)))
(defun previous-buffer-with-tab-line ()
"Switch to previous buffer in tab-line order"
"Switch to previous buffer in tab-line order."
(interactive)
(let ((already-enabled global-tab-line-mode))
(unless already-enabled
@@ -109,13 +110,13 @@ Disable jinx-mode if it's enable and global-jinx-mode is disable , otherwise tog
(current (current-buffer))
(pos (cl-position current buffers)))
(when pos
(switch-to-buffer
(switch-to-buffer
(nth (mod (1- pos) (length buffers)) buffers))))
(unless already-enabled
(run-with-idle-timer 0.5 nil (lambda () (global-tab-line-mode -1))))))
(defun next-buffer-with-tab-line ()
"Switch to next buffer in tab-line order"
"Switch to next buffer in tab-line order."
(interactive)
(let ((already-enabled global-tab-line-mode))
(unless already-enabled
@@ -124,7 +125,7 @@ Disable jinx-mode if it's enable and global-jinx-mode is disable , otherwise tog
(current (current-buffer))
(pos (cl-position current buffers)))
(when pos
(switch-to-buffer
(switch-to-buffer
(nth (mod (1+ pos) (length buffers)) buffers))))
(unless already-enabled
(run-with-idle-timer 0.5 nil (lambda () (global-tab-line-mode -1))))))
@@ -171,11 +172,12 @@ Disable jinx-mode if it's enable and global-jinx-mode is disable , otherwise tog
;; popper
(global-set-key (kbd "M-`") 'popper-toggle-latest)
(defun popper-toggle-type-delte-other-window()
(defun popper-toggle-type-delete-other-window()
"Toggle type of popper window and delete other window."
(interactive)
(popper-toggle-type)
(delete-other-windows))
(global-set-key (kbd "C-M-=") 'popper-toggle-type-delte-other-window)
(global-set-key (kbd "C-M-=") 'popper-toggle-type-delete-other-window)
;; crux相关
(global-set-key (kbd "C-<backspace>") 'crux-kill-line-backwards) ;; C-DEL kill line backwards
@@ -243,11 +245,11 @@ Disable jinx-mode if it's enable and global-jinx-mode is disable , otherwise tog
(define-key vterm-mode-map (kbd "C-x C-x") 'vterm-send-C-x))
;; ;; eshell
(with-eval-after-load 'eshell
(define-key eshell-mode-map (kbd "M-n") nil)
(define-key eshell-mode-map (kbd "M-p") nil)
(define-key eshell-mode-map (kbd "M-{") 'eshell-previous-matching-input-from-input)
(define-key eshell-mode-map (kbd "M-}") 'eshell-next-matching-input-from-input))
;; (with-eval-after-load 'eshell
;; (define-key eshell-mode-map (kbd "M-n") nil)
;; (define-key eshell-mode-map (kbd "M-p") nil)
;; (define-key eshell-mode-map (kbd "M-{") 'eshell-previous-matching-input-from-input)
;; (define-key eshell-mode-map (kbd "M-}") 'eshell-next-matching-input-from-input))
;; 打开目录
(defun consult-directory-externally (file)
@@ -270,6 +272,7 @@ Disable jinx-mode if it's enable and global-jinx-mode is disable , otherwise tog
;;打开当前文件的目录
(defun my-open-current-directory ()
"Open current directory in default file explorer."
(interactive)
(consult-directory-externally default-directory))
@@ -278,7 +281,7 @@ Disable jinx-mode if it's enable and global-jinx-mode is disable , otherwise tog
;; org-mode相关
;; cycle当前subtree
(defun org-cycle-current-subtree()
"Cycle current org-mode subtree."
"Cycle current subtree."
(interactive)
(org-back-to-heading)
(org-cycle))
@@ -302,11 +305,13 @@ Disable jinx-mode if it's enable and global-jinx-mode is disable , otherwise tog
;; 日记
(defun org-journal-open-current-journal-file-delete-other-window()
"Call org-journal-open-current-journal-file and delete other window."
(interactive)
(org-journal-open-current-journal-file)
(delete-other-windows))
(defun org-journal-new-entry-delete-other-window()
"Call org-journal-new-entry and delete other window."
(interactive)
(org-journal-new-entry nil)
(delete-other-windows))
@@ -339,10 +344,13 @@ Disable jinx-mode if it's enable and global-jinx-mode is disable , otherwise tog
(defun switch-to-emms-playlist()
"Switch to emms playlist."
(interactive)
(switch-to-buffer "*EMMS Playlist*"))
(global-set-key (kbd "C-c m l") 'switch-to-emms-playlist)
(global-set-key (kbd "C-c m d") 'my-emms-play-directory)
(provide 'init-kbd)

View File

@@ -127,22 +127,23 @@
:init (ace-pinyin-global-mode +1))
;; jinx拼写检查
(use-package jinx
:hook (org-mode-hook . jinx-mode)
:bind ([remap ispell-word] . jinx-correct)
:config (setq jinx-languages "en_US")
(add-to-list 'jinx-exclude-regexps '(t "\\cc"))
(with-eval-after-load 'jinx
(dolist (range '((#x4E00 . #x9FFF)
(#x3400 . #x4DBF)
(#x3000 . #x303F)
(#xFF00 . #xFFEF)
(#x20000 . #x2A6DF)))
(let ((start (car range))
(end (cdr range)))
(dotimes (i (- end start))
(modify-syntax-entry (+ start i) "_" jinx--syntax-table)))))
(require 'init-jinx))
(unless *is-windows*
(use-package jinx
:hook (org-mode-hook . jinx-mode)
:bind ([remap ispell-word] . jinx-correct)
:config (setq jinx-languages "en_US")
(add-to-list 'jinx-exclude-regexps '(t "\\cc"))
(with-eval-after-load 'jinx
(dolist (range '((#x4E00 . #x9FFF)
(#x3400 . #x4DBF)
(#x3000 . #x303F)
(#xFF00 . #xFFEF)
(#x20000 . #x2A6DF)))
(let ((start (car range))
(end (cdr range)))
(dotimes (i (- end start))
(modify-syntax-entry (+ start i) "_" jinx--syntax-table)))))
(require 'init-jinx)))
;; flycheck
(use-package flycheck