some minor emacs upgrades

This commit is contained in:
Valentin Boettcher 2022-09-24 13:16:39 +02:00
parent fe2165fa77
commit f1180a29f1
No known key found for this signature in database
GPG key ID: E034E12B7AF56ACE
3 changed files with 88 additions and 56 deletions

View file

@ -138,6 +138,9 @@ Install diminish:
:load-path "~/.emacs.d/boon/" :load-path "~/.emacs.d/boon/"
:config :config
(require 'boon-workman) (require 'boon-workman)
(add-to-list 'boon-special-mode-list 'ement-room-mode)
(add-to-list 'boon-special-mode-list 'ement-room-list-mode)
(add-to-list 'boon-special-mode-list 'sly-db-mode) (add-to-list 'boon-special-mode-list 'sly-db-mode)
(add-to-list 'boon-special-mode-list 'sly-inspector-mode) (add-to-list 'boon-special-mode-list 'sly-inspector-mode)
(add-to-list 'boon-special-mode-list 'cider-inspector-mode) (add-to-list 'boon-special-mode-list 'cider-inspector-mode)
@ -362,9 +365,9 @@ We use the doom theme.
#+BEGIN_SRC emacs-lisp :tangle yes #+BEGIN_SRC emacs-lisp :tangle yes
(add-to-list 'default-frame-alist (add-to-list 'default-frame-alist
'(font . "JetBrains Mono-12:weight=light:antialias=subpixel")) '(font . "JetBrains Mono-10:weight=light:antialias=subpixel"))
(set-face-attribute 'mode-line nil :font "JetBrains Mono-12:weight=light:antialias=subpixel") (set-face-attribute 'mode-line nil :font "JetBrains Mono-10:weight=light:antialias=subpixel")
(add-to-list 'default-frame-alist (add-to-list 'default-frame-alist
'(internal-border-width . 0)) '(internal-border-width . 0))
@ -407,6 +410,14 @@ And scroll the compilation output.
(setq compilation-scroll-output t) (setq compilation-scroll-output t)
#+end_src #+end_src
*** Open PDFs with Zathura
#+begin_src emacs-lisp :tangle yes
(use-package openwith
:config
(openwith-mode t)
(setq openwith-associations '(("\\.pdf\\'" "zathura" (file)))))
#+end_src
** Interface ** Interface
*** General Tweaks *** General Tweaks
:PROPERTIES: :PROPERTIES:
@ -505,8 +516,6 @@ Swiper and rg alternative.
("M-s u" . consult-focus-lines) ("M-s u" . consult-focus-lines)
;; Isearch integration ;; Isearch integration
("M-s e" . consult-isearch-history) ("M-s e" . consult-isearch-history)
:map boon-command-map
("w" . consult-line)
:map isearch-mode-map :map isearch-mode-map
("M-e" . consult-isearch-history) ;; orig. isearch-edit-string ("M-e" . consult-isearch-history) ;; orig. isearch-edit-string
("M-s e" . consult-isearch-history) ;; orig. isearch-edit-string ("M-s e" . consult-isearch-history) ;; orig. isearch-edit-string
@ -614,6 +623,22 @@ Swiper and rg alternative.
:hook :hook
(embark-collect-mode . consult-preview-at-point-mode)) (embark-collect-mode . consult-preview-at-point-mode))
#+end_src #+end_src
*** Nicer Search
#+begin_src emacs-lisp :tangle yes
(use-package ctrlf
:config
(setq ctrlf-default-search-style 'fuzzy-regexp)
(setq ctrlf-alternate-search-style 'literal)
(ctrlf-mode +1)
:bind
(:map boon-command-map
("w" . ctrlf-forward-default)
("W" . ctrlf-backward-default)
("j" . ctrlf-forward-alternate)
("J" . ctrlf-alternate-default)))
#+end_src
*** Multiple Cursors *** Multiple Cursors
:PROPERTIES: :PROPERTIES:
:ID: 14313a37-a3d7-41b9-a2b6-b79c8459c22a :ID: 14313a37-a3d7-41b9-a2b6-b79c8459c22a
@ -814,18 +839,18 @@ Distraction free writing.
*** PDF Tools *** PDF Tools
#+begin_src emacs-lisp :tangle yes #+begin_src emacs-lisp :tangle yes
(use-package pdf-tools ;; (use-package pdf-tools
:config ;; :config
;; Update PDF buffers after successful LaTeX runs ;; ;; Update PDF buffers after successful LaTeX runs
(add-hook 'TeX-after-compilation-finished-functions ;; (add-hook 'TeX-after-compilation-finished-functions
#'TeX-revert-document-buffer) ;; #'TeX-revert-document-buffer)
(pdf-tools-install) ;; (pdf-tools-install)
(add-hook 'pdf-view-mode-hook ;; (add-hook 'pdf-view-mode-hook
'pdf-view-auto-slice-minor-mode) ;; 'pdf-view-auto-slice-minor-mode)
(define-key pdf-view-mode-map (kbd "C-s") 'isearch-forward)) ;; (define-key pdf-view-mode-map (kbd "C-s") 'isearch-forward))
(use-package org-pdftools ;; (use-package org-pdftools
:after pdf-tools) ;; :after pdf-tools)
#+end_src #+end_src
*** Return to Minibuffer *** Return to Minibuffer
Taken from [[https://emacs.stackexchange.com/questions/42287/set-focus-to-minibuffer-window][stackoverlow]]. Returns the focus to the minibuffer. Taken from [[https://emacs.stackexchange.com/questions/42287/set-focus-to-minibuffer-window][stackoverlow]]. Returns the focus to the minibuffer.
@ -1828,15 +1853,7 @@ For a nice mindmap in the browser.
#+BEGIN_SRC emacs-lisp :tangle yes #+BEGIN_SRC emacs-lisp :tangle yes
(use-package magit-filenotify) (use-package magit-filenotify)
#+END_SRC #+END_SRC
**** Time-Machine
:PROPERTIES:
:ID: 96d780be-db71-4e19-b0f4-f41fe103ea71
:END:
View the history of a file.
#+begin_src emacs-lisp :tangle yes
(use-package git-timemachine)
#+end_src
**** Highlight Diffs **** Highlight Diffs
:PROPERTIES: :PROPERTIES:
:ID: ebe9a7aa-3f9a-4ec9-b651-3018472e1f46 :ID: ebe9a7aa-3f9a-4ec9-b651-3018472e1f46
@ -1926,11 +1943,11 @@ Enable electric braces for math mode: ~\( \)~
(setq TeX-PDF-mode t) (setq TeX-PDF-mode t)
(setq TeX-source-correlate-start-server t) (setq TeX-source-correlate-start-server t)
(add-to-list 'TeX-view-program-list (add-to-list 'TeX-view-program-list
'("Zathura" '("Zathura_new111"
("zathura %o" ("zathura %o"
(mode-io-correlate " --synctex-forward %n:0:\"%b\" -x \"emacsclient -a emacs --no-wait +%{line} %{input}\"")) (mode-io-correlate " --synctex-forward %n:0:\"%b\" -x \"emacsclient -a emacs --no-wait +%{line} %{input}\""))
"zathura")) "zathura"))
(setcar (cdr (assoc 'output-pdf TeX-view-program-selection)) "Zathura") (setcar (cdr (assoc 'output-pdf TeX-view-program-selection)) "Zathura_new111")
(flyspell-mode 1)) (flyspell-mode 1))
(add-hook 'LaTeX-mode-hook 'my-auctex-init) (add-hook 'LaTeX-mode-hook 'my-auctex-init)
#+END_SRC #+END_SRC
@ -1946,12 +1963,16 @@ Custom math macros.
:ID: 90b8584a-92fe-4032-b74a-a6c2610728fb :ID: 90b8584a-92fe-4032-b74a-a6c2610728fb
:END: :END:
#+begin_src emacs-lisp :tangle yes #+begin_src emacs-lisp :tangle yes
(setq reftex-plug-into-auctex t) (with-eval-after-load 'reftex
(setq reftex-ref-macro-prompt nil) (setq reftex-plug-into-auctex t)
(setq reftex-label-alist '(AMSTeX)) (setq reftex-ref-macro-prompt nil)
(defun reftex-format-cref (label def-fmt ref-style) (setq reftex-label-alist '(AMSTeX))
(format "\\cref{%s}" label)) (defun reftex-format-cref (label def-fmt ref-style)
(setq reftex-format-ref-function 'reftex-format-cref) (format "\\cref{%s}" label))
(setq reftex-format-ref-function 'reftex-format-cref)
(define-key reftex-mode-map (kbd "M-.") 'reftex-view-crossref)
(setq reftex-extra-bindings t)
(setq reftex-plug-into-AUCTeX t))
#+end_src #+end_src
**** Latexmk **** Latexmk
@ -2765,7 +2786,7 @@ Hooking into aggressive indent.
(use-package julia-formatter (use-package julia-formatter
:straight (julia-formatter :straight (julia-formatter
:type git :type git
:repo "https://codeberg.org/FelipeLema/julia-formatter.el.git" :repo "https://codeberg.org/FelipeLema/julia-formatter.el"
:pre-build ("julia" "--project=." "-e " "\"using Pkg; Pkg.resolve();\"") :pre-build ("julia" "--project=." "-e " "\"using Pkg; Pkg.resolve();\"")
:files ("*.el" "*.toml" "*.jl")) :files ("*.el" "*.toml" "*.jl"))
:hook :hook
@ -2924,6 +2945,17 @@ Stolen from https://yiufung.net/post/anki-org/.
(setq org-cite-follow-processor 'citar) (setq org-cite-follow-processor 'citar)
(setq org-cite-activate-processor 'citar)) (setq org-cite-activate-processor 'citar))
#+end_src #+end_src
*** Ement
A matrix client right inside emacs.
#+begin_src emacs-lisp :tangle yes
(use-package ement
:straight
'(:host github :repo "alphapapa/ement.el" :branch "master")
:config ;(ement-connect :uri-prefix "http://localhost:8009")
:custom
;; (ement-room-message-format-spec "%B%r%R%t")
(ement-save-sessions t))
#+end_src
** Custom Scripts ** Custom Scripts
*** Close all Buffers *** Close all Buffers
:PROPERTIES: :PROPERTIES:

View file

@ -1,18 +1,16 @@
(defvar bootstrap-version) (defvar bootstrap-version)
(let ((bootstrap-file (let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
(bootstrap-version 5)) (bootstrap-version 6))
(unless (file-exists-p bootstrap-file) (unless (file-exists-p bootstrap-file)
(with-current-buffer (with-current-buffer
(url-retrieve-synchronously (url-retrieve-synchronously
"https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el" "https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
'silent 'inhibit-cookies) 'silent 'inhibit-cookies)
(goto-char (point-max)) (goto-char (point-max))
(eval-print-last-sexp))) (eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage)) (load bootstrap-file nil 'nomessage))
(straight-use-package 'org)
(straight-use-package 'use-package) (straight-use-package 'use-package)
(use-package org)
;; (straight-use-package 'org '(org :host github :repo "yantar92/org" :branch "feature/org-fold-universal-core"
;; :files (:defaults "contrib/lisp/*.el")))
(org-babel-load-file "~/.emacs.d/emacs.org") (org-babel-load-file "~/.emacs.d/emacs.org")
(put 'scroll-left 'disabled nil) (put 'scroll-left 'disabled nil)

View file

@ -1,31 +1,33 @@
set synctex-editor-command "emacsclient -a emacs --no-wait +%{line} %{input}" set guioptions none
set adjust-open width
set synctex true set synctex true
set synctex-editor-command "emacsclient -a emacs --no-wait +%{line}:%{column} %{input}"
set adjust-open width
set page-cache-size 200
map \< goto top map \< goto top
map \> goto bottom map \> goto bottom
map f navigate previous map n navigate previous
map y follow map y follow
map Y jumplist backward map f jumplist backward
map \" jumplist forward map ; jumplist forward
map ; navigate next map i navigate next
map U goto top
map P goto bottom
map j zoom in map j zoom in
map k zoom out map k zoom out
map <C-=> zoom in map <C-=> zoom in
map J adjust_window best-fit map J adjust_window best-fit
map K adjust_window width map K adjust_window width
map n scroll full-left map E scroll full-left
map e scroll left map e scroll left
map i scroll full-right map O scroll full-right
map o scroll right map o scroll right
map <C-g> abort map <C-g> abort
map p scroll down map p scroll down
map u scroll up map u scroll up
map P scroll full-down map P scroll full-down
map U scroll full-up map U scroll full-up
map \, search forward
map \. search backward
map l mark_add map l mark_add
map \' mark_evaluate map \' mark_evaluate