This commit is contained in:
Zelong Kuang
2025-12-22 12:30:25 +11:00
parent 16e012f80d
commit b062f75562
4 changed files with 48 additions and 12 deletions

View File

@@ -36,7 +36,8 @@
(use-package subword
:ensure nil
:hook (elpaca-after-init . global-subword-mode))
:diminish
:hook (prog-mode minibuffer-setup))
(use-package paren
:ensure nil
@@ -92,5 +93,33 @@
(setq scroll-conservatively 3
scroll-margin 0)
:hook (elpaca-after-init . ultra-scroll-mode))
(use-package helpful
:bind (([remap describe-function] . helpful-callable)
([remap describe-command] . helpful-command)
([remap describe-variable] . helpful-variable)
([remap describe-key] . helpful-key)
([remap describe-symbol] . helpful-symbol)
:map emacs-lisp-mode-map
("C-c C-d" . helpful-at-point)
:map lisp-interaction-mode-map
("C-c C-d" . helpful-at-point)
:map helpful-mode-map
("r" . remove-hook-at-point))
:hook (helpful-mode . cursor-sensor-mode) ; for remove-advice button
:init
(with-no-warnings
(with-eval-after-load 'apropos
;; patch apropos buttons to call helpful instead of help
(dolist (fun-bt '(apropos-function apropos-macro apropos-command))
(button-type-put
fun-bt 'action
(lambda (button)
(helpful-callable (button-get button 'apropos-symbol)))))
(dolist (var-bt '(apropos-variable apropos-user-option))
(button-type-put
var-bt 'action
(lambda (button)
(helpful-variable (button-get button 'apropos-symbol))))))))
(provide 'init-better-default)

View File

@@ -54,7 +54,7 @@
:map mc/keymap
("C-|" . mc/vertical-align-with-space))
:pretty-hydra
((:color amaranth :quit-key ("q" "C-g"))
((:color amaranth :quit-key ("q" "C-g") :hint nil)
("Up"
(("p" mc/mark-previous-like-this "prev")
("P" mc/skip-to-previous-like-this "skip")
@@ -76,4 +76,8 @@
(use-package smart-region
:hook (after-init . smart-region-on))
(use-package mwim
:bind (([remap move-beginning-of-line] . mwim-beginning)
([remap move-end-of-line] . mwim-end)))
(provide 'init-edit)

View File

@@ -9,9 +9,9 @@
:defer
:ensure `(org :repo "https://code.tecosaur.net/tec/org-mode.git/"
:branch "dev")
:hook (org-mode . org-indent-mode)
:hook (org-mode . org-cdlatex-mode)
:hook (org-mode . org-indent-mode)
:pretty-hydra
;; See `org-structure-template-alist'
((:color blue :quit-key ("q" "C-g"))
@@ -21,10 +21,9 @@
("C" (hot-expand "<C") "comment")
("x" (hot-expand "<e") "example")
("E" (hot-expand "<E") "export")
("h" (hot-expand "<h") "html")
("l" (hot-expand "<l") "latex")
("n" (hot-expand "<n") "note")
("o" (hot-expand "<q") "quote")
("O" (hot-expand "<q") "quote")
("v" (hot-expand "<v") "verse"))
"Head"
(("i" (hot-expand "<i") "index")
@@ -40,6 +39,8 @@
("w" (hot-expand "<s" "powershell") "powershell")
("r" (hot-expand "<s" "ruby") "ruby")
("S" (hot-expand "<s" "sh") "sh")
("h" (hot-expand "<s" "haskell") "haskell")
("o" (hot-expand "<s" "ocaml") "ocaml")
("g" (hot-expand "<s" "go :imports '\(\"fmt\"\)") "golang"))
"Misc"
(("m" (hot-expand "<s" "mermaid :file chart.png") "mermaid")
@@ -62,9 +63,9 @@
"Expand org template.
STR is a structure template string recognised by org like <s. MOD is a
string with additional parameters to add the begin line of the
structure element. HEADER string includes more parameters that are
prepended to the element after the #+HEADER: tag."
string with additional parameters to add the begin line of the structure
element. HEADER string includes more parameters that are prepended to
the element after the #+HEADER: tag."
(let (text)
(when (region-active-p)
(setq text (buffer-substring (region-beginning) (region-end)))
@@ -85,8 +86,9 @@ prepended to the element after the #+HEADER: tag."
(setq org-directory "~/org/")
(add-to-list 'org-agenda-files "~/org")
(setq org-highlight-latex-and-related '(native latex entities))
(setq org-pretty-entities t)
(setq org-pretty-entities-include-sub-superscripts nil)
(setq org-startup-indented t)
(setq org-pretty-entities t
org-pretty-entities-include-sub-superscripts nil)
(add-to-list 'org-src-block-faces '("latex" (:inherit default :extend t)))