A *TON* of changes
This commit is contained in:
116
init.el
116
init.el
@ -126,6 +126,12 @@
|
||||
;; Make some commands easier to enter multiple times
|
||||
(repeat-mode 1)
|
||||
|
||||
;; Easier buffer navigation
|
||||
(keymap-global-set "C-c <" #'previous-buffer)
|
||||
(keymap-global-set "C-c >" #'next-buffer)
|
||||
(keymap-global-set "C-c k" #'previous-buffer)
|
||||
(keymap-global-set "C-c j" #'next-buffer)
|
||||
|
||||
;; Set fonts
|
||||
(add-to-list 'default-frame-alist '(font . "FiraCode Nerd Font Mono-12"))
|
||||
(add-hook 'server-after-make-frame-hook
|
||||
@ -142,6 +148,12 @@
|
||||
comment-multi-line t
|
||||
comment-empty-lines 'eol)
|
||||
(add-to-list 'auto-mode-alist '("\\.[cC][nN][fF]\\'" . conf-mode))
|
||||
(keymap-set emacs-lisp-mode-map "C-c C-r" #'eval-region)
|
||||
(defun my/-fix-emacs-lisp-mode-system-files ()
|
||||
(when (string-prefix-p lisp-directory buffer-file-name)
|
||||
;; system Emacs files use tab characters and look weird without this.
|
||||
(setq-local tab-width 8)))
|
||||
(add-hook 'emacs-lisp-mode-hook #'my/-fix-emacs-lisp-mode-system-files)
|
||||
|
||||
;; Tree sitter download locations
|
||||
(setq treesit-language-source-alist
|
||||
@ -356,8 +368,22 @@ directory. Otherwise, run `find-file' on that file."
|
||||
|
||||
;; kitty keyboard protocol
|
||||
(use-package kkp
|
||||
:bind ("C-q" . my/quoted-insert)
|
||||
:config
|
||||
(global-kkp-mode 1)
|
||||
(defun my/quoted-insert (arg)
|
||||
"Insert the next character using read-key, not read-char."
|
||||
(interactive "*p")
|
||||
;; Source: https://github.com/benjaminor/kkp/issues/11
|
||||
(let ((char (read-key)))
|
||||
;; Ensure char is treated as a character code for insertion
|
||||
(unless (characterp char)
|
||||
(user-error "%s is not a valid character"
|
||||
(key-description (vector char))))
|
||||
(when (numberp char)
|
||||
(while (> arg 0)
|
||||
(insert-and-inherit char)
|
||||
(setq arg (1- arg))))))
|
||||
(defun my/-kkp-fix-save-some-buffers (oldfun &optional arg pred)
|
||||
"Fix `save-some-buffers' when used in a terminal with kkp enabled."
|
||||
(let ((status (kkp--terminal-has-active-kkp-p)))
|
||||
@ -410,7 +436,11 @@ directory. Otherwise, run `find-file' on that file."
|
||||
(evil-define-key '(normal visual motion) dired-mode-map
|
||||
"u" #'dired-unmark)
|
||||
(evil-define-key '(normal visual motion) profiler-report-mode-map
|
||||
(kbd "TAB") #'profiler-report-toggle-entry))
|
||||
(kbd "TAB") #'profiler-report-toggle-entry)
|
||||
(eldoc-add-command 'evil-insert
|
||||
'evil-append
|
||||
'evil-insert-line
|
||||
'evil-append-line))
|
||||
(use-package evil-collection
|
||||
:after evil
|
||||
:diminish evil-collection-unimpaired-mode
|
||||
@ -454,7 +484,12 @@ directory. Otherwise, run `find-file' on that file."
|
||||
'paredit-open-angled
|
||||
'paredit-open-bracket
|
||||
'paredit-open-angled
|
||||
'paredit-open-parenthesis)
|
||||
'paredit-open-parenthesis
|
||||
'delete-indentation
|
||||
'evil-cp-insert
|
||||
'evil-cp-append
|
||||
'evil-cp-insert-at-beginning-of-form
|
||||
'evil-cp-insert-at-end-of-form)
|
||||
(define-key evil-cleverparens-mode-map (kbd "<normal-state> M-o") nil t)
|
||||
(defun my/-enable-evil-cleverparens ()
|
||||
(if (member major-mode '(lisp-mode emacs-lisp-mode
|
||||
@ -567,6 +602,10 @@ in the region and indents once)."
|
||||
(goto-char end))))
|
||||
(back-to-indentation)
|
||||
(lisp-dedent-adjust-parens)))
|
||||
(eldoc-add-command 'my/lisp-indent-adjust-parens
|
||||
'my/lisp-dedent-adjust-parens
|
||||
'lisp-indent-adjust-parens
|
||||
'lisp-dedent-adjust-parens)
|
||||
(evil-define-key '(normal visual) adjust-parens-mode-map
|
||||
(kbd "<tab>") #'my/lisp-indent-adjust-parens
|
||||
(kbd "<backtab>") #'my/lisp-dedent-adjust-parens))
|
||||
@ -577,7 +616,7 @@ in the region and indents once)."
|
||||
:config
|
||||
(require 'vlf-setup))
|
||||
|
||||
;; allow copy from termainl
|
||||
;; allow copy from terminal
|
||||
(use-package xclip
|
||||
:config
|
||||
(xclip-mode 1))
|
||||
@ -628,6 +667,8 @@ visual states."
|
||||
;; vertico
|
||||
(use-package vertico
|
||||
:bind (:map vertico-map
|
||||
("C-RET" . vertico-exit-input)
|
||||
("C-<return>" . vertico-exit-input)
|
||||
("C-S-k" . kill-line)
|
||||
("C-k" . vertico-previous)
|
||||
("C-j" . vertico-next)
|
||||
@ -647,9 +688,9 @@ visual states."
|
||||
(setq vertico-cycle t
|
||||
enable-recursive-minibuffers t
|
||||
read-extended-command-predicate #'command-completion-default-include-p
|
||||
minibuffer-prompt-properties '(read-only t
|
||||
cursor-intangible t
|
||||
face minibuffer-prompt))
|
||||
minibuffer-prompt-properties '(read-only t ;; noindent 3
|
||||
cursor-intangible t
|
||||
face minibuffer-prompt))
|
||||
(vertico-mode 1)
|
||||
;; for jinx
|
||||
(require 'vertico-multiform)
|
||||
@ -983,8 +1024,12 @@ With PROJECT, give diagnostics for all buffers in the current project."
|
||||
(use-package eglot
|
||||
:demand t
|
||||
:pin gnu ;; try to force Elpa version to fix warnings
|
||||
:hook (eglot-managed-mode . my/-eglot-setup)
|
||||
:hook ((eglot-managed-mode . my/-eglot-setup)
|
||||
(text-mode . my/eglot-in-text-mode-only))
|
||||
:init
|
||||
(defun my/eglot-in-text-mode-only ()
|
||||
(when (eq major-mode 'text-mode)
|
||||
(eglot-ensure)))
|
||||
(defvar my/-eglot-documentation-buffer nil
|
||||
"Buffer for showing documentation for `my/eglot-documentation-at-point'.")
|
||||
(defun my/eglot-documentation-at-point ()
|
||||
@ -1889,6 +1934,7 @@ If no name is given, list all bookmarks instead."
|
||||
|
||||
;; org-mode
|
||||
(use-package org
|
||||
:pin gnu
|
||||
:bind (("C-c c" . org-capture)
|
||||
("C-c a" . org-agenda)
|
||||
("C-c l" . org-store-link)
|
||||
@ -1896,6 +1942,11 @@ If no name is given, list all bookmarks instead."
|
||||
("C-c t" . org-table-create))
|
||||
:hook (org-mode . org-table-header-line-mode)
|
||||
:init
|
||||
(font-lock-add-keywords 'org-mode
|
||||
`((,(rx bol (* " ") (group "-") " ")
|
||||
(0 (prog1 nil
|
||||
(compose-region (match-beginning 1)
|
||||
(match-end 1) "•"))))))
|
||||
(setq org-directory "~/org"
|
||||
org-agenda-files '("~/org/")
|
||||
org-log-into-drawer t
|
||||
@ -1903,13 +1954,27 @@ If no name is given, list all bookmarks instead."
|
||||
org-log-redeadline 'time
|
||||
org-log-reschedule 'time
|
||||
org-preview-latex-default-process 'dvisvgm
|
||||
org-highlight-latex-and-related '(native entities)
|
||||
org-startup-with-inline-images t
|
||||
org-adapt-indentation t
|
||||
org-hide-leading-stars t
|
||||
org-html-with-latex 'dvisvgm
|
||||
org-preview-latex-process-alist
|
||||
'((dvisvgm
|
||||
:image-input-type "dvi"
|
||||
:image-output-type "svg"
|
||||
:image-size-adjust (1.7 . 1.5)
|
||||
:latex-compiler ("pdflatex -interaction nonstopmode -output-format=dvi -output-directory=%o %f")
|
||||
:image-converter ("dvisvgm %o%b.dvi --no-fonts --exact-bbox --scale=%S --output=%O")))))
|
||||
:image-converter ("dvisvgm %o%b.dvi --no-fonts --exact-bbox --scale=%S --output=%O"))))
|
||||
(defun my/-org-allow-in-derived-mode (oldfun &rest r)
|
||||
"Allow OLDFUN to run, even if `major-mode' is only derived from `org-mode'.
|
||||
R is rest of the arguments to OLDFUN."
|
||||
(let ((major-mode (if (derived-mode-p 'org-mode)
|
||||
'org-mode
|
||||
major-mode)))
|
||||
(apply oldfun r)))
|
||||
(advice-add 'org-element-at-point :around 'my/-org-allow-in-derived-mode)
|
||||
(advice-add 'org-table-header-line-mode :around 'my/-org-allow-in-derived-mode))
|
||||
(use-package evil-org
|
||||
:after org
|
||||
:hook (org-mode . evil-org-mode)
|
||||
@ -1947,7 +2012,6 @@ The name is compared with the field name using TESTFN (defaults to `equal')."
|
||||
(mu4e-view-mode . my/-mu4e-setup-view-mode)
|
||||
(mu4e-compose-mode . my/-mu4e-setup-compose-mode))
|
||||
:bind (("C-x C-m" . mu4e)
|
||||
("C-x m" . mu4e-compose-new)
|
||||
:map message-mode-map
|
||||
("C-c k" . khard-insert-email-contact)
|
||||
:map mu4e-headers-mode-map
|
||||
@ -2004,8 +2068,8 @@ The name is compared with the field name using TESTFN (defaults to `equal')."
|
||||
(concat "flag:unread AND NOT flag:trashed AND NOT "
|
||||
"maildir:/protonmail/Trash AND NOT maildir:/protonmail/Spam")
|
||||
"Flag for mail which will appear as \"unread\" and will be notified.")
|
||||
(setq mail-user-agent 'mu4e-user-agent
|
||||
message-kill-buffer-on-exit t
|
||||
(setq message-kill-buffer-on-exit t
|
||||
message-confirm-send t
|
||||
message-send-mail-function 'sendmail-send-it
|
||||
mu4e-change-filenames-when-moving t
|
||||
mu4e-context-policy 'pick-first
|
||||
@ -2048,13 +2112,26 @@ The name is compared with the field name using TESTFN (defaults to `equal')."
|
||||
(mu4e t)
|
||||
(mu4e-context-switch nil "Personal")
|
||||
|
||||
;; org-msg
|
||||
(use-package org-msg
|
||||
:init
|
||||
(setq org-msg-default-alternatives '((new . (text html))
|
||||
(reply-to-html . (text html))
|
||||
(reply-to-text . (text)))
|
||||
org-msg-convert-citation t))
|
||||
;; mu4e compose HTML messages
|
||||
(use-package org-mime)
|
||||
(require 'org-mu4e-compose)
|
||||
(setq mail-user-agent 'org-mu4e-user-agent
|
||||
org-mime-org-html-with-latex-default 'dvisvgm
|
||||
org-mime-export-options '(:with-latex dvisvgm :with-footnotes t))
|
||||
(evil-define-key '(normal visual) org-mu4e-compose-mode-map
|
||||
"G" #'mu4e-compose-goto-bottom
|
||||
"gg" #'mu4e-compose-goto-top)
|
||||
(evil-define-key 'normal org-mu4e-compose-mode-map
|
||||
"ZZ" #'message-send-and-exit
|
||||
"ZD" #'message-dont-send
|
||||
"ZQ" #'message-kill-buffer
|
||||
"ZF" #'mml-attach-file)
|
||||
(defun my/-setup-org-mu4e-compose-mode ()
|
||||
"Setup up stuff in `org-mu4e-compose' buffers."
|
||||
(setq-local ltex-eglot-variable-save-method 'file)
|
||||
;; this should come last so it can pick up the above
|
||||
(eglot-ensure))
|
||||
(add-hook 'org-mu4e-compose-mode-hook #'my/-setup-org-mu4e-compose-mode)
|
||||
|
||||
;; elfeed
|
||||
(use-package elfeed
|
||||
@ -2089,7 +2166,8 @@ The name is compared with the field name using TESTFN (defaults to `equal')."
|
||||
(defun my/-helpful-setup-emacs-lisp-mode ()
|
||||
(setq-local evil-lookup-func #'helpful-at-point))
|
||||
(defun my/-setup-helpful-mode ()
|
||||
(setq-local evil-lookup-func #'helpful-at-point))
|
||||
(setq-local evil-lookup-func #'helpful-at-point
|
||||
tab-width 8))
|
||||
(defvar my/helpful-symbol-history-size 50
|
||||
"Max size of `my/helpful-symbol-history'.")
|
||||
(defvar my/helpful-symbol-history '()
|
||||
|
Reference in New Issue
Block a user