mirror of
https://codeberg.org/scip/dot-emacs.git
synced 2026-11-22 22:28:59 +01:00
Compare commits
9 Commits
a0cd8e81bf
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 89c68dd197 | |||
| 9796948202 | |||
| 86c3b994de | |||
| 4ccc82f632 | |||
| 2912d3842a | |||
| 30fd644ad4 | |||
| 72c6f3f145 | |||
| 43fcb0d790 | |||
| e1277ecb89 |
4
init.el
4
init.el
@@ -139,6 +139,7 @@
|
|||||||
(require 'init-typst)
|
(require 'init-typst)
|
||||||
(require 'init-editorconfig)
|
(require 'init-editorconfig)
|
||||||
(require 'init-flymake)
|
(require 'init-flymake)
|
||||||
|
(require 'init-latex)
|
||||||
|
|
||||||
;; interactive modes
|
;; interactive modes
|
||||||
(require 'init-eshell)
|
(require 'init-eshell)
|
||||||
@@ -156,6 +157,7 @@
|
|||||||
(require 'init-magit)
|
(require 'init-magit)
|
||||||
(require 'init-dired)
|
(require 'init-dired)
|
||||||
(require 'init-ediff)
|
(require 'init-ediff)
|
||||||
|
(require 'init-smerge)
|
||||||
(require 'init-projectile)
|
(require 'init-projectile)
|
||||||
(require 'init-occur)
|
(require 'init-occur)
|
||||||
;; (require 'init-audio) nope, I'm just not using it anymore
|
;; (require 'init-audio) nope, I'm just not using it anymore
|
||||||
@@ -171,6 +173,8 @@
|
|||||||
(require 'init-ibuffer)
|
(require 'init-ibuffer)
|
||||||
(require 'init-printing)
|
(require 'init-printing)
|
||||||
(require 'init-smarter-than-emacs)
|
(require 'init-smarter-than-emacs)
|
||||||
|
(require 'init-dabbrev)
|
||||||
|
(require 'init-highlight)
|
||||||
(require 'init-marginalia)
|
(require 'init-marginalia)
|
||||||
(require 'init-avy)
|
(require 'init-avy)
|
||||||
(require 'init-ui)
|
(require 'init-ui)
|
||||||
|
|||||||
8
lisp/init-dabbrev.el
Normal file
8
lisp/init-dabbrev.el
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
;; -*- lexical-binding: nil; -*-
|
||||||
|
|
||||||
|
|
||||||
|
(use-package dabbrev
|
||||||
|
:commands dabbrev-capf)
|
||||||
|
|
||||||
|
|
||||||
|
(provide 'init-dabbrev)
|
||||||
14
lisp/init-highlight.el
Normal file
14
lisp/init-highlight.el
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
;; -*- lexical-binding: nil; -*-
|
||||||
|
|
||||||
|
|
||||||
|
(use-package hi-lock
|
||||||
|
:ensure nil
|
||||||
|
|
||||||
|
:config
|
||||||
|
;; This disables the hi-lock-mode keymap, which conflicts with our
|
||||||
|
;; window hydra (C-x w) and we don't need hi-lock keys anyway )
|
||||||
|
(eval-after-load 'hi-lock '(progn
|
||||||
|
(define-key hi-lock-map (kbd "C-x w") 'hydra-windows/body))))
|
||||||
|
|
||||||
|
|
||||||
|
(provide 'init-highlight)
|
||||||
34
lisp/init-latex.el
Normal file
34
lisp/init-latex.el
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
;; -*- lexical-binding: nil; -*-
|
||||||
|
|
||||||
|
(setopt text-mode-ispell-word-completion nil)
|
||||||
|
|
||||||
|
(defface punctuation-error-face
|
||||||
|
'((t (:foreground "Red")))
|
||||||
|
"red"
|
||||||
|
:group 'latex)
|
||||||
|
|
||||||
|
(defun tvd-latex-punctuation()
|
||||||
|
"Highlight german speech punctuation errors. See https://korrektur.de/woertliche-rede-zeichensetzung.
|
||||||
|
|
||||||
|
The following errors are highlighted:
|
||||||
|
- a dot following closing quotes, as: ``done''.
|
||||||
|
- a dot before the closing quote if followed by a comma, as: ``boo.'', sagte er.
|
||||||
|
- an uppercase word following an opening quote after a comma, as: ... said, ``Doch.''"
|
||||||
|
(interactive)
|
||||||
|
(highlight-regexp "''\\." 'punctuation-error-face)
|
||||||
|
(highlight-regexp "\\.''," 'punctuation-error-face)
|
||||||
|
(highlight-regexp ", ``[A-Z]" 'punctuation-error-face))
|
||||||
|
|
||||||
|
(use-package latex
|
||||||
|
:ensure nil
|
||||||
|
|
||||||
|
:mode
|
||||||
|
("\\.tex\\'" . latex-mode))
|
||||||
|
|
||||||
|
(add-hook 'latex-mode-hook
|
||||||
|
(lambda ()
|
||||||
|
(add-hook 'completion-at-point-functions #'dabbrev-capf 20 t)
|
||||||
|
(tvd-latex-punctuation)))
|
||||||
|
|
||||||
|
|
||||||
|
(provide 'init-latex)
|
||||||
@@ -111,6 +111,9 @@ Reach this hydra with <C-x B>, magit-blame mode must be active
|
|||||||
;; FIXME: still needed?
|
;; FIXME: still needed?
|
||||||
(add-hook 'after-init-hook 'tvd-ignore-magit-warnings-if-any t)
|
(add-hook 'after-init-hook 'tvd-ignore-magit-warnings-if-any t)
|
||||||
|
|
||||||
|
;; long lines are practically invisible in diffs, so wrap them
|
||||||
|
(add-hook 'magit-diff-mode-hook #'visual-line-mode)
|
||||||
|
|
||||||
;; now, THIS is the pure genius me: hit "ls in magit-status buffer
|
;; now, THIS is the pure genius me: hit "ls in magit-status buffer
|
||||||
;; and end up in a dired buffer of current repository. The default
|
;; and end up in a dired buffer of current repository. The default
|
||||||
;; binding for this is C-M-i, which is not memorizable, while "ls"
|
;; binding for this is C-M-i, which is not memorizable, while "ls"
|
||||||
|
|||||||
@@ -131,68 +131,68 @@ a remote file anytime and from everywhere I am by just entering :"
|
|||||||
completion-ignore-case t))
|
completion-ignore-case t))
|
||||||
|
|
||||||
|
|
||||||
(use-package embark
|
;; (use-package embark
|
||||||
:ensure t
|
;; :ensure t
|
||||||
|
|
||||||
:bind
|
;; :bind
|
||||||
(("C-." . embark-act) ;; pick some comfortable binding
|
;; (("C-." . embark-act) ;; pick some comfortable binding
|
||||||
("C-," . embark-dwim)) ;; good alternative: M-.
|
;; ("C-," . embark-dwim)) ;; good alternative: M-.
|
||||||
|
|
||||||
|
|
||||||
:init
|
;; :init
|
||||||
;; Optionally replace the key help with a completing-read interface
|
;; ;; Optionally replace the key help with a completing-read interface
|
||||||
(setq prefix-help-command #'embark-prefix-help-command)
|
;; (setq prefix-help-command #'embark-prefix-help-command)
|
||||||
|
|
||||||
;; Show the Embark target at point via Eldoc. You may adjust the Eldoc
|
;; ;; Show the Embark target at point via Eldoc. You may adjust the Eldoc
|
||||||
;; strategy, if you want to see the documentation from multiple providers.
|
;; ;; strategy, if you want to see the documentation from multiple providers.
|
||||||
(add-hook 'eldoc-documentation-functions #'embark-eldoc-first-target)
|
;; (add-hook 'eldoc-documentation-functions #'embark-eldoc-first-target)
|
||||||
;; (setq eldoc-documentation-strategy #'eldoc-documentation-compose-eagerly)
|
;; ;; (setq eldoc-documentation-strategy #'eldoc-documentation-compose-eagerly)
|
||||||
|
|
||||||
:config
|
;; :config
|
||||||
;; Hide the mode line of the Embark live/completions buffers
|
;; ;; Hide the mode line of the Embark live/completions buffers
|
||||||
(add-to-list 'display-buffer-alist
|
;; (add-to-list 'display-buffer-alist
|
||||||
'("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*"
|
;; '("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*"
|
||||||
nil
|
;; nil
|
||||||
(window-parameters (mode-line-format . none))))
|
;; (window-parameters (mode-line-format . none))))
|
||||||
|
|
||||||
|
|
||||||
(defun embark-which-key-indicator ()
|
;; (defun embark-which-key-indicator ()
|
||||||
"An embark indicator that displays keymaps using which-key.
|
;; "An embark indicator that displays keymaps using which-key.
|
||||||
The which-key help message will show the type and value of the
|
;; The which-key help message will show the type and value of the
|
||||||
current target followed by an ellipsis if there are further
|
;; current target followed by an ellipsis if there are further
|
||||||
targets."
|
;; targets."
|
||||||
(lambda (&optional keymap targets prefix)
|
;; (lambda (&optional keymap targets prefix)
|
||||||
(if (null keymap)
|
;; (if (null keymap)
|
||||||
(which-key--hide-popup-ignore-command)
|
;; (which-key--hide-popup-ignore-command)
|
||||||
(which-key--show-keymap
|
;; (which-key--show-keymap
|
||||||
(if (eq (plist-get (car targets) :type) 'embark-become)
|
;; (if (eq (plist-get (car targets) :type) 'embark-become)
|
||||||
"Become"
|
;; "Become"
|
||||||
(format "Act on %s '%s'%s"
|
;; (format "Act on %s '%s'%s"
|
||||||
(plist-get (car targets) :type)
|
;; (plist-get (car targets) :type)
|
||||||
(embark--truncate-target (plist-get (car targets) :target))
|
;; (embark--truncate-target (plist-get (car targets) :target))
|
||||||
(if (cdr targets) "…" "")))
|
;; (if (cdr targets) "…" "")))
|
||||||
(if prefix
|
;; (if prefix
|
||||||
(pcase (lookup-key keymap prefix 'accept-default)
|
;; (pcase (lookup-key keymap prefix 'accept-default)
|
||||||
((and (pred keymapp) km) km)
|
;; ((and (pred keymapp) km) km)
|
||||||
(_ (key-binding prefix 'accept-default)))
|
;; (_ (key-binding prefix 'accept-default)))
|
||||||
keymap)
|
;; keymap)
|
||||||
nil nil t (lambda (binding)
|
;; nil nil t (lambda (binding)
|
||||||
(not (string-suffix-p "-argument" (cdr binding))))))))
|
;; (not (string-suffix-p "-argument" (cdr binding))))))))
|
||||||
|
|
||||||
(setq embark-indicators
|
;; (setq embark-indicators
|
||||||
'(embark-which-key-indicator
|
;; '(embark-which-key-indicator
|
||||||
embark-highlight-indicator
|
;; embark-highlight-indicator
|
||||||
embark-isearch-highlight-indicator))
|
;; embark-isearch-highlight-indicator))
|
||||||
|
|
||||||
(defun embark-hide-which-key-indicator (fn &rest args)
|
;; (defun embark-hide-which-key-indicator (fn &rest args)
|
||||||
"Hide the which-key indicator immediately when using the completing-read prompter."
|
;; "Hide the which-key indicator immediately when using the completing-read prompter."
|
||||||
(which-key--hide-popup-ignore-command)
|
;; (which-key--hide-popup-ignore-command)
|
||||||
(let ((embark-indicators
|
;; (let ((embark-indicators
|
||||||
(remq #'embark-which-key-indicator embark-indicators)))
|
;; (remq #'embark-which-key-indicator embark-indicators)))
|
||||||
(apply fn args)))
|
;; (apply fn args)))
|
||||||
|
|
||||||
(advice-add #'embark-completing-read-prompter
|
;; (advice-add #'embark-completing-read-prompter
|
||||||
:around #'embark-hide-which-key-indicator))
|
;; :around #'embark-hide-which-key-indicator))
|
||||||
|
|
||||||
(use-package consult
|
(use-package consult
|
||||||
;; Replace bindings. Lazily loaded due by `use-package'.
|
;; Replace bindings. Lazily loaded due by `use-package'.
|
||||||
@@ -272,7 +272,13 @@ targets."
|
|||||||
;; clever and nice looking and feeling completion package, candidates
|
;; clever and nice looking and feeling completion package, candidates
|
||||||
;; show up in a mini popup, very nice
|
;; show up in a mini popup, very nice
|
||||||
(use-package corfu
|
(use-package corfu
|
||||||
:hook ((prog-mode . corfu-mode))
|
:init
|
||||||
|
(global-corfu-mode)
|
||||||
|
|
||||||
|
;; :hook ((prog-mode . corfu-mode)
|
||||||
|
;; (plain-tex-mode . corfu-mode)
|
||||||
|
;; (tex-mode . corfu-mode)
|
||||||
|
;; (latex-mode . corfu-mode))
|
||||||
|
|
||||||
:custom
|
:custom
|
||||||
(corfu-quit-no-match t)
|
(corfu-quit-no-match t)
|
||||||
@@ -285,7 +291,7 @@ targets."
|
|||||||
("TAB" . corfu-next)
|
("TAB" . corfu-next)
|
||||||
([tab] . corfu-next)
|
([tab] . corfu-next)
|
||||||
("S-TAB" . corfu-previous)
|
("S-TAB" . corfu-previous)
|
||||||
([backtab] . corfu-previous)))
|
([backtab] . corfu-next)))
|
||||||
|
|
||||||
|
|
||||||
;; much better experience to seach current buffer, consult-line would
|
;; much better experience to seach current buffer, consult-line would
|
||||||
|
|||||||
@@ -12,8 +12,8 @@
|
|||||||
"
|
"
|
||||||
^Smerge Mode^
|
^Smerge Mode^
|
||||||
^^--------------------------------------------------------------
|
^^--------------------------------------------------------------
|
||||||
_n_: next conflict _u_: keep upper _s_: swap
|
_n_: next conflict _t_: keep theirs _s_: swap
|
||||||
_p_: prev conflict _l_: keep lower _h_: highlight
|
_p_: prev conflict _o_: keep ours _h_: highlight
|
||||||
_e_: Ediff _b_: keep base _r_: resolve
|
_e_: Ediff _b_: keep base _r_: resolve
|
||||||
_q_: quit _RET_: keep hunk@point _R_: revert
|
_q_: quit _RET_: keep hunk@point _R_: revert
|
||||||
|
|
||||||
@@ -23,18 +23,18 @@ Reach this hydra with <C-x m>
|
|||||||
|
|
||||||
"
|
"
|
||||||
|
|
||||||
("n" smerge-next nil)
|
("n" smerge-next nil)
|
||||||
("p" smerge-prev nil)
|
("p" smerge-prev nil)
|
||||||
("u" smerge-keep-upper nil)
|
("t" smerge-keep-upper nil)
|
||||||
("l" smerge-keep-lower nil)
|
("o" smerge-keep-lower nil)
|
||||||
("b" smerge-keep-base nil)
|
("b" smerge-keep-base nil)
|
||||||
("RET" smerge-keep-current nil)
|
("RET" smerge-keep-current nil)
|
||||||
("h" smerge-refine nil)
|
("h" smerge-refine nil)
|
||||||
("s" smerge-swap nil)
|
("s" smerge-swap nil)
|
||||||
("r" smerge-resolve nil)
|
("r" smerge-resolve nil)
|
||||||
("R" undo-tree-undo nil)
|
("R" undo-tree-undo nil)
|
||||||
("e" smerge-ediff nil :color blue)
|
("e" smerge-ediff nil :color blue)
|
||||||
("q" nil nil :color blue))
|
("q" nil nil :color blue))
|
||||||
|
|
||||||
(global-set-key (kbd "C-x m") 'hydra-smerge/body)
|
(global-set-key (kbd "C-x m") 'hydra-smerge/body)
|
||||||
(defalias 'merge 'hydra-smerge/body))
|
(defalias 'merge 'hydra-smerge/body))
|
||||||
|
|||||||
@@ -176,12 +176,28 @@ _a_ || _d_ |---| _w_ --- _s_ ="
|
|||||||
("s" enlarge-window nil)
|
("s" enlarge-window nil)
|
||||||
("q" nil nil :color red))
|
("q" nil nil :color red))
|
||||||
|
|
||||||
|
;; (set-window-margins nil novel--cur-margin novel--cur-margin)
|
||||||
|
(setq current-window-margin 0)
|
||||||
|
(setq current-window-margin-step 10)
|
||||||
|
|
||||||
|
(defun tvd-window-margin-add()
|
||||||
|
(interactive)
|
||||||
|
(setq current-window-margin (+ current-window-margin current-window-margin-step))
|
||||||
|
(set-window-margins nil current-window-margin current-window-margin))
|
||||||
|
|
||||||
|
(defun tvd-window-margin-sub()
|
||||||
|
(interactive)
|
||||||
|
(setq current-window-margin (- current-window-margin current-window-margin-step))
|
||||||
|
(if (< current-window-margin 0)
|
||||||
|
(setq current-window-margin 0))
|
||||||
|
(set-window-margins nil current-window-margin current-window-margin))
|
||||||
|
|
||||||
(defhydra hydra-windows (:color blue)
|
(defhydra hydra-windows (:color blue)
|
||||||
"
|
"
|
||||||
|
|
||||||
^Window Management^
|
^Window Management^
|
||||||
^^------------------------------------------------------------------------
|
^^------------------------------------------------------------------------
|
||||||
_+_ Increase Font | _-_ Decrease Font Resize ^ ^ _w_ ^ ^
|
_+_: Increase Font | _-_: Decrease Font Resize ^ ^ _w_ ^ ^
|
||||||
_f_: Flip Windows <M-O> ^^ Current _a_ ^ ^ _d_
|
_f_: Flip Windows <M-O> ^^ Current _a_ ^ ^ _d_
|
||||||
_4_: Quarter Windows <C-x 4> ^^ Window: ^ ^ _s_ ^ ^
|
_4_: Quarter Windows <C-x 4> ^^ Window: ^ ^ _s_ ^ ^
|
||||||
_u_: Windows Undo <C-c left>
|
_u_: Windows Undo <C-c left>
|
||||||
@@ -189,7 +205,7 @@ _r_: Windows Redo <C-c right> ^^ _l_: Adjust Background brighter
|
|||||||
_i_: Invert Colors <C-c C-i> ^^ _b_: Adjust Background darker
|
_i_: Invert Colors <C-c C-i> ^^ _b_: Adjust Background darker
|
||||||
|
|
||||||
_h_: Toggle Highlight Line Mode ^^ _e_: Eyebrowse Workspaces (C-x C-x)
|
_h_: Toggle Highlight Line Mode ^^ _e_: Eyebrowse Workspaces (C-x C-x)
|
||||||
_n_: Toogle Line Number Mode
|
_n_: Toogle Line Number Mode ^^ _m_: increase | _M_: decrease margin
|
||||||
|
|
||||||
^^------------------------------------------------------------------------
|
^^------------------------------------------------------------------------
|
||||||
Reach this hydra with <C-x w>
|
Reach this hydra with <C-x w>
|
||||||
@@ -212,6 +228,8 @@ Reach this hydra with <C-x w>
|
|||||||
("e" hydra-eyebrowse/body nil)
|
("e" hydra-eyebrowse/body nil)
|
||||||
("h" hl-line-mode nil)
|
("h" hl-line-mode nil)
|
||||||
("n" linum-mode nil)
|
("n" linum-mode nil)
|
||||||
|
("m" tvd-window-margin-add nil :color pink)
|
||||||
|
("M" tvd-window-margin-sub nil :color pink)
|
||||||
("q" nil nil :color red))
|
("q" nil nil :color red))
|
||||||
|
|
||||||
(global-set-key (kbd "C-x w") 'hydra-windows/body))
|
(global-set-key (kbd "C-x w") 'hydra-windows/body))
|
||||||
|
|||||||
Reference in New Issue
Block a user