Reframed with straight.el
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -66,3 +66,4 @@ history
|
|||||||
/..emacs.d-tabspaces-session.el
|
/..emacs.d-tabspaces-session.el
|
||||||
/easysession
|
/easysession
|
||||||
/tramp-rpc
|
/tramp-rpc
|
||||||
|
/straight/
|
||||||
|
|||||||
@@ -38,8 +38,8 @@
|
|||||||
;; Faster to disable these here (before they've been initialized)
|
;; Faster to disable these here (before they've been initialized)
|
||||||
(push '(menu-bar-lines . 0) default-frame-alist)
|
(push '(menu-bar-lines . 0) default-frame-alist)
|
||||||
(push '(tool-bar-lines . 0) default-frame-alist)
|
(push '(tool-bar-lines . 0) default-frame-alist)
|
||||||
(push '(vertical-scroll-bars) default-frame-alist)
|
(push '(vertical-scroll-bars . nil) default-frame-alist)
|
||||||
(push '(horizontal-scroll-bars) default-frame-alist)
|
(push '(horizontal-scroll-bars . nil) default-frame-alist)
|
||||||
(when (featurep 'ns)
|
(when (featurep 'ns)
|
||||||
(push '(ns-transparent-titlebar . t) default-frame-alist))
|
(push '(ns-transparent-titlebar . t) default-frame-alist))
|
||||||
;; (push '(ns-appearance . light) default-frame-alist))
|
;; (push '(ns-appearance . light) default-frame-alist))
|
||||||
|
|||||||
5
init.el
5
init.el
@@ -2,13 +2,14 @@
|
|||||||
;;; Commentary:
|
;;; Commentary:
|
||||||
;;; blablabla
|
;;; blablabla
|
||||||
|
|
||||||
(require 'init-elpaca)
|
;; (require 'init-elpaca)
|
||||||
|
(require 'init-straight)
|
||||||
(require 'init-gc)
|
(require 'init-gc)
|
||||||
(require 'init-better-default)
|
(require 'init-better-default)
|
||||||
(require 'init-ui)
|
(require 'init-ui)
|
||||||
;; (require 'init-dashboard) ;; not working
|
;; (require 'init-dashboard) ;; not working
|
||||||
|
|
||||||
(require 'init-god)
|
;; (require 'init-god)
|
||||||
;; (require 'init-meow)
|
;; (require 'init-meow)
|
||||||
|
|
||||||
(require 'init-hydra)
|
(require 'init-hydra)
|
||||||
|
|||||||
@@ -1,11 +1,88 @@
|
|||||||
;; -*- lexical-binding: t -*-
|
;; -*- lexical-binding: t -*-
|
||||||
|
|
||||||
|
;; Load some component of large package (org, magit etc.) before complete mount
|
||||||
|
(defvar elemacs-incremental-packages '(t)
|
||||||
|
"A list of packages to load incrementally after startup. Any large packages
|
||||||
|
here may cause noticeable pauses, so it's recommended you break them up into
|
||||||
|
sub-packages. For example, `org' is comprised of many packages, and can be
|
||||||
|
broken up into:
|
||||||
|
|
||||||
|
(elemacs-load-packages-incrementally
|
||||||
|
'(calendar find-func format-spec org-macs org-compat
|
||||||
|
org-faces org-entities org-list org-pcomplete org-src
|
||||||
|
org-footnote org-macro ob org org-clock org-agenda
|
||||||
|
org-capture))
|
||||||
|
|
||||||
|
This is already done by the lang/org module, however.
|
||||||
|
|
||||||
|
If you want to disable incremental loading altogether, either remove
|
||||||
|
`doom-load-packages-incrementally-h' from `emacs-startup-hook' or set
|
||||||
|
`doom-incremental-first-idle-timer' to nil. Incremental loading does not occur
|
||||||
|
in daemon sessions (they are loaded immediately at startup).")
|
||||||
|
|
||||||
|
(defvar elemacs-incremental-first-idle-timer 2.0
|
||||||
|
"How long (in idle seconds) until incremental loading starts.
|
||||||
|
|
||||||
|
Set this to nil to disable incremental loading.")
|
||||||
|
|
||||||
|
(defvar elemacs-incremental-idle-timer 0.75
|
||||||
|
"How long (in idle seconds) in between incrementally loading packages.")
|
||||||
|
|
||||||
|
(defvar elemacs-incremental-load-immediately (daemonp)
|
||||||
|
"If non-nil, load all incrementally deferred packages immediately at startup.")
|
||||||
|
|
||||||
|
(defun elemacs-load-packages-incrementally (packages &optional now)
|
||||||
|
"Registers PACKAGES to be loaded incrementally.
|
||||||
|
|
||||||
|
If NOW is non-nil, load PACKAGES incrementally, in `doom-incremental-idle-timer'
|
||||||
|
intervals."
|
||||||
|
(if (not now)
|
||||||
|
(setq elemacs-incremental-packages (append elemacs-incremental-packages packages ))
|
||||||
|
(while packages
|
||||||
|
(let* ((gc-cons-threshold most-positive-fixnum)
|
||||||
|
(req (pop packages)))
|
||||||
|
(unless (featurep req)
|
||||||
|
(message "Incrementally loading %s" req)
|
||||||
|
(condition-case-unless-debug e
|
||||||
|
(or (while-no-input
|
||||||
|
;; If `default-directory' is a directory that doesn't exist
|
||||||
|
;; or is unreadable, Emacs throws up file-missing errors, so
|
||||||
|
;; we set it to a directory we know exists and is readable.
|
||||||
|
(let ((default-directory user-emacs-directory)
|
||||||
|
(inhibit-message t)
|
||||||
|
file-name-handler-alist)
|
||||||
|
(require req nil t))
|
||||||
|
t)
|
||||||
|
(push req packages))
|
||||||
|
(error
|
||||||
|
(message "Failed to load %S package incrementally, because: %s"
|
||||||
|
req e)))
|
||||||
|
(if (not packages)
|
||||||
|
(message "Finished incremental loading")
|
||||||
|
(run-with-idle-timer elemacs-incremental-idle-timer
|
||||||
|
nil #'elemacs-load-packages-incrementally
|
||||||
|
packages t)
|
||||||
|
(setq packages nil)))))))
|
||||||
|
|
||||||
|
(defun elemacs-load-packages-incrementally-h ()
|
||||||
|
"Begin incrementally loading packages in `elemacs-incremental-packages'.
|
||||||
|
|
||||||
|
If this is a daemon session, load them all immediately instead."
|
||||||
|
(if elemacs-incremental-load-immediately
|
||||||
|
(mapc #'require (cdr elemacs-incremental-packages))
|
||||||
|
(when (numberp elemacs-incremental-first-idle-timer)
|
||||||
|
(run-with-idle-timer elemacs-incremental-first-idle-timer
|
||||||
|
nil #'elemacs-load-packages-incrementally
|
||||||
|
(cdr elemacs-incremental-packages) t))))
|
||||||
|
|
||||||
|
(add-hook 'emacs-startup-hook #'elemacs-load-packages-incrementally-h)
|
||||||
|
|
||||||
|
|
||||||
(use-package benchmark-init
|
(use-package benchmark-init
|
||||||
:ensure t
|
|
||||||
:demand t
|
:demand t
|
||||||
:config
|
:config
|
||||||
;; To disable collection of benchmark data after init is done.
|
;; To disable collection of benchmark data after init is done.
|
||||||
(add-hook 'elpaca-after-init-hook 'benchmark-init/deactivate))
|
(add-hook 'after-init-hook 'benchmark-init/deactivate))
|
||||||
|
|
||||||
(when (memq window-system '(mac ns x))
|
(when (memq window-system '(mac ns x))
|
||||||
(use-package exec-path-from-shell
|
(use-package exec-path-from-shell
|
||||||
@@ -13,11 +90,11 @@
|
|||||||
(exec-path-from-shell-initialize)))
|
(exec-path-from-shell-initialize)))
|
||||||
|
|
||||||
(setq custom-file (expand-file-name "~/.emacs.d/custom.el"))
|
(setq custom-file (expand-file-name "~/.emacs.d/custom.el"))
|
||||||
(add-hook 'elpaca-after-init-hook (lambda () (load custom-file 'no-error 'no-message)))
|
(add-hook 'after-init-hook (lambda () (load custom-file 'no-error 'no-message)))
|
||||||
|
|
||||||
(use-package server
|
(use-package server
|
||||||
:ensure nil
|
:ensure nil
|
||||||
:hook (elpaca-after-init . server-mode))
|
:hook (after-init . server-mode))
|
||||||
|
|
||||||
(use-package display-line-numbers
|
(use-package display-line-numbers
|
||||||
:ensure nil
|
:ensure nil
|
||||||
@@ -35,10 +112,6 @@
|
|||||||
(setq display-line-numbers-type 'relative)
|
(setq display-line-numbers-type 'relative)
|
||||||
)
|
)
|
||||||
|
|
||||||
;; (use-package delete-trailing
|
|
||||||
;; :ensure nil
|
|
||||||
;; :hook (text-mode delete-trailing-whitespace-mode)
|
|
||||||
;; :hook (prog-mode delete-trailing-whitespace-mode))
|
|
||||||
(add-hook 'prog-mode #'delete-trailing-whitespace-mode)
|
(add-hook 'prog-mode #'delete-trailing-whitespace-mode)
|
||||||
(add-hook 'text-mode #'delete-trailing-whitespace-mode)
|
(add-hook 'text-mode #'delete-trailing-whitespace-mode)
|
||||||
|
|
||||||
@@ -49,7 +122,7 @@
|
|||||||
|
|
||||||
(use-package paren
|
(use-package paren
|
||||||
:ensure nil
|
:ensure nil
|
||||||
:hook (elpaca-after-init . show-paren-mode))
|
:hook (after-init . show-paren-mode))
|
||||||
|
|
||||||
;; Show trailing whitespace only in prog-mode and text-mode
|
;; Show trailing whitespace only in prog-mode and text-mode
|
||||||
(add-hook 'prog-mode-hook (lambda () (setq show-trailing-whitespace t)))
|
(add-hook 'prog-mode-hook (lambda () (setq show-trailing-whitespace t)))
|
||||||
@@ -57,7 +130,7 @@
|
|||||||
|
|
||||||
(use-package recentf
|
(use-package recentf
|
||||||
:ensure nil
|
:ensure nil
|
||||||
:hook (elpaca-after-init . recentf-mode)
|
:hook (after-init . recentf-mode)
|
||||||
:custom
|
:custom
|
||||||
(recentf-max-saved-items 500)
|
(recentf-max-saved-items 500)
|
||||||
(recentf-exclude
|
(recentf-exclude
|
||||||
@@ -67,13 +140,14 @@
|
|||||||
"^/tmp/" "^/var/folders/.+$" "^/ssh:" "/persp-confs/"
|
"^/tmp/" "^/var/folders/.+$" "^/ssh:" "/persp-confs/"
|
||||||
(lambda (file) (file-in-directory-p file package-user-dir))))
|
(lambda (file) (file-in-directory-p file package-user-dir))))
|
||||||
:config
|
:config
|
||||||
|
(elemacs-load-packages-incrementally '(easymenu tree-widget timer))
|
||||||
(push (expand-file-name recentf-save-file) recentf-exclude)
|
(push (expand-file-name recentf-save-file) recentf-exclude)
|
||||||
(add-to-list 'recentf-filename-handlers #'abbreviate-file-name)
|
(add-to-list 'recentf-filename-handlers #'abbreviate-file-name)
|
||||||
)
|
)
|
||||||
|
|
||||||
(use-package savehist
|
(use-package savehist
|
||||||
:ensure nil
|
:ensure nil
|
||||||
:hook (elpaca-after-init . savehist-mode)
|
:hook (after-init . savehist-mode)
|
||||||
:init (setq enable-recursive-minibuffers t ; Allow commands in minibuffers
|
:init (setq enable-recursive-minibuffers t ; Allow commands in minibuffers
|
||||||
history-length 1000
|
history-length 1000
|
||||||
savehist-additional-variables '(mark-ring
|
savehist-additional-variables '(mark-ring
|
||||||
@@ -126,7 +200,7 @@
|
|||||||
|
|
||||||
(use-package browse-kill-ring
|
(use-package browse-kill-ring
|
||||||
:bind ("C-c k" . browse-kill-ring)
|
:bind ("C-c k" . browse-kill-ring)
|
||||||
:hook (elpaca-after-init . browse-kill-ring-default-keybindings)
|
:hook (after-init . browse-kill-ring-default-keybindings)
|
||||||
:init (setq browse-kill-ring-separator "────────────────"
|
:init (setq browse-kill-ring-separator "────────────────"
|
||||||
browse-kill-ring-separator-face 'shadow))
|
browse-kill-ring-separator-face 'shadow))
|
||||||
|
|
||||||
@@ -134,7 +208,7 @@
|
|||||||
:init
|
:init
|
||||||
(setq scroll-conservatively 3
|
(setq scroll-conservatively 3
|
||||||
scroll-margin 0)
|
scroll-margin 0)
|
||||||
:hook (elpaca-after-init . ultra-scroll-mode))
|
:hook (after-init . ultra-scroll-mode))
|
||||||
|
|
||||||
(use-package helpful
|
(use-package helpful
|
||||||
:bind (([remap describe-function] . helpful-callable)
|
:bind (([remap describe-function] . helpful-callable)
|
||||||
@@ -166,6 +240,7 @@
|
|||||||
(helpful-variable (button-get button 'apropos-symbol))))))))
|
(helpful-variable (button-get button 'apropos-symbol))))))))
|
||||||
|
|
||||||
(setq-default auto-save-default nil)
|
(setq-default auto-save-default nil)
|
||||||
|
(setq create-lockfiles nil)
|
||||||
;; (setq auto-save-file-name-transforms
|
;; (setq auto-save-file-name-transforms
|
||||||
;; `((".*" ,(concat user-emacs-directory "auto-save/") t)))
|
;; `((".*" ,(concat user-emacs-directory "auto-save/") t)))
|
||||||
|
|
||||||
@@ -174,7 +249,7 @@
|
|||||||
(tramp-hlo-setup))
|
(tramp-hlo-setup))
|
||||||
|
|
||||||
(use-package tramp-rpc
|
(use-package tramp-rpc
|
||||||
:ensure (tramp-rpc :host github :repo "ArthurHeymans/emacs-tramp-rpc")
|
:straight (tramp-rpc :host github :repo "ArthurHeymans/emacs-tramp-rpc")
|
||||||
:config
|
:config
|
||||||
(tramp-rpc-magit-enable)
|
(tramp-rpc-magit-enable)
|
||||||
(tramp-rpc-projectile-enable))
|
(tramp-rpc-projectile-enable))
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
;; -*- lexical-binding: t -*-
|
;; -*- lexical-binding: t -*-
|
||||||
|
|
||||||
(use-package xref
|
(use-package xref
|
||||||
:ensure nil
|
|
||||||
:init
|
:init
|
||||||
;; Use faster search tool
|
;; Use faster search tool
|
||||||
(when (executable-find "rg")
|
(when (executable-find "rg")
|
||||||
@@ -13,11 +12,11 @@
|
|||||||
|
|
||||||
(use-package apheleia
|
(use-package apheleia
|
||||||
:diminish
|
:diminish
|
||||||
:hook (elpaca-after-init . apheleia-global-mode))
|
:hook (after-init . apheleia-global-mode))
|
||||||
|
|
||||||
(use-package editorconfig
|
(use-package editorconfig
|
||||||
:diminish
|
:diminish
|
||||||
:hook elpaca-after-init)
|
:hook after-init)
|
||||||
|
|
||||||
(use-package cask-mode)
|
(use-package cask-mode)
|
||||||
(use-package csv-mode)
|
(use-package csv-mode)
|
||||||
@@ -29,7 +28,7 @@
|
|||||||
(use-package julia-ts-mode)
|
(use-package julia-ts-mode)
|
||||||
(use-package scala-ts-mode)
|
(use-package scala-ts-mode)
|
||||||
(use-package yaml-ts-mode
|
(use-package yaml-ts-mode
|
||||||
:ensure nil
|
|
||||||
:mode ("\\.yaml\\'" . yaml-ts-mode))
|
:mode ("\\.yaml\\'" . yaml-ts-mode))
|
||||||
|
|
||||||
;; Fish shell mode and auto-formatting
|
;; Fish shell mode and auto-formatting
|
||||||
@@ -47,7 +46,7 @@
|
|||||||
(use-package docker-compose-mode)
|
(use-package docker-compose-mode)
|
||||||
|
|
||||||
(use-package treesit-auto
|
(use-package treesit-auto
|
||||||
:hook (elpaca-after-init . global-treesit-auto-mode)
|
:hook (after-init . global-treesit-auto-mode)
|
||||||
:custom
|
:custom
|
||||||
(treesit-auto-install 'prompt)
|
(treesit-auto-install 'prompt)
|
||||||
:config
|
:config
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
("RET" . vertico-directory-enter)
|
("RET" . vertico-directory-enter)
|
||||||
("DEL" . vertico-directory-delete-char)
|
("DEL" . vertico-directory-delete-char)
|
||||||
("M-DEL" . vertico-directory-delete-word))
|
("M-DEL" . vertico-directory-delete-word))
|
||||||
:hook (elpaca-after-init . vertico-mode)
|
:hook (after-init . vertico-mode)
|
||||||
:hook (rfn-eshadow-update-overlay . vertico-directory-tidy))
|
:hook (rfn-eshadow-update-overlay . vertico-directory-tidy))
|
||||||
|
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@
|
|||||||
|
|
||||||
;; Enrich existing commands with completion annotations
|
;; Enrich existing commands with completion annotations
|
||||||
(use-package marginalia
|
(use-package marginalia
|
||||||
:hook (elpaca-after-init . marginalia-mode))
|
:hook (after-init . marginalia-mode))
|
||||||
|
|
||||||
|
|
||||||
;; Add icons to completion candidates
|
;; Add icons to completion candidates
|
||||||
@@ -111,16 +111,13 @@
|
|||||||
|
|
||||||
;; Consulting completing-read
|
;; Consulting completing-read
|
||||||
(use-package consult
|
(use-package consult
|
||||||
|
:commands consult-customize
|
||||||
:bind (("C-." . consult-imenu)
|
:bind (("C-." . consult-imenu)
|
||||||
("C-c T" . consult-theme)
|
("C-c T" . consult-theme)
|
||||||
|
|
||||||
([remap Info-search] . consult-info)
|
([remap Info-search] . consult-info)
|
||||||
;; ([remap isearch-forward] . consult-line)
|
;; ([remap isearch-forward] . consult-line)
|
||||||
([remap recentf-open-files] . consult-recent-file)
|
([remap recentf-open-files] . consult-recent-file)
|
||||||
|
|
||||||
|
|
||||||
("C-x M-:" . consult-complex-command) ;; orig. repeat-complex-command
|
("C-x M-:" . consult-complex-command) ;; orig. repeat-complex-command
|
||||||
|
|
||||||
;; Custom M-# bindings for fast register access
|
;; Custom M-# bindings for fast register access
|
||||||
("M-#" . consult-register-load)
|
("M-#" . consult-register-load)
|
||||||
("M-'" . consult-register-store) ;; orig. abbrev-prefix-mark (unrelated)
|
("M-'" . consult-register-store) ;; orig. abbrev-prefix-mark (unrelated)
|
||||||
@@ -169,7 +166,6 @@
|
|||||||
(use-package consult-flycheck)
|
(use-package consult-flycheck)
|
||||||
|
|
||||||
(use-package consult-dir
|
(use-package consult-dir
|
||||||
:ensure t
|
|
||||||
:bind (("C-x C-d" . consult-dir)
|
:bind (("C-x C-d" . consult-dir)
|
||||||
:map minibuffer-local-completion-map
|
:map minibuffer-local-completion-map
|
||||||
("C-x C-d" . consult-dir)
|
("C-x C-d" . consult-dir)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
(use-package dashboard
|
(use-package dashboard
|
||||||
:init
|
:init
|
||||||
(use-package doom-dashboard
|
(use-package doom-dashboard
|
||||||
:ensure (doom-dashboard :host github
|
:straight (doom-dashboard :host github
|
||||||
:repo "emacs-dashboard/doom-dashboard")
|
:repo "emacs-dashboard/doom-dashboard")
|
||||||
:demand t
|
:demand t
|
||||||
;; Movement keys like doom.
|
;; Movement keys like doom.
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
|
|
||||||
;; Extra Dired functionality
|
;; Extra Dired functionality
|
||||||
(use-package dired-aux :ensure nil))
|
(use-package dired-aux :straight nil))
|
||||||
|
|
||||||
(use-package nerd-icons-dired
|
(use-package nerd-icons-dired
|
||||||
:diminish
|
:diminish
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
;; -*- lexical-binding: t -*-
|
;; -*- lexical-binding: t -*-
|
||||||
|
|
||||||
(use-package delsel
|
(use-package delsel
|
||||||
:ensure nil
|
:hook (after-init . delete-selection-mode))
|
||||||
:hook (elpaca-after-init . delete-selection-mode))
|
|
||||||
|
|
||||||
(use-package smartparens
|
(use-package smartparens
|
||||||
:diminish
|
:diminish
|
||||||
:hook (elpaca-after-init . smartparens-global-mode)
|
:hook (after-init . smartparens-global-mode)
|
||||||
;; :hook (elpaca-after-init . smartparens-global-strict-mode)
|
;; :hook (after-init . smartparens-global-strict-mode)
|
||||||
:init (sp-use-paredit-bindings)
|
:init (sp-use-paredit-bindings)
|
||||||
:config
|
:config
|
||||||
;; Autopair quotes more conservatively; if I'm next to a word/before another
|
;; Autopair quotes more conservatively; if I'm next to a word/before another
|
||||||
@@ -36,21 +35,17 @@
|
|||||||
;; resolve conflict with hungry-delete
|
;; resolve conflict with hungry-delete
|
||||||
(defadvice hungry-delete-backward (before sp-delete-pair-advice activate) (save-match-data (sp-delete-pair (ad-get-arg 0)))))
|
(defadvice hungry-delete-backward (before sp-delete-pair-advice activate) (save-match-data (sp-delete-pair (ad-get-arg 0)))))
|
||||||
|
|
||||||
;; (use-package electric-pair
|
|
||||||
;; :ensure nil
|
|
||||||
;; :hook elpaca-after-init)
|
|
||||||
|
|
||||||
;; Hungry deletion
|
;; Hungry deletion
|
||||||
(use-package hungry-delete
|
(use-package hungry-delete
|
||||||
:diminish
|
:diminish
|
||||||
:hook (elpaca-after-init . global-hungry-delete-mode)
|
:hook (after-init . global-hungry-delete-mode)
|
||||||
:init (setq hungry-delete-chars-to-skip " \t\f\v"
|
:init (setq hungry-delete-chars-to-skip " \t\f\v"
|
||||||
hungry-delete-except-modes
|
hungry-delete-except-modes
|
||||||
'(help-mode minibuffer-mode minibuffer-inactive-mode calc-mode)))
|
'(help-mode minibuffer-mode minibuffer-inactive-mode calc-mode)))
|
||||||
|
|
||||||
(use-package abbrev
|
(use-package abbrev
|
||||||
:diminish
|
|
||||||
:ensure nil
|
:ensure nil
|
||||||
|
:diminish
|
||||||
:config
|
:config
|
||||||
(setq-default abbrev-mode t)
|
(setq-default abbrev-mode t)
|
||||||
(setq abbrev-file-name (expand-file-name "abbrev.el" user-emacs-directory)))
|
(setq abbrev-file-name (expand-file-name "abbrev.el" user-emacs-directory)))
|
||||||
@@ -58,7 +53,7 @@
|
|||||||
(use-package autorevert
|
(use-package autorevert
|
||||||
:ensure nil
|
:ensure nil
|
||||||
:diminish
|
:diminish
|
||||||
:hook (elpaca-after-init . global-auto-revert-mode))
|
:hook (after-init . global-auto-revert-mode))
|
||||||
|
|
||||||
(use-package goto-addr
|
(use-package goto-addr
|
||||||
:ensure nil
|
:ensure nil
|
||||||
@@ -66,7 +61,7 @@
|
|||||||
(prog-mode . goto-address-prog-mode)))
|
(prog-mode . goto-address-prog-mode)))
|
||||||
|
|
||||||
(use-package multiple-cursors
|
(use-package multiple-cursors
|
||||||
:hook elpaca-after-init
|
:hook after-init
|
||||||
:bind (("C-S-c C-S-c" . mc/edit-lines)
|
:bind (("C-S-c C-S-c" . mc/edit-lines)
|
||||||
("C->" . mc/mark-next-like-this)
|
("C->" . mc/mark-next-like-this)
|
||||||
("C-<" . mc/mark-previous-like-this)
|
("C-<" . mc/mark-previous-like-this)
|
||||||
@@ -78,8 +73,8 @@
|
|||||||
:map mc/keymap
|
:map mc/keymap
|
||||||
("C-|" . mc/vertical-align-with-space)))
|
("C-|" . mc/vertical-align-with-space)))
|
||||||
|
|
||||||
(use-package smart-region
|
(use-package expand-region
|
||||||
:hook (after-init . smart-region-on))
|
:bind ("C-=" . er/expand-region))
|
||||||
|
|
||||||
(use-package mwim
|
(use-package mwim
|
||||||
:bind (([remap move-beginning-of-line] . mwim-beginning)
|
:bind (([remap move-beginning-of-line] . mwim-beginning)
|
||||||
@@ -101,7 +96,7 @@
|
|||||||
|
|
||||||
(use-package ace-pinyin
|
(use-package ace-pinyin
|
||||||
:diminish
|
:diminish
|
||||||
:hook (elpaca-after-init . ace-pinyin-global-mode))
|
:hook (after-init . ace-pinyin-global-mode))
|
||||||
|
|
||||||
;; show number of matches
|
;; show number of matches
|
||||||
(use-package anzu
|
(use-package anzu
|
||||||
@@ -111,7 +106,7 @@
|
|||||||
:map isearch-mode-map
|
:map isearch-mode-map
|
||||||
([remap isearch-query-replace] . anzu-isearch-query-replace)
|
([remap isearch-query-replace] . anzu-isearch-query-replace)
|
||||||
([remap isearch-query-replace-regexp] . anzu-isearch-query-replace-regexp))
|
([remap isearch-query-replace-regexp] . anzu-isearch-query-replace-regexp))
|
||||||
:hook (elpaca-after-init . global-anzu-mode))
|
:hook (after-init . global-anzu-mode))
|
||||||
|
|
||||||
;; Goto last change
|
;; Goto last change
|
||||||
(use-package goto-chg
|
(use-package goto-chg
|
||||||
@@ -124,7 +119,7 @@
|
|||||||
|
|
||||||
;; Remember undo history
|
;; Remember undo history
|
||||||
(use-package undo-fu-session
|
(use-package undo-fu-session
|
||||||
:hook (elpaca-after-init . undo-fu-session-global-mode))
|
:hook (after-init . undo-fu-session-global-mode))
|
||||||
|
|
||||||
;; Process
|
;; Process
|
||||||
(use-package proced
|
(use-package proced
|
||||||
@@ -144,4 +139,12 @@
|
|||||||
(olivetti-margin-width 5)
|
(olivetti-margin-width 5)
|
||||||
(olivetti-body-width 90))
|
(olivetti-body-width 90))
|
||||||
|
|
||||||
|
(setq-default bidi-display-reordering 'left-to-right
|
||||||
|
bidi-paragraph-direction 'left-to-right
|
||||||
|
bidi-display-reordering nil)
|
||||||
|
(setq bidi-inhibit-bpa t
|
||||||
|
long-line-threshold 1000
|
||||||
|
large-hscroll-threshold 1000
|
||||||
|
syntax-wholeline-max 1000)
|
||||||
|
|
||||||
(provide 'init-edit)
|
(provide 'init-edit)
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
;; -*- lexical-binding: t; -*-
|
;; -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
(use-package jsonrpc)
|
|
||||||
|
|
||||||
(use-package eglot
|
(use-package eglot
|
||||||
:defer t
|
:commands (eglot eglot-ensure)
|
||||||
:hook ((prog-mode . (lambda ()
|
:hook ((prog-mode . (lambda ()
|
||||||
(unless (derived-mode-p
|
(unless (derived-mode-p
|
||||||
'emacs-lisp-mode 'lisp-mode
|
'emacs-lisp-mode 'lisp-mode
|
||||||
@@ -22,7 +20,7 @@
|
|||||||
eglot-code-action-indications '(eldoc-hint)))
|
eglot-code-action-indications '(eldoc-hint)))
|
||||||
|
|
||||||
(use-package eglot-booster
|
(use-package eglot-booster
|
||||||
:ensure (eglot-booster :type git :host nil :repo "https://github.com/jdtsmith/eglot-booster")
|
:straight (eglot-booster :type git :host nil :repo "https://github.com/jdtsmith/eglot-booster")
|
||||||
:after eglot
|
:after eglot
|
||||||
:config (eglot-booster-mode))
|
:config (eglot-booster-mode))
|
||||||
|
|
||||||
|
|||||||
@@ -2,15 +2,15 @@
|
|||||||
|
|
||||||
;;;;;;;;;;;; elpaca initialise ;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;; elpaca initialise ;;;;;;;;;;;;;;;;;;
|
||||||
(defvar elpaca-installer-version 0.12)
|
(defvar elpaca-installer-version 0.12)
|
||||||
(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory))
|
(defvar elpaca-directory (expand-file-name "elpa/" user-emacs-directory))
|
||||||
(defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory))
|
(defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory))
|
||||||
(defvar elpaca-sources-directory (expand-file-name "sources/" elpaca-directory))
|
(defvar elpaca-sources-directory (expand-file-name "sources/" elpaca-directory))
|
||||||
(defvar elpaca-order '(elpaca :repo "https://github.com/progfolio/elpaca.git"
|
(defvar elpaca-order '(elpaca :repo "https://github.com/progfolio/elpaca.git"
|
||||||
:ref nil :depth 1 :inherit ignore
|
:ref nil :depth 1 :inherit ignore
|
||||||
:files (:defaults "elpaca-test.el" (:exclude "extensions"))
|
:files (:defaults "elpaca-test.el" (:exclude "extensions"))
|
||||||
:build (:not elpaca-activate)))
|
:build (:not elpaca-activate)))
|
||||||
(let* ((repo (expand-file-name "elpaca/" elpaca-sources-directory))
|
(let* ((repo (expand-file-name "elpa/" elpaca-sources-directory))
|
||||||
(build (expand-file-name "elpaca/" elpaca-builds-directory))
|
(build (expand-file-name "elpa/" elpaca-builds-directory))
|
||||||
(order (cdr elpaca-order))
|
(order (cdr elpaca-order))
|
||||||
(default-directory repo))
|
(default-directory repo))
|
||||||
(add-to-list 'load-path (if (file-exists-p build) build repo))
|
(add-to-list 'load-path (if (file-exists-p build) build repo))
|
||||||
@@ -51,14 +51,14 @@
|
|||||||
|
|
||||||
;; Install use-package support
|
;; Install use-package support
|
||||||
(elpaca elpaca-use-package
|
(elpaca elpaca-use-package
|
||||||
;; Enable use-package :ensure support for Elpaca.
|
;; Enable use-package :straight support for Elpaca.
|
||||||
(elpaca-use-package-mode))
|
(elpaca-use-package-mode))
|
||||||
|
|
||||||
;;When installing a package used in the init file itself,
|
;;When installing a package used in the init file itself,
|
||||||
;;e.g. a package which adds a use-package key word,
|
;;e.g. a package which adds a use-package key word,
|
||||||
;;use the :wait recipe keyword to block until that package is installed/configured.
|
;;use the :wait recipe keyword to block until that package is installed/configured.
|
||||||
;;For example:
|
;;For example:
|
||||||
;;(use-package general :ensure (:wait t) :demand t)
|
;;(use-package general :straight (:wait t) :demand t)
|
||||||
|
|
||||||
(setq elpaca-lock-file (expand-file-name "lock-file.eld" user-emacs-directory))
|
(setq elpaca-lock-file (expand-file-name "lock-file.eld" user-emacs-directory))
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
(use-package gcmh
|
(use-package gcmh
|
||||||
:diminish
|
:diminish
|
||||||
:ensure (:wait t) ;; what does this do in elpaca
|
:straight (:wait t) ;; what does this do in elpaca
|
||||||
:init
|
:init
|
||||||
(gcmh-mode 1)
|
(gcmh-mode 1)
|
||||||
:config
|
:config
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
:hook ((emacs-lisp-mode . hydra-add-imenu)))
|
:hook ((emacs-lisp-mode . hydra-add-imenu)))
|
||||||
|
|
||||||
(use-package pretty-hydra
|
(use-package pretty-hydra
|
||||||
:ensure (:wait t)
|
:straight (:wait t)
|
||||||
:hook (emacs-lisp-mode . (lambda ()
|
:hook (emacs-lisp-mode . (lambda ()
|
||||||
(add-to-list
|
(add-to-list
|
||||||
'imenu-generic-expression
|
'imenu-generic-expression
|
||||||
|
|||||||
@@ -85,7 +85,7 @@
|
|||||||
|
|
||||||
(use-package meow
|
(use-package meow
|
||||||
:demand t
|
:demand t
|
||||||
:hook (elpaca-after-init . meow-global-mode)
|
:hook (after-init . meow-global-mode)
|
||||||
:config
|
:config
|
||||||
(meow-setup)
|
(meow-setup)
|
||||||
(setq meow-replace-state-name-list
|
(setq meow-replace-state-name-list
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
|
|
||||||
(use-package tuareg
|
(use-package tuareg
|
||||||
:ensure t
|
:straight t
|
||||||
:mode (("\\.ocamlinit\\'" . tuareg-mode))
|
:mode (("\\.ocamlinit\\'" . tuareg-mode))
|
||||||
:config
|
:config
|
||||||
(setq tuareg-prettify-symbols-full t)
|
(setq tuareg-prettify-symbols-full t)
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
|
|
||||||
(use-package ocaml-eglot
|
(use-package ocaml-eglot
|
||||||
:ensure t
|
:straight t
|
||||||
:after tuareg
|
:after tuareg
|
||||||
:hook (tuareg-mode . ocaml-eglot)
|
:hook (tuareg-mode . ocaml-eglot)
|
||||||
:hook (ocaml-eglot . eglot-ensure)
|
:hook (ocaml-eglot . eglot-ensure)
|
||||||
|
|||||||
@@ -6,8 +6,30 @@
|
|||||||
;; "* TODO %?\n%i\n%a" :prepend t))))
|
;; "* TODO %?\n%i\n%a" :prepend t))))
|
||||||
|
|
||||||
(use-package org
|
(use-package org
|
||||||
:ensure (org :repo "https://code.tecosaur.net/tec/org-mode.git/"
|
:straight (org :fork (:host nil
|
||||||
:branch "dev")
|
:repo "https://code.tecosaur.net/tec/org-mode.git"
|
||||||
|
:branch "dev"
|
||||||
|
:remote "tecosaur")
|
||||||
|
:branch "dev"
|
||||||
|
:files (:defaults "etc")
|
||||||
|
:build t
|
||||||
|
:pre-build
|
||||||
|
(with-temp-file "org-version.el"
|
||||||
|
(require 'lisp-mnt)
|
||||||
|
(let ((version
|
||||||
|
(with-temp-buffer
|
||||||
|
(insert-file-contents "lisp/org.el")
|
||||||
|
(lm-header "version")))
|
||||||
|
(git-version
|
||||||
|
(string-trim
|
||||||
|
(with-temp-buffer
|
||||||
|
(call-process "git" nil t nil "rev-parse" "--short" "HEAD")
|
||||||
|
(buffer-string)))))
|
||||||
|
(insert
|
||||||
|
(format "(defun org-release () \"The release version of Org.\" %S)\n" version)
|
||||||
|
(format "(defun org-git-version () \"The truncate git commit hash of Org mode.\" %S)\n" git-version)
|
||||||
|
"(provide 'org-version)\n")))
|
||||||
|
:pin nil)
|
||||||
:hook (org-mode . org-cdlatex-mode)
|
:hook (org-mode . org-cdlatex-mode)
|
||||||
:hook (org-mode . org-indent-mode)
|
:hook (org-mode . org-indent-mode)
|
||||||
:hook (org-mode . visual-line-mode)
|
:hook (org-mode . visual-line-mode)
|
||||||
@@ -59,6 +81,11 @@
|
|||||||
(self-insert-command 1))))
|
(self-insert-command 1))))
|
||||||
("M-<return>" . org-insert-subheading))
|
("M-<return>" . org-insert-subheading))
|
||||||
:config
|
:config
|
||||||
|
(elemacs-load-packages-incrementally
|
||||||
|
'(calendar find-func format-spec org-macs org-compat
|
||||||
|
org-faces org-entities org-list org-pcomplete org-src
|
||||||
|
org-footnote org-macro ob org org-clock org-agenda
|
||||||
|
org-capture))
|
||||||
;; For hydra
|
;; For hydra
|
||||||
(defun hot-expand (str &optional mod)
|
(defun hot-expand (str &optional mod)
|
||||||
"Expand org template.
|
"Expand org template.
|
||||||
@@ -144,7 +171,7 @@ the element after the #+HEADER: tag."
|
|||||||
))
|
))
|
||||||
|
|
||||||
(use-package org-modern-indent
|
(use-package org-modern-indent
|
||||||
:ensure (org-modern-indent :type git :host github :repo "jdtsmith/org-modern-indent")
|
:straight (org-modern-indent :type git :host github :repo "jdtsmith/org-modern-indent")
|
||||||
:config ; add late to hook
|
:config ; add late to hook
|
||||||
(add-hook 'org-mode-hook #'org-modern-indent-mode 90))
|
(add-hook 'org-mode-hook #'org-modern-indent-mode 90))
|
||||||
|
|
||||||
@@ -157,8 +184,7 @@ the element after the #+HEADER: tag."
|
|||||||
(run-at-time nil nil #'org-appear--set-elements))
|
(run-at-time nil nil #'org-appear--set-elements))
|
||||||
|
|
||||||
(use-package hl-todo
|
(use-package hl-todo
|
||||||
:hook (prog-mode . hl-todo-mode)
|
:hook (after-init . global-hl-todo-mode)
|
||||||
:hook (yaml-mode . hl-todo-mode)
|
|
||||||
:config
|
:config
|
||||||
(setq hl-todo-highlight-punctuation ":"
|
(setq hl-todo-highlight-punctuation ":"
|
||||||
hl-todo-keyword-faces
|
hl-todo-keyword-faces
|
||||||
@@ -263,7 +289,6 @@ the element after the #+HEADER: tag."
|
|||||||
(add-hook 'text-scale-mode-hook #'my/text-scale-adjust-latex-previews))
|
(add-hook 'text-scale-mode-hook #'my/text-scale-adjust-latex-previews))
|
||||||
|
|
||||||
(use-package org-roam
|
(use-package org-roam
|
||||||
:ensure t
|
|
||||||
:custom
|
:custom
|
||||||
(org-roam-directory (file-truename "~/org/roam"))
|
(org-roam-directory (file-truename "~/org/roam"))
|
||||||
:bind (("C-c n l" . org-roam-buffer-toggle)
|
:bind (("C-c n l" . org-roam-buffer-toggle)
|
||||||
|
|||||||
@@ -55,10 +55,11 @@
|
|||||||
(setq eshell-banner-message "")
|
(setq eshell-banner-message "")
|
||||||
|
|
||||||
(use-package eat
|
(use-package eat
|
||||||
:bind ("C-`" . eat-toggle)
|
:bind ("C-`" . eshell-toggle)
|
||||||
|
:bind ("C-<escape>" . eat-toggle)
|
||||||
:hook ((eshell-load . eat-eshell-mode)
|
:hook ((eshell-load . eat-eshell-mode)
|
||||||
(eshell-load . eat-eshell-visual-command-mode))
|
(eshell-load . eat-eshell-visual-command-mode))
|
||||||
:ensure `(eat :repo "https://codeberg.org/akib/emacs-eat"
|
:straight `(eat :repo "https://codeberg.org/akib/emacs-eat"
|
||||||
:files ("*.el" ("term" "term/*.el") "*.texi"
|
:files ("*.el" ("term" "term/*.el") "*.texi"
|
||||||
"*.ti" ("terminfo/e" "terminfo/e/*")
|
"*.ti" ("terminfo/e" "terminfo/e/*")
|
||||||
("terminfo/65" "terminfo/65/*")
|
("terminfo/65" "terminfo/65/*")
|
||||||
@@ -69,10 +70,17 @@
|
|||||||
(eat-kill-buffer-on-exit t)
|
(eat-kill-buffer-on-exit t)
|
||||||
;; (eat-shell )
|
;; (eat-shell )
|
||||||
:config
|
:config
|
||||||
(defun eat-toggle () (interactive)
|
(defun eshell-toggle () (interactive)
|
||||||
(if (string= (buffer-name) "*eshell*")
|
(if (string= (buffer-name) "*eshell*")
|
||||||
(delete-window)
|
(delete-window)
|
||||||
(eshell)))
|
(eshell)))
|
||||||
|
(defun eat-toggle () (interactive)
|
||||||
|
(if (string= (buffer-name) "*eat*")
|
||||||
|
(delete-window)
|
||||||
|
(eat)))
|
||||||
|
|
||||||
|
;; Improve latency
|
||||||
|
(setq process-adaptive-read-buffering t)
|
||||||
|
|
||||||
(setq tramp-remote-process-environment '("TERM=xterm-256color" "TERMINFO=''" "ENV=''" "TMOUT=0" "LC_CTYPE=''" "CDPATH=" "HISTORY=" "MAIL=" "MAILCHECK=" "MAILPATH=" "PAGER=cat" "autocorrect=" "correct="))
|
(setq tramp-remote-process-environment '("TERM=xterm-256color" "TERMINFO=''" "ENV=''" "TMOUT=0" "LC_CTYPE=''" "CDPATH=" "HISTORY=" "MAIL=" "MAILCHECK=" "MAILPATH=" "PAGER=cat" "autocorrect=" "correct="))
|
||||||
(when (eq system-type 'darwin)
|
(when (eq system-type 'darwin)
|
||||||
@@ -96,7 +104,7 @@
|
|||||||
|
|
||||||
(use-package eshell-syntax-highlighting
|
(use-package eshell-syntax-highlighting
|
||||||
:after eshell-mode
|
:after eshell-mode
|
||||||
:hook (elpaca-after-init . eshell-syntax-highlighting-global-mode))
|
:hook (after-init . eshell-syntax-highlighting-global-mode))
|
||||||
|
|
||||||
|
|
||||||
(provide 'init-shell)
|
(provide 'init-shell)
|
||||||
|
|||||||
@@ -3,11 +3,11 @@
|
|||||||
;; Yasnippet settings
|
;; Yasnippet settings
|
||||||
(use-package yasnippet
|
(use-package yasnippet
|
||||||
:diminish
|
:diminish
|
||||||
:ensure t
|
:hook (after-init . yas-global-mode)
|
||||||
:hook (elpaca-after-init . yas-global-mode)
|
|
||||||
:hook ((LaTeX-mode . yas-minor-mode)
|
:hook ((LaTeX-mode . yas-minor-mode)
|
||||||
(post-self-insert . my/yas-try-expanding-auto-snippets))
|
(post-self-insert . my/yas-try-expanding-auto-snippets))
|
||||||
:config
|
:config
|
||||||
|
(elemacs-load-packages-incrementally '(eldoc easymenu help-mode))
|
||||||
(use-package warnings
|
(use-package warnings
|
||||||
:ensure nil
|
:ensure nil
|
||||||
:config
|
:config
|
||||||
|
|||||||
24
lisp/init-straight.el
Normal file
24
lisp/init-straight.el
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
;; -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
(defvar bootstrap-version)
|
||||||
|
(let ((bootstrap-file
|
||||||
|
(expand-file-name
|
||||||
|
"straight/repos/straight.el/bootstrap.el"
|
||||||
|
(or (bound-and-true-p straight-base-dir)
|
||||||
|
user-emacs-directory)))
|
||||||
|
(bootstrap-version 7))
|
||||||
|
(unless (file-exists-p bootstrap-file)
|
||||||
|
(with-current-buffer
|
||||||
|
(url-retrieve-synchronously
|
||||||
|
"https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
|
||||||
|
'silent 'inhibit-cookies)
|
||||||
|
(goto-char (point-max))
|
||||||
|
(eval-print-last-sexp)))
|
||||||
|
(load bootstrap-file nil 'nomessage))
|
||||||
|
|
||||||
|
(setq straight-use-package-by-default t
|
||||||
|
use-package-expand-minimally t
|
||||||
|
use-package-always-defer t)
|
||||||
|
|
||||||
|
|
||||||
|
(provide 'init-straight)
|
||||||
@@ -1,16 +1,18 @@
|
|||||||
;; -*- lexical-binding: t; -*-
|
;; -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
(use-package latex
|
(use-package latex
|
||||||
:ensure (auctex :pre-build (("./autogen.sh")
|
;; :straight (auctex :pre-build (("./autogen.sh")
|
||||||
("./configure" "--without-texmf-dir" "--with-lispdir=.")
|
;; ("./configure" "--without-texmf-dir" "--with-lispdir=.")
|
||||||
("make")))
|
;; ("make")))
|
||||||
|
:straight (auctex :type git :host nil :repo "https://git.savannah.gnu.org/git/auctex.git")
|
||||||
:mode (("\\.tex\\'" . LaTeX-mode))
|
:mode (("\\.tex\\'" . LaTeX-mode))
|
||||||
:hook (LaTeX-mode . prettify-symbols-mode)
|
:hook (LaTeX-mode . prettify-symbols-mode)
|
||||||
:hook (LaTeX-mode . visual-line-mode)
|
:hook (LaTeX-mode . visual-line-mode)
|
||||||
:hook (LaTeX-mode . turn-on-reftex)
|
:hook (LaTeX-mode . turn-on-reftex)
|
||||||
:bind (:map LaTeX-mode-map
|
:bind (:map LaTeX-mode-map
|
||||||
("C-S-e" . latex-math-from-calc)
|
("C-S-e" . latex-math-from-calc)
|
||||||
("C-c x" . TeX-clean))
|
("C-c x" . TeX-clean)
|
||||||
|
("S-s-<mouse-1>" . TeX-view))
|
||||||
:custom
|
:custom
|
||||||
(TeX-auto-save t)
|
(TeX-auto-save t)
|
||||||
(TeX-parse-self t)
|
(TeX-parse-self t)
|
||||||
@@ -23,13 +25,17 @@
|
|||||||
(TeX-display-help t)
|
(TeX-display-help t)
|
||||||
(TeX-show-compilation nil)
|
(TeX-show-compilation nil)
|
||||||
(TeX-command-extra-options "-shell-escape")
|
(TeX-command-extra-options "-shell-escape")
|
||||||
|
(TeX-view-program-selection '((output-pdf "displayline")))
|
||||||
:config
|
:config
|
||||||
(add-hook 'LaTeX-mode-hook (lambda ()
|
(add-hook 'LaTeX-mode-hook '(lambda ()
|
||||||
(setq TeX-command-default "LaTeXMk")))
|
(setq TeX-command-default "LaTeXMk")))
|
||||||
|
|
||||||
|
|
||||||
;; Format math as a Latex string with Calc
|
;; Format math as a Latex string with Calc
|
||||||
(add-hook 'LaTeX-mode-hook #'eglot-ensure)
|
(add-hook 'LaTeX-mode-hook #'eglot-ensure)
|
||||||
|
|
||||||
|
(setq-default LaTeX-indent-environment-list nil)
|
||||||
|
|
||||||
(defun latex-math-from-calc ()
|
(defun latex-math-from-calc ()
|
||||||
"Evaluate `calc' on the contents of line at point."
|
"Evaluate `calc' on the contents of line at point."
|
||||||
(interactive)
|
(interactive)
|
||||||
@@ -58,13 +64,13 @@
|
|||||||
|
|
||||||
(use-package cdlatex
|
(use-package cdlatex
|
||||||
:diminish
|
:diminish
|
||||||
:ensure t
|
|
||||||
:hook (LaTeX-mode . turn-on-cdlatex)
|
:hook (LaTeX-mode . turn-on-cdlatex)
|
||||||
;; :bind (:map cdlatex-mode-map
|
;; :bind (:map cdlatex-mode-map
|
||||||
;; ("<tab>" . cdlatex-tab))
|
;; ("<tab>" . cdlatex-tab))
|
||||||
:config
|
:config
|
||||||
(setq cdlatex-math-symbol-alist '((?f ("\\varphi" "\\phi"))
|
(setq cdlatex-math-symbol-alist '((?f ("\\varphi" "\\phi"))
|
||||||
(?i ("\\iota"))
|
(?i ("\\iota"))
|
||||||
|
(?c ("\\circ"))
|
||||||
))
|
))
|
||||||
(setq cdlatex-math-modify-alist '((?f "\\mathbb" nil t nil nil)))
|
(setq cdlatex-math-modify-alist '((?f "\\mathbb" nil t nil nil)))
|
||||||
(defun tjh/cdlatex-yas-expand ()
|
(defun tjh/cdlatex-yas-expand ()
|
||||||
@@ -81,8 +87,8 @@ expansion, then cdlatex expansion."
|
|||||||
nil))
|
nil))
|
||||||
(add-hook 'cdlatex-tab-hook 'tjh/cdlatex-yas-expand))
|
(add-hook 'cdlatex-tab-hook 'tjh/cdlatex-yas-expand))
|
||||||
|
|
||||||
(use-package texpresso
|
;; (use-package texpresso
|
||||||
:defer nil
|
;; :defer nil
|
||||||
:load-path "~/.emacs.d/lisp/packages/")
|
;; :load-path "~/.emacs.d/lisp/packages/")
|
||||||
|
|
||||||
(provide 'init-tex)
|
(provide 'init-tex)
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
|
|
||||||
(use-package treemacs-tab-bar ;;treemacs-tab-bar if you use tab-bar-mode
|
(use-package treemacs-tab-bar ;;treemacs-tab-bar if you use tab-bar-mode
|
||||||
:after (treemacs)
|
:after (treemacs)
|
||||||
:ensure t
|
:straight t
|
||||||
:config (treemacs-set-scope-type 'Tabs))
|
:config (treemacs-set-scope-type 'Tabs))
|
||||||
|
|
||||||
(use-package treemacs-nerd-icons
|
(use-package treemacs-nerd-icons
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
|
|
||||||
(use-package typst-ts-mode
|
(use-package typst-ts-mode
|
||||||
:ensure (:type git :host codeberg :repo "meow_king/typst-ts-mode")
|
:straight (:type git :host codeberg :repo "meow_king/typst-ts-mode")
|
||||||
:hook (typst-ts-mode . eglot-ensure)
|
:hook (typst-ts-mode . eglot-ensure)
|
||||||
:custom
|
:custom
|
||||||
;; (typst-ts-watch-options "--open")
|
;; (typst-ts-watch-options "--open")
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
(setq typst-ts-preview-function 'find-file-other-window))
|
(setq typst-ts-preview-function 'find-file-other-window))
|
||||||
|
|
||||||
(use-package typst-preview
|
(use-package typst-preview
|
||||||
:ensure (:type git :host github :repo "havarddj/typst-preview.el")
|
:straight (:type git :host github :repo "havarddj/typst-preview.el")
|
||||||
:init
|
:init
|
||||||
(setq typst-preview-autostart t) ; start preview automatically when typst-preview-mode is activated
|
(setq typst-preview-autostart t) ; start preview automatically when typst-preview-mode is activated
|
||||||
(setq typst-preview-open-browser-automatically t) ; open browser automatically when typst-preview-start is run
|
(setq typst-preview-open-browser-automatically t) ; open browser automatically when typst-preview-start is run
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
;; (setq-default line-height 0.16)
|
;; (setq-default line-height 0.16)
|
||||||
;; (setq-local default-text-properties '(line-spacing 0.1 line-height 1.1))
|
;; (setq-local default-text-properties '(line-spacing 0.1 line-height 1.1))
|
||||||
|
|
||||||
|
(use-package diminish)
|
||||||
|
|
||||||
;; Suppress GUI features
|
;; Suppress GUI features
|
||||||
(setq use-file-dialog nil
|
(setq use-file-dialog nil
|
||||||
@@ -24,10 +25,11 @@
|
|||||||
frame-resize-pixelwise t)
|
frame-resize-pixelwise t)
|
||||||
|
|
||||||
;; 隐藏 title bar
|
;; 隐藏 title bar
|
||||||
(setq default-frame-alist '((undecorated-round . t)))
|
(add-to-list 'default-frame-alist '(undecorated-round . t))
|
||||||
|
|
||||||
(use-package solaire-mode
|
(use-package solaire-mode
|
||||||
:hook (elpaca-after-init . solaire-global-mode))
|
:ensure nil
|
||||||
|
:hook (after-init . solaire-global-mode))
|
||||||
|
|
||||||
(use-package modus-themes
|
(use-package modus-themes
|
||||||
:init
|
:init
|
||||||
@@ -40,7 +42,6 @@
|
|||||||
;; (modus-themes-load-theme 'standard-light-tinted))
|
;; (modus-themes-load-theme 'standard-light-tinted))
|
||||||
|
|
||||||
(use-package doric-themes
|
(use-package doric-themes
|
||||||
:demand t
|
|
||||||
:bind ("<f5>" . doric-themes-load-random)
|
:bind ("<f5>" . doric-themes-load-random)
|
||||||
:bind ("C-<f5>" . doric-load-random-light)
|
:bind ("C-<f5>" . doric-load-random-light)
|
||||||
:bind ("M-<f5>" . doric-load-random-dark)
|
:bind ("M-<f5>" . doric-load-random-dark)
|
||||||
@@ -105,7 +106,7 @@
|
|||||||
:hook prog-mode)
|
:hook prog-mode)
|
||||||
|
|
||||||
(use-package doom-modeline
|
(use-package doom-modeline
|
||||||
:hook (elpaca-after-init . doom-modeline-mode)
|
:hook (after-init . doom-modeline-mode)
|
||||||
:config
|
:config
|
||||||
(setq doom-modeline-support-imenu t
|
(setq doom-modeline-support-imenu t
|
||||||
doom-modeline-height 30
|
doom-modeline-height 30
|
||||||
@@ -154,13 +155,13 @@
|
|||||||
|
|
||||||
(use-package diff-hl
|
(use-package diff-hl
|
||||||
:diminish
|
:diminish
|
||||||
:hook (elpaca-after-init global-diff-hl-mode)
|
:hook (after-init global-diff-hl-mode)
|
||||||
:hook (elpaca-after-init diff-hl-dired-mode)
|
:hook (after-init diff-hl-dired-mode)
|
||||||
:hook (elpaca-after-init diff-hl-flydiff-mode))
|
:hook (after-init diff-hl-flydiff-mode))
|
||||||
|
|
||||||
;; Easily adjust the font size in all frames
|
;; Easily adjust the font size in all frames
|
||||||
(use-package default-text-scale
|
(use-package default-text-scale
|
||||||
:hook (elpaca-after-init . default-text-scale-mode)
|
:hook (after-init . default-text-scale-mode)
|
||||||
:bind (:map default-text-scale-mode-map
|
:bind (:map default-text-scale-mode-map
|
||||||
("C-s-=" . default-text-scale-increase)
|
("C-s-=" . default-text-scale-increase)
|
||||||
("C-s--" . default-text-scale-decrease)
|
("C-s--" . default-text-scale-decrease)
|
||||||
@@ -178,11 +179,11 @@
|
|||||||
mouse-wheel-progressive-speed nil)
|
mouse-wheel-progressive-speed nil)
|
||||||
|
|
||||||
(use-package nerd-icons
|
(use-package nerd-icons
|
||||||
:ensure (nerd-icons
|
:straight (nerd-icons
|
||||||
:type git
|
:type git
|
||||||
:host github
|
:host github
|
||||||
:repo "rainstormstudio/nerd-icons.el"
|
:repo "rainstormstudio/nerd-icons.el")
|
||||||
:files (:defaults "data"))
|
;; :files (:defaults "data"))
|
||||||
:custom
|
:custom
|
||||||
;; The Nerd Font you want to use in GUI
|
;; The Nerd Font you want to use in GUI
|
||||||
;; "Symbols Nerd Font Mono" is the default and is recommended
|
;; "Symbols Nerd Font Mono" is the default and is recommended
|
||||||
@@ -190,7 +191,7 @@
|
|||||||
(nerd-icons-font-family "Symbols Nerd Font Mono"))
|
(nerd-icons-font-family "Symbols Nerd Font Mono"))
|
||||||
|
|
||||||
(use-package nerd-icons-ibuffer
|
(use-package nerd-icons-ibuffer
|
||||||
:ensure t
|
:straight t
|
||||||
:hook (ibuffer-mode-hook . nerd-icons-ibuffer-mode))
|
:hook (ibuffer-mode-hook . nerd-icons-ibuffer-mode))
|
||||||
|
|
||||||
;; Display transient in child frame
|
;; Display transient in child frame
|
||||||
@@ -199,7 +200,7 @@
|
|||||||
;; :commands transient-posframe-mode
|
;; :commands transient-posframe-mode
|
||||||
;; :custom-face
|
;; :custom-face
|
||||||
;; (transient-posframe-border ((t (:inherit posframe-border :background unspecified))))
|
;; (transient-posframe-border ((t (:inherit posframe-border :background unspecified))))
|
||||||
;; :hook elpaca-after-init
|
;; :hook after-init
|
||||||
;; :init (setq transient-mode-line-format nil
|
;; :init (setq transient-mode-line-format nil
|
||||||
;; transient-posframe-parameters '((left-fringe . 8)
|
;; transient-posframe-parameters '((left-fringe . 8)
|
||||||
;; (right-fringe . 8))))
|
;; (right-fringe . 8))))
|
||||||
@@ -213,10 +214,16 @@
|
|||||||
|
|
||||||
(use-package beacon
|
(use-package beacon
|
||||||
:diminish
|
:diminish
|
||||||
:hook elpaca-after-init)
|
:hook after-init)
|
||||||
|
|
||||||
(use-package spacious-padding
|
(use-package spacious-padding
|
||||||
:diminish
|
:diminish
|
||||||
:hook elpaca-after-init)
|
:hook after-init)
|
||||||
|
|
||||||
|
;; Eval result overlay
|
||||||
|
(use-package eros
|
||||||
|
:hook after-init
|
||||||
|
:bind (([remap eval-defun] . eros-eval-defun)
|
||||||
|
([remap eval-last-sexp] . eros-eval-last-sexp)))
|
||||||
|
|
||||||
(provide 'init-ui)
|
(provide 'init-ui)
|
||||||
|
|||||||
@@ -4,14 +4,14 @@
|
|||||||
:diminish
|
:diminish
|
||||||
:functions childframe-completion-workable-p
|
:functions childframe-completion-workable-p
|
||||||
:bind ("C-h M-m" . which-key-show-major-mode)
|
:bind ("C-h M-m" . which-key-show-major-mode)
|
||||||
:hook (elpaca-after-init . which-key-mode)
|
:hook (after-init . which-key-mode)
|
||||||
:init (setq which-key-max-description-length 30
|
:init (setq which-key-max-description-length 30
|
||||||
which-key-idle-delay 0.5
|
which-key-idle-delay 0.5
|
||||||
which-key-lighter nil
|
which-key-lighter nil
|
||||||
which-key-show-remaining-keys t)
|
which-key-show-remaining-keys t)
|
||||||
:config
|
:config
|
||||||
(which-key-add-key-based-replacements "C-c a" "LSP")
|
(which-key-add-key-based-replacements "C-c a" "LSP")
|
||||||
(which-key-add-key-based-replacements "C-c c" "code")
|
(which-key-add-key-based-replacements "C-c b" "beframe")
|
||||||
(which-key-add-key-based-replacements "C-c c" "code")
|
(which-key-add-key-based-replacements "C-c c" "code")
|
||||||
(which-key-add-key-based-replacements "C-c n" "org")
|
(which-key-add-key-based-replacements "C-c n" "org")
|
||||||
(which-key-add-key-based-replacements "C-c l" "llm")
|
(which-key-add-key-based-replacements "C-c l" "llm")
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
|
|
||||||
;; Fast search tool `ripgrep'
|
;; Fast search tool `ripgrep'
|
||||||
(use-package rg
|
(use-package rg
|
||||||
:hook (elpaca-after-init . rg-enable-default-bindings)
|
:hook (after-init . rg-enable-default-bindings)
|
||||||
:bind (:map rg-global-map
|
:bind (:map rg-global-map
|
||||||
("c" . rg-dwim-current-dir)
|
("c" . rg-dwim-current-dir)
|
||||||
("f" . rg-dwim-current-file)
|
("f" . rg-dwim-current-file)
|
||||||
@@ -57,16 +57,16 @@
|
|||||||
:init (setq rg-show-columns t)
|
:init (setq rg-show-columns t)
|
||||||
:config (add-to-list 'rg-custom-type-aliases '("tmpl" . "*.tmpl")))
|
:config (add-to-list 'rg-custom-type-aliases '("tmpl" . "*.tmpl")))
|
||||||
|
|
||||||
(use-package pdf-tools
|
;; (use-package pdf-tools
|
||||||
:config
|
;; :config
|
||||||
(pdf-tools-install))
|
;; (pdf-tools-install))
|
||||||
|
|
||||||
(use-package saveplace-pdf-view
|
;; (use-package saveplace-pdf-view
|
||||||
:after pdf-tools
|
;; :after pdf-tools
|
||||||
:demand t)
|
;; :demand t)
|
||||||
|
|
||||||
;; (use-package keycast
|
;; (use-package keycast
|
||||||
;; :hook (elpaca-after-init . keycast-mode-line-mode)
|
;; :hook (after-init . keycast-mode-line-mode)
|
||||||
;; :config
|
;; :config
|
||||||
;; (setq keycast-mode-line-remove-tail-elements nil))
|
;; (setq keycast-mode-line-remove-tail-elements nil))
|
||||||
|
|
||||||
|
|||||||
@@ -9,20 +9,22 @@
|
|||||||
(magit-diff-refine-hunk t)
|
(magit-diff-refine-hunk t)
|
||||||
(git-commit-major-mode 'git-commit-elisp-text-mode)
|
(git-commit-major-mode 'git-commit-elisp-text-mode)
|
||||||
:config
|
:config
|
||||||
|
(elemacs-load-packages-incrementally '(dash f s with-editor eieio transient git-commit))
|
||||||
(setq magit-show-long-lines-warning nil))
|
(setq magit-show-long-lines-warning nil))
|
||||||
|
|
||||||
;; Prime cache before Magit refresh
|
;; Prime cache before Magit refresh
|
||||||
(use-package magit-prime
|
(use-package magit-prime
|
||||||
:diminish
|
:diminish
|
||||||
:hook elpaca-after-init)
|
:config
|
||||||
|
(magit-prime-mode))
|
||||||
|
|
||||||
;; Show TODOs in Magit
|
;; Show TODOs in Magit
|
||||||
(use-package magit-todos
|
(use-package magit-todos
|
||||||
:after magit-status
|
:after magit-status
|
||||||
|
:hook magit
|
||||||
:commands magit-todos-mode
|
:commands magit-todos-mode
|
||||||
:init
|
:init
|
||||||
(setq magit-todos-nice (if (executable-find "nice") t nil))
|
(setq magit-todos-nice (if (executable-find "nice") t nil)))
|
||||||
(magit-todos-mode 1))
|
|
||||||
|
|
||||||
;; Walk through git revisions of a file
|
;; Walk through git revisions of a file
|
||||||
(use-package git-timemachine
|
(use-package git-timemachine
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
(use-package winner
|
(use-package winner
|
||||||
:ensure nil
|
:ensure nil
|
||||||
:commands (winner-undo winner-redo)
|
:commands (winner-undo winner-redo)
|
||||||
:hook elpaca-after-init
|
:hook after-init
|
||||||
:init (setq winner-boring-buffers '("*Completions*"
|
:init (setq winner-boring-buffers '("*Completions*"
|
||||||
"*Compile-Log*"
|
"*Compile-Log*"
|
||||||
"*inferior-lisp*"
|
"*inferior-lisp*"
|
||||||
@@ -40,6 +40,8 @@
|
|||||||
:hook (emacs-startup . ace-window-display-mode)
|
:hook (emacs-startup . ace-window-display-mode)
|
||||||
:bind (([remap other-window] . ace-window)
|
:bind (([remap other-window] . ace-window)
|
||||||
("C-c w" . ace-window-hydra/body))
|
("C-c w" . ace-window-hydra/body))
|
||||||
|
:custom
|
||||||
|
(aw-scope 'frame)
|
||||||
:pretty-hydra
|
:pretty-hydra
|
||||||
(("Actions"
|
(("Actions"
|
||||||
(("TAB" other-window "switch")
|
(("TAB" other-window "switch")
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
;; (use-package project)
|
;; (use-package project)
|
||||||
(use-package projectile
|
(use-package projectile
|
||||||
:hook elpaca-after-init
|
:hook after-init
|
||||||
:config
|
:config
|
||||||
;; Recommended keymap prefix on macOS
|
;; Recommended keymap prefix on macOS
|
||||||
(define-key projectile-mode-map (kbd "s-p") 'projectile-command-map)
|
(define-key projectile-mode-map (kbd "s-p") 'projectile-command-map)
|
||||||
@@ -18,45 +18,43 @@
|
|||||||
(unless (eq ibuffer-sorting-mode 'alphabetic)
|
(unless (eq ibuffer-sorting-mode 'alphabetic)
|
||||||
(ibuffer-do-sort-by-alphabetic)))))
|
(ibuffer-do-sort-by-alphabetic)))))
|
||||||
|
|
||||||
(use-package consult-projectile
|
;; (use-package consult-projectile
|
||||||
:bind (([remap projectile-find-file] . consult-projectile-find-file)
|
;; :bind (([remap projectile-find-file] . consult-projectile-find-file)
|
||||||
([remap projectile-recentf] . consult-projectile-recentf)
|
;; ([remap projectile-recentf] . consult-projectile-recentf)
|
||||||
([remap projectile-switch-project] . consult-projectile-switch-project)
|
;; ([remap projectile-switch-project] . consult-projectile-switch-project)
|
||||||
([remap projectile-switch-to-buffer] . consult-projectile-switch-to-buffer)
|
;; ([remap projectile-switch-to-buffer] . consult-projectile-switch-to-buffer)
|
||||||
([remap projectile-find-dir] . consult-projectile-find-dir)))
|
;; ([remap projectile-find-dir] . consult-projectile-find-dir)))
|
||||||
|
|
||||||
(global-set-key (kbd "C-x C-b") #'ibuffer)
|
(global-set-key (kbd "C-x C-b") #'ibuffer)
|
||||||
|
|
||||||
(use-package eyebrowse
|
(use-package beframe
|
||||||
:hook elpaca-after-init
|
:hook after-init
|
||||||
:custom
|
:bind ("C-x f" . other-frame-prefix)
|
||||||
(eyebrowse-new-workspace t)
|
|
||||||
:bind (("s-1" . eyebrowse-switch-to-window-config-1)
|
|
||||||
("s-2" . eyebrowse-switch-to-window-config-2)
|
|
||||||
("s-3" . eyebrowse-switch-to-window-config-3)
|
|
||||||
("s-4" . eyebrowse-switch-to-window-config-4)
|
|
||||||
("s-5" . eyebrowse-switch-to-window-config-5)
|
|
||||||
("s-6" . eyebrowse-switch-to-window-config-6)
|
|
||||||
("s-7" . eyebrowse-switch-to-window-config-7)
|
|
||||||
("s-8" . eyebrowse-switch-to-window-config-8)))
|
|
||||||
|
|
||||||
(use-package easysession
|
|
||||||
:diminish
|
|
||||||
:demand t
|
|
||||||
:bind (("C-c C-s l" . easysession-switch-to)
|
|
||||||
("C-c C-s L" . easysession-switch-to-and-restore-geometry)
|
|
||||||
("C-c C-s s" . easysession-save)
|
|
||||||
("C-c C-s r" . easysession-rename)
|
|
||||||
("C-c C-s R" . easysession-reset)
|
|
||||||
("C-c C-s u" . easysession-unload)
|
|
||||||
("C-c C-s d" . easysession-delete))
|
|
||||||
:custom
|
|
||||||
(easysession-switch-to-save-session t)
|
|
||||||
(easysession-switch-to-exclude-current nil)
|
|
||||||
:config
|
:config
|
||||||
(setq easysession-setup-load-session t)
|
(define-key global-map (kbd "C-c b") #'beframe-prefix-map)
|
||||||
(easysession-setup)
|
(setq beframe-functions-in-frames '(projectile-switch-project)
|
||||||
(easysession-magit-mode)
|
beframe-rename-function #'ignore
|
||||||
(easysession-scratch-mode))
|
beframe-global-buffers '("*scratch*" "*Messages*" "*Backtrace*"))
|
||||||
|
(use-package embark
|
||||||
|
:defer
|
||||||
|
:config
|
||||||
|
(define-key embark-buffer-map (kbd "fu")
|
||||||
|
(defun my/beframe-unassume-buffer (buf)
|
||||||
|
(interactive "bUnassume: ")
|
||||||
|
(beframe--unassume
|
||||||
|
(list (get-buffer buf)))))
|
||||||
|
(define-key embark-buffer-map (kbd "fa")
|
||||||
|
(defun my/beframe-assume-buffer (buf)
|
||||||
|
(interactive "bAssume: ")
|
||||||
|
(beframe--assume
|
||||||
|
(list (get-buffer buf))))))
|
||||||
|
|
||||||
|
(with-eval-after-load 'consult
|
||||||
|
(defun consult-beframe-buffer-list (&optional frame)
|
||||||
|
"Return the list of buffers from `beframe-buffer-names' sorted by visibility.
|
||||||
|
With optional argument FRAME, return the list of buffers of FRAME."
|
||||||
|
(beframe-buffer-list frame :sort #'beframe-buffer-sort-visibility))
|
||||||
|
|
||||||
|
(setq consult-buffer-list-function #'consult-beframe-buffer-list)))
|
||||||
|
|
||||||
(provide 'init-workspace)
|
(provide 'init-workspace)
|
||||||
|
|||||||
@@ -1,236 +0,0 @@
|
|||||||
;; -*- lexical-binding: t; -*-
|
|
||||||
|
|
||||||
(setq modus-themes-operandi-colors-override
|
|
||||||
'((bg-main "#fff0f2")
|
|
||||||
(bg-dim "#fbe6ef")
|
|
||||||
(bg-alt "#f5dae6")
|
|
||||||
(bg-hl-line "#fad8e3")
|
|
||||||
(bg-active "#efcadf")
|
|
||||||
(bg-inactive "#f3ddef")
|
|
||||||
(bg-active-accent "#ffbbef")
|
|
||||||
(bg-region "#dfc5d1")
|
|
||||||
(bg-region-accent "#efbfef")
|
|
||||||
(bg-region-accent-subtle "#ffd6ef")
|
|
||||||
(bg-header "#edd3e0")
|
|
||||||
(bg-tab-active "#ffeff2")
|
|
||||||
(bg-tab-inactive "#f8d3ef")
|
|
||||||
(bg-tab-inactive-accent "#ffd9f5")
|
|
||||||
(bg-tab-inactive-alt "#e5c0d5")
|
|
||||||
(bg-tab-inactive-alt-accent "#f3cce0")
|
|
||||||
(fg-main "#543f78")
|
|
||||||
(fg-dim "#5f476f")
|
|
||||||
(fg-alt "#7f6f99")
|
|
||||||
(fg-unfocused "#8f6f9f")
|
|
||||||
(fg-active "#563068")
|
|
||||||
(fg-inactive "#8a5698")
|
|
||||||
(fg-docstring "#5f5fa7")
|
|
||||||
(fg-comment-yellow "#a9534f")
|
|
||||||
(fg-escape-char-construct "#8b207f")
|
|
||||||
(fg-escape-char-backslash "#a06d00")
|
|
||||||
(bg-special-cold "#d3e0f4")
|
|
||||||
(bg-special-faint-cold "#e0efff")
|
|
||||||
(bg-special-mild "#c4ede0")
|
|
||||||
(bg-special-faint-mild "#e0f0ea")
|
|
||||||
(bg-special-warm "#efd0c4")
|
|
||||||
(bg-special-faint-warm "#ffe4da")
|
|
||||||
(bg-special-calm "#f0d3ea")
|
|
||||||
(bg-special-faint-calm "#fadff9")
|
|
||||||
(fg-special-cold "#405fb8")
|
|
||||||
(fg-special-mild "#407f74")
|
|
||||||
(fg-special-warm "#9d6f4f")
|
|
||||||
(fg-special-calm "#af509f")
|
|
||||||
(bg-completion "#ffc5e5")
|
|
||||||
(bg-completion-subtle "#f7cfef")
|
|
||||||
(red "#ed2f44")
|
|
||||||
(red-alt "#e0403d")
|
|
||||||
(red-alt-other "#e04059")
|
|
||||||
(red-faint "#ed4f44")
|
|
||||||
(red-alt-faint "#e0603d")
|
|
||||||
(red-alt-other-faint "#e06059")
|
|
||||||
(green "#217a3c")
|
|
||||||
(green-alt "#417a1c")
|
|
||||||
(green-alt-other "#006f3c")
|
|
||||||
(green-faint "#318a4c")
|
|
||||||
(green-alt-faint "#518a2c")
|
|
||||||
(green-alt-other-faint "#20885c")
|
|
||||||
(yellow "#b06202")
|
|
||||||
(yellow-alt "#a95642")
|
|
||||||
(yellow-alt-other "#a06f42")
|
|
||||||
(yellow-faint "#b07232")
|
|
||||||
(yellow-alt-faint "#a96642")
|
|
||||||
(yellow-alt-other-faint "#a08042")
|
|
||||||
(blue "#275ccf")
|
|
||||||
(blue-alt "#475cc0")
|
|
||||||
(blue-alt-other "#3340ef")
|
|
||||||
(blue-faint "#476ce0")
|
|
||||||
(blue-alt-faint "#575ccf")
|
|
||||||
(blue-alt-other-faint "#3f60d7")
|
|
||||||
(magenta "#bf317f")
|
|
||||||
(magenta-alt "#d033c0")
|
|
||||||
(magenta-alt-other "#844fe4")
|
|
||||||
(magenta-faint "#bf517f")
|
|
||||||
(magenta-alt-faint "#d053c0")
|
|
||||||
(magenta-alt-other-faint "#846fe4")
|
|
||||||
(cyan "#007a9f")
|
|
||||||
(cyan-alt "#3f709f")
|
|
||||||
(cyan-alt-other "#107f7f")
|
|
||||||
(cyan-faint "#108aaf")
|
|
||||||
(cyan-alt-faint "#3f80af")
|
|
||||||
(cyan-alt-other-faint "#3088af")
|
|
||||||
(red-active "#cd2f44")
|
|
||||||
(green-active "#116a6c")
|
|
||||||
(yellow-active "#993602")
|
|
||||||
(blue-active "#475ccf")
|
|
||||||
(magenta-active "#7f2ccf")
|
|
||||||
(cyan-active "#007a8f")
|
|
||||||
(red-nuanced-bg "#ffdbd0")
|
|
||||||
(red-nuanced-fg "#ed6f74")
|
|
||||||
(green-nuanced-bg "#dcf0dd")
|
|
||||||
(green-nuanced-fg "#3f9a4c")
|
|
||||||
(yellow-nuanced-bg "#fff3aa")
|
|
||||||
(yellow-nuanced-fg "#b47232")
|
|
||||||
(blue-nuanced-bg "#e3e3ff")
|
|
||||||
(blue-nuanced-fg "#201f6f")
|
|
||||||
(magenta-nuanced-bg "#fdd0ff")
|
|
||||||
(magenta-nuanced-fg "#c0527f")
|
|
||||||
(cyan-nuanced-bg "#dbefff")
|
|
||||||
(cyan-nuanced-fg "#0f3f60")
|
|
||||||
(bg-diff-heading "#b7cfe0")
|
|
||||||
(fg-diff-heading "#041645")
|
|
||||||
(bg-diff-added "#d6f0d6")
|
|
||||||
(fg-diff-added "#004520")
|
|
||||||
(bg-diff-changed "#fcefcf")
|
|
||||||
(fg-diff-changed "#524200")
|
|
||||||
(bg-diff-removed "#ffe0ef")
|
|
||||||
(fg-diff-removed "#891626")
|
|
||||||
(bg-diff-refine-added "#84cfa4")
|
|
||||||
(fg-diff-refine-added "#002a00")
|
|
||||||
(bg-diff-refine-changed "#cccf8f")
|
|
||||||
(fg-diff-refine-changed "#302010")
|
|
||||||
(bg-diff-refine-removed "#da92b0")
|
|
||||||
(fg-diff-refine-removed "#500010")
|
|
||||||
(bg-diff-focus-added "#a6e5c6")
|
|
||||||
(fg-diff-focus-added "#002c00")
|
|
||||||
(bg-diff-focus-changed "#ecdfbf")
|
|
||||||
(fg-diff-focus-changed "#392900")
|
|
||||||
(bg-diff-focus-removed "#efbbcf")
|
|
||||||
(fg-diff-focus-removed "#5a0010"))
|
|
||||||
modus-themes-vivendi-color-overrides
|
|
||||||
'((bg-main "#25152a")
|
|
||||||
(bg-dim "#2a1930")
|
|
||||||
(bg-alt "#382443")
|
|
||||||
(bg-hl-line "#332650")
|
|
||||||
(bg-active "#463358")
|
|
||||||
(bg-inactive "#2d1f3a")
|
|
||||||
(bg-active-accent "#50308f")
|
|
||||||
(bg-region "#5d4a67")
|
|
||||||
(bg-region-accent "#60509f")
|
|
||||||
(bg-region-accent-subtle "#3f285f")
|
|
||||||
(bg-header "#3a2543")
|
|
||||||
(bg-tab-active "#26162f")
|
|
||||||
(bg-tab-inactive "#362647")
|
|
||||||
(bg-tab-inactive-accent "#36265a")
|
|
||||||
(bg-tab-inactive-alt "#3e2f5a")
|
|
||||||
(bg-tab-inactive-alt-accent "#3e2f6f")
|
|
||||||
(fg-main "#debfe0")
|
|
||||||
(fg-dim "#d0b0da")
|
|
||||||
(fg-alt "#ae85af")
|
|
||||||
(fg-unfocused "#8e7f9f")
|
|
||||||
(fg-active "#cfbfef")
|
|
||||||
(fg-inactive "#b0a0c0")
|
|
||||||
(fg-docstring "#c8d9f7")
|
|
||||||
(fg-comment-yellow "#cf9a70")
|
|
||||||
(fg-escape-char-construct "#ff75aa")
|
|
||||||
(fg-escape-char-backslash "#dbab40")
|
|
||||||
(bg-special-cold "#2a3f58")
|
|
||||||
(bg-special-faint-cold "#1e283f")
|
|
||||||
(bg-special-mild "#0f3f31")
|
|
||||||
(bg-special-faint-mild "#0f281f")
|
|
||||||
(bg-special-warm "#44331f")
|
|
||||||
(bg-special-faint-warm "#372213")
|
|
||||||
(bg-special-calm "#4a314f")
|
|
||||||
(bg-special-faint-calm "#3a223f")
|
|
||||||
(fg-special-cold "#c0b0ff")
|
|
||||||
(fg-special-mild "#bfe0cf")
|
|
||||||
(fg-special-warm "#edc0a6")
|
|
||||||
(fg-special-calm "#ff9fdf")
|
|
||||||
(bg-completion "#502d70")
|
|
||||||
(bg-completion-subtle "#451d65")
|
|
||||||
(red "#ff5f6f")
|
|
||||||
(red-alt "#ff8f6d")
|
|
||||||
(red-alt-other "#ff6f9d")
|
|
||||||
(red-faint "#ffa0a0")
|
|
||||||
(red-alt-faint "#f5aa80")
|
|
||||||
(red-alt-other-faint "#ff9fbf")
|
|
||||||
(green "#51ca5c")
|
|
||||||
(green-alt "#71ca3c")
|
|
||||||
(green-alt-other "#51ca9c")
|
|
||||||
(green-faint "#78bf78")
|
|
||||||
(green-alt-faint "#99b56f")
|
|
||||||
(green-alt-other-faint "#88bf99")
|
|
||||||
(yellow "#f0b262")
|
|
||||||
(yellow-alt "#f0e242")
|
|
||||||
(yellow-alt-other "#d0a272")
|
|
||||||
(yellow-faint "#d2b580")
|
|
||||||
(yellow-alt-faint "#cabf77")
|
|
||||||
(yellow-alt-other-faint "#d0ba95")
|
|
||||||
(blue "#778cff")
|
|
||||||
(blue-alt "#8f90ff")
|
|
||||||
(blue-alt-other "#8380ff")
|
|
||||||
(blue-faint "#82b0ec")
|
|
||||||
(blue-alt-faint "#a0acef")
|
|
||||||
(blue-alt-other-faint "#80b2f0")
|
|
||||||
(magenta "#ff70cf")
|
|
||||||
(magenta-alt "#ff77f0")
|
|
||||||
(magenta-alt-other "#ca7fff")
|
|
||||||
(magenta-faint "#e0b2d6")
|
|
||||||
(magenta-alt-faint "#ef9fe4")
|
|
||||||
(magenta-alt-other-faint "#cfa6ff")
|
|
||||||
(cyan "#30cacf")
|
|
||||||
(cyan-alt "#60caff")
|
|
||||||
(cyan-alt-other "#40b79f")
|
|
||||||
(cyan-faint "#90c4ed")
|
|
||||||
(cyan-alt-faint "#a0bfdf")
|
|
||||||
(cyan-alt-other-faint "#a4d0bb")
|
|
||||||
(red-active "#ff6059")
|
|
||||||
(green-active "#64dc64")
|
|
||||||
(yellow-active "#ffac80")
|
|
||||||
(blue-active "#4fafff")
|
|
||||||
(magenta-active "#cf88ff")
|
|
||||||
(cyan-active "#50d3d0")
|
|
||||||
(red-nuanced-bg "#440a1f")
|
|
||||||
(red-nuanced-fg "#ffcccc")
|
|
||||||
(green-nuanced-bg "#002904")
|
|
||||||
(green-nuanced-fg "#b8e2b8")
|
|
||||||
(yellow-nuanced-bg "#422000")
|
|
||||||
(yellow-nuanced-fg "#dfdfb0")
|
|
||||||
(blue-nuanced-bg "#1f1f5f")
|
|
||||||
(blue-nuanced-fg "#bfd9ff")
|
|
||||||
(magenta-nuanced-bg "#431641")
|
|
||||||
(magenta-nuanced-fg "#e5cfef")
|
|
||||||
(cyan-nuanced-bg "#042f49")
|
|
||||||
(cyan-nuanced-fg "#a8e5e5")
|
|
||||||
(bg-diff-heading "#304466")
|
|
||||||
(fg-diff-heading "#dae7ff")
|
|
||||||
(bg-diff-added "#0a383a")
|
|
||||||
(fg-diff-added "#94ba94")
|
|
||||||
(bg-diff-changed "#2a2000")
|
|
||||||
(fg-diff-changed "#b0ba9f")
|
|
||||||
(bg-diff-removed "#50163f")
|
|
||||||
(fg-diff-removed "#c6adaa")
|
|
||||||
(bg-diff-refine-added "#006a46")
|
|
||||||
(fg-diff-refine-added "#e0f6e0")
|
|
||||||
(bg-diff-refine-changed "#585800")
|
|
||||||
(fg-diff-refine-changed "#ffffcc")
|
|
||||||
(bg-diff-refine-removed "#952838")
|
|
||||||
(fg-diff-refine-removed "#ffd9eb")
|
|
||||||
(bg-diff-focus-added "#1d4c3f")
|
|
||||||
(fg-diff-focus-added "#b4dfb4")
|
|
||||||
(bg-diff-focus-changed "#424200")
|
|
||||||
(fg-diff-focus-changed "#d0daaf")
|
|
||||||
(bg-diff-focus-removed "#6f0f39")
|
|
||||||
(fg-diff-focus-removed "#eebdba")))
|
|
||||||
|
|
||||||
(provide 'modus-summer-time)
|
|
||||||
|
|
||||||
;;
|
|
||||||
@@ -1,192 +0,0 @@
|
|||||||
;;; persp-mode-project-bridge.el --- Integration of persp-mode + project.el -*- lexical-binding: t -*-
|
|
||||||
|
|
||||||
;; Copyright (C) 2017 Constantin Kulikov
|
|
||||||
;; Copyright (C) 2021 Siavash Askari Nasr
|
|
||||||
;;
|
|
||||||
;; Author: Constantin Kulikov (Bad_ptr) <zxnotdead@gmail.com>
|
|
||||||
;; Siavash Askari Nasr <siavash.askari.nasr@gmail.com>
|
|
||||||
;; Maintainer: Siavash Askari Nasr <siavash.askari.nasr@gmail.com>
|
|
||||||
;; Version: 0.1
|
|
||||||
;; Package-Requires: ((emacs "27.1") (persp-mode "2.9"))
|
|
||||||
;; SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
;; Keywords: vc, persp-mode, perspective, project, project.el
|
|
||||||
;; URL: https://github.com/CIAvash/persp-mode-project-bridge
|
|
||||||
|
|
||||||
;;; License:
|
|
||||||
|
|
||||||
;; This file is not part of GNU Emacs.
|
|
||||||
|
|
||||||
;; This program is free software; you can redistribute it and/or modify
|
|
||||||
;; it under the terms of the GNU General Public License as published by
|
|
||||||
;; the Free Software Foundation, either version 3, or (at your option)
|
|
||||||
;; any later version.
|
|
||||||
;;
|
|
||||||
;; This program is distributed in the hope that it will be useful,
|
|
||||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
;; GNU General Public License for more details.
|
|
||||||
;;
|
|
||||||
;; You should have received a copy of the GNU General Public License
|
|
||||||
;; along with this program; if not, write to the Free Software
|
|
||||||
;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
|
|
||||||
;;; Commentary:
|
|
||||||
|
|
||||||
;; Creates a perspective for each project.el project. (Based on the persp-mode-projectile-bridge)
|
|
||||||
|
|
||||||
;;; Usage:
|
|
||||||
|
|
||||||
;; Installation:
|
|
||||||
|
|
||||||
;; M-x package-install-file RET persp-mode-project-bridge RET
|
|
||||||
|
|
||||||
;; Example configuration:
|
|
||||||
|
|
||||||
;; (with-eval-after-load "persp-mode-project-bridge-autoloads"
|
|
||||||
;; (add-hook 'persp-mode-project-bridge-mode-hook
|
|
||||||
;; (lambda ()
|
|
||||||
;; (if persp-mode-project-bridge-mode
|
|
||||||
;; (persp-mode-project-bridge-find-perspectives-for-all-buffers)
|
|
||||||
;; (persp-mode-project-bridge-kill-perspectives))))
|
|
||||||
;; (add-hook 'after-init-hook
|
|
||||||
;; (lambda ()
|
|
||||||
;; (persp-mode-project-bridge-mode 1))
|
|
||||||
;; t))
|
|
||||||
;;
|
|
||||||
;; With use-package:
|
|
||||||
;; (use-package persp-mode-project-bridge
|
|
||||||
;; :hook
|
|
||||||
;; (persp-mode-project-bridge-mode . (lambda ()
|
|
||||||
;; (if persp-mode-project-bridge-mode
|
|
||||||
;; (persp-mode-project-bridge-find-perspectives-for-all-buffers)
|
|
||||||
;; (persp-mode-project-bridge-kill-perspectives))))
|
|
||||||
;; (persp-mode . persp-mode-project-bridge-mode))
|
|
||||||
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
|
|
||||||
(require 'persp-mode)
|
|
||||||
(require 'project)
|
|
||||||
(require 'cl-lib)
|
|
||||||
|
|
||||||
(declare-function project-root "project")
|
|
||||||
|
|
||||||
(defvar persp-mode-project-bridge-mode nil)
|
|
||||||
|
|
||||||
(defgroup persp-mode-project-bridge nil
|
|
||||||
"persp-mode project.el integration."
|
|
||||||
:group 'persp-mode
|
|
||||||
:group 'project
|
|
||||||
:prefix "persp-mode-project-bridge-"
|
|
||||||
:link
|
|
||||||
'(url-link
|
|
||||||
:tag "Github" "https://github.com/CIAvash/persp-mode-project-bridge"))
|
|
||||||
|
|
||||||
(defcustom persp-mode-project-bridge-persp-name-prefix "[p] "
|
|
||||||
"Prefix to use for project perspective names."
|
|
||||||
:group 'persp-mode-project-bridge
|
|
||||||
:type 'string
|
|
||||||
:set (lambda (sym val)
|
|
||||||
(if persp-mode-project-bridge-mode
|
|
||||||
(let ((old-prefix (symbol-value sym)))
|
|
||||||
(custom-set-default sym val)
|
|
||||||
(let (old-name)
|
|
||||||
(mapc (lambda (p)
|
|
||||||
(when (and
|
|
||||||
p (persp-parameter
|
|
||||||
'persp-mode-project-bridge p))
|
|
||||||
(setq old-name
|
|
||||||
(substring (persp-name p)
|
|
||||||
(string-width old-prefix)))
|
|
||||||
(persp-rename (concat val old-name) p)))
|
|
||||||
(persp-persps))))
|
|
||||||
(custom-set-default sym val))))
|
|
||||||
|
|
||||||
|
|
||||||
(defun persp-mode-project-bridge-add-new-persp (name)
|
|
||||||
"Create a new perspective NAME."
|
|
||||||
(let ((persp (persp-get-by-name name *persp-hash* :nil)))
|
|
||||||
(if (eq :nil persp)
|
|
||||||
(prog1
|
|
||||||
(setq persp (persp-add-new name))
|
|
||||||
(when persp
|
|
||||||
(set-persp-parameter 'persp-mode-project-bridge t persp)
|
|
||||||
(set-persp-parameter 'dont-save-to-file t persp)
|
|
||||||
(persp-add-buffer (cl-remove-if-not #'get-file-buffer (project-files (project-current)))
|
|
||||||
persp nil nil)))
|
|
||||||
persp)))
|
|
||||||
|
|
||||||
(defun persp-mode-project-bridge-find-perspective-for-buffer (b)
|
|
||||||
"Find a perspective for buffer B."
|
|
||||||
(when (buffer-live-p b)
|
|
||||||
(with-current-buffer b
|
|
||||||
(when (and persp-mode-project-bridge-mode
|
|
||||||
(buffer-name b) (project-current))
|
|
||||||
(let ((persp (persp-mode-project-bridge-add-new-persp
|
|
||||||
(concat persp-mode-project-bridge-persp-name-prefix
|
|
||||||
(file-name-nondirectory
|
|
||||||
(directory-file-name
|
|
||||||
(if (fboundp 'project-root)
|
|
||||||
(project-root (project-current))
|
|
||||||
(car (project-roots (project-current))))))))))
|
|
||||||
(when persp
|
|
||||||
(persp-add-buffer b persp nil nil)
|
|
||||||
persp))))))
|
|
||||||
|
|
||||||
(defun persp-mode-project-bridge-hook-switch (&rest _args)
|
|
||||||
"Switch to a perspective when hook is activated."
|
|
||||||
(let ((persp
|
|
||||||
(persp-mode-project-bridge-find-perspective-for-buffer
|
|
||||||
(current-buffer))))
|
|
||||||
(when persp
|
|
||||||
(persp-frame-switch (persp-name persp)))))
|
|
||||||
|
|
||||||
(defun persp-mode-project-bridge-find-perspectives-for-all-buffers ()
|
|
||||||
"Find perspectives for all buffers."
|
|
||||||
(when persp-mode-project-bridge-mode
|
|
||||||
(mapc #'persp-mode-project-bridge-find-perspective-for-buffer
|
|
||||||
(buffer-list))))
|
|
||||||
|
|
||||||
(defun persp-mode-project-bridge-kill-perspectives ()
|
|
||||||
"Kill all bridge perspectives."
|
|
||||||
(when persp-mode
|
|
||||||
(mapc #'persp-kill
|
|
||||||
(mapcar #'persp-name
|
|
||||||
(cl-delete-if-not
|
|
||||||
(apply-partially
|
|
||||||
#'persp-parameter
|
|
||||||
'persp-mode-project-bridge)
|
|
||||||
(persp-persps))))))
|
|
||||||
|
|
||||||
(defvar persp-mode-project-bridge-switch-hooks
|
|
||||||
(list 'find-file-hook 'dired-mode-hook 'vc-dir-mode-hook 'eshell-mode-hook))
|
|
||||||
|
|
||||||
;;;###autoload
|
|
||||||
(define-minor-mode persp-mode-project-bridge-mode
|
|
||||||
"`persp-mode' and `project.el' integration.
|
|
||||||
Creates perspectives for project.el projects."
|
|
||||||
:require 'persp-mode-project-bridge
|
|
||||||
:group 'persp-mode-project-bridge
|
|
||||||
:init-value nil
|
|
||||||
:global t
|
|
||||||
|
|
||||||
(if persp-mode-project-bridge-mode
|
|
||||||
(if persp-mode
|
|
||||||
(progn
|
|
||||||
;; Add hooks
|
|
||||||
(add-hook 'persp-mode-hook
|
|
||||||
(lambda ()
|
|
||||||
(unless persp-mode
|
|
||||||
(persp-mode-project-bridge-mode -1))))
|
|
||||||
(dolist (hook persp-mode-project-bridge-switch-hooks)
|
|
||||||
(add-hook hook #'persp-mode-project-bridge-hook-switch)))
|
|
||||||
(message "You can not enable persp-mode-project-bridge-mode \
|
|
||||||
unless persp-mode is active.")
|
|
||||||
(setq persp-mode-project-bridge-mode nil))
|
|
||||||
;; Remove hooks
|
|
||||||
(dolist (hook persp-mode-project-bridge-switch-hooks)
|
|
||||||
(remove-hook hook #'persp-mode-project-bridge-hook-switch))))
|
|
||||||
|
|
||||||
(provide 'persp-mode-project-bridge)
|
|
||||||
|
|
||||||
;;; persp-mode-project-bridge.el ends here
|
|
||||||
@@ -1,432 +0,0 @@
|
|||||||
;;; texpresso.el --- Render and synchronize buffers with TeXpresso -*- lexical-binding: t; -*-
|
|
||||||
;;
|
|
||||||
;; Copyright (C) 2023 Frédéric Bour
|
|
||||||
;; Hello world
|
|
||||||
;; Author: Frédéric Bour <frederic.bour@lakaban.net>
|
|
||||||
;; Maintainer: Frédéric Bour <frederic.bour@lakaban.net>
|
|
||||||
;; Created: March 25, 2023
|
|
||||||
;; Modified: March 25, 2023
|
|
||||||
;; Version: 0.0.1
|
|
||||||
;; Keywords: lisp local processes tex tools unix
|
|
||||||
;; Homepage: https://github.com/def/sync
|
|
||||||
;; Package-Requires: ((emacs "25.1"))
|
|
||||||
;;
|
|
||||||
;; This file is not part of GNU Emacs.
|
|
||||||
;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;
|
|
||||||
;; TeXpresso is a tool to recompute LaTeX documents and error log interactively.
|
|
||||||
;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
;; Customizable variables
|
|
||||||
|
|
||||||
(defcustom texpresso-binary nil
|
|
||||||
"Path of TeXpresso binary."
|
|
||||||
:group 'tex
|
|
||||||
:risky t
|
|
||||||
:type '(choice (file :tag "Path")
|
|
||||||
(const :tag "Auto" nil)))
|
|
||||||
|
|
||||||
(defcustom texpresso-follow-edition nil
|
|
||||||
"If true, TeXpresso scrolls the view to the code being edited."
|
|
||||||
:group 'tex
|
|
||||||
:type 'boolean)
|
|
||||||
|
|
||||||
(defcustom texpresso-follow-cursor nil
|
|
||||||
"If true, TeXpresso scrolls the view to the cursor."
|
|
||||||
:group 'tex
|
|
||||||
:type 'boolean)
|
|
||||||
|
|
||||||
;; Main code
|
|
||||||
|
|
||||||
(defvar texpresso--process nil
|
|
||||||
"The running instance of TeXpresso as an Emacs process object, or nil.
|
|
||||||
|
|
||||||
`texpresso--process' is the latest process launched, it might be dead.
|
|
||||||
|
|
||||||
The process is also guaranteed to have a property named `'marker` that is
|
|
||||||
updated when synchronization state is reset.
|
|
||||||
When a buffer is synchronized with a process, it keeps a reference to the marker
|
|
||||||
object of that process. To check if incremental synchronization is possible, the
|
|
||||||
marker objects are compared for physical equality.
|
|
||||||
\(In practice they are `(cons nil nil)` objects, though their structural value is
|
|
||||||
not used anywhere.\)")
|
|
||||||
|
|
||||||
(defun texpresso--send (&rest value)
|
|
||||||
"Send VALUE as a serialized s-expression to `texpresso--process'."
|
|
||||||
(setq value (prin1-to-string value))
|
|
||||||
; (with-current-buffer (get-buffer-create "*texpresso-log*")
|
|
||||||
; (let ((inhibit-read-only t))
|
|
||||||
; (insert value)
|
|
||||||
; (insert "\n")))
|
|
||||||
(process-send-string texpresso--process value))
|
|
||||||
|
|
||||||
(defvar-local texpresso--state nil
|
|
||||||
"Internal synchronization state for current buffer.
|
|
||||||
The state is either nil (buffer not yet synchronized) or a list
|
|
||||||
`(list (buffer-file-name) texpresso--process marker)'.
|
|
||||||
The list is used to detect if, since last synchronization, the filename has
|
|
||||||
changed, the process has changed, or the synchronization state was reset
|
|
||||||
\(new marker\).")
|
|
||||||
|
|
||||||
(defvar-local texpresso--before-change nil
|
|
||||||
"A list (start end txt) saved during the last call to `texpresso--before-change'.
|
|
||||||
TeXpresso changes are expressed using byte offsets.
|
|
||||||
In the `after-change-functions' hook, one can only access the number of
|
|
||||||
characters removed by the change, and since the text has been already removed,
|
|
||||||
it is too late to access the number of bytes. To work around this limitation,
|
|
||||||
the changed region is saved by the `texpresso--before-change' function (a
|
|
||||||
`before-change-functions' hook).")
|
|
||||||
|
|
||||||
(define-minor-mode texpresso-mode
|
|
||||||
"A global minor mode that synchronizes buffer with TeXpresso.
|
|
||||||
Also launches a new TeXpresso process if none is running."
|
|
||||||
:init-value nil ; Initial value, nil for disabled
|
|
||||||
:global nil
|
|
||||||
:group 'tex
|
|
||||||
:lighter " ☕"
|
|
||||||
(if texpresso-mode
|
|
||||||
(progn
|
|
||||||
(message "TeXpresso ☕ enabled")
|
|
||||||
(add-hook 'after-change-functions #'texpresso--after-change)
|
|
||||||
(add-hook 'before-change-functions #'texpresso--before-change)
|
|
||||||
(add-hook 'post-command-hook #'texpresso--post-command))
|
|
||||||
(message "TeXpresso ☕ disabled")
|
|
||||||
(remove-hook 'after-change-functions #'texpresso--after-change)
|
|
||||||
(remove-hook 'before-change-functions #'texpresso--before-change)
|
|
||||||
(remove-hook 'post-command-hook #'texpresso--post-command)))
|
|
||||||
|
|
||||||
(define-minor-mode texpresso-sync-mode
|
|
||||||
"A minor mode that forces a buffer to be synchronized with TeXpresso.
|
|
||||||
Otherwise a buffer is synchronized if its major mode derives from `tex-mode'."
|
|
||||||
:init-value nil ; Initial value, nil for disabled
|
|
||||||
:global nil
|
|
||||||
:group 'tex
|
|
||||||
:lighter " ☕"
|
|
||||||
(setq texpresso--state nil))
|
|
||||||
|
|
||||||
(defvar-local texpresso--output-bound nil)
|
|
||||||
(defvar-local texpresso--output-timer nil)
|
|
||||||
|
|
||||||
(defun texpresso-move-to-cursor (&optional position)
|
|
||||||
"Scroll TeXpresso views to POSITION (or point)."
|
|
||||||
(interactive)
|
|
||||||
(when (texpresso--enabled-p)
|
|
||||||
(texpresso--send 'synctex-forward
|
|
||||||
(buffer-file-name)
|
|
||||||
(line-number-at-pos position t))))
|
|
||||||
|
|
||||||
(defun texpresso--output-truncate (buffer)
|
|
||||||
"Truncate TeXpresso output buffer BUFFER."
|
|
||||||
(with-current-buffer buffer
|
|
||||||
(when texpresso--output-timer
|
|
||||||
(cancel-timer texpresso--output-timer))
|
|
||||||
(when (and texpresso--output-bound
|
|
||||||
(<= texpresso--output-bound (point-max)))
|
|
||||||
(let ((inhibit-read-only t))
|
|
||||||
(delete-region texpresso--output-bound (point-max))))))
|
|
||||||
|
|
||||||
(defun texpresso--output-schedule-truncate (point)
|
|
||||||
"Schedule a truncation of current buffer to POINT.
|
|
||||||
Scheduling allows truncation to not happen too often, slowing down the editor
|
|
||||||
and causing it to flicker."
|
|
||||||
(when texpresso--output-timer
|
|
||||||
(cancel-timer texpresso--output-timer))
|
|
||||||
(setq texpresso--output-bound point)
|
|
||||||
(setq texpresso--output-timer
|
|
||||||
(run-with-timer 1 nil #'texpresso--output-truncate (current-buffer))))
|
|
||||||
|
|
||||||
(defun texpresso--enabled-p ()
|
|
||||||
"Check if TeXpresso is running and enabled for the current buffer."
|
|
||||||
(and (process-live-p texpresso--process)
|
|
||||||
(or texpresso-sync-mode
|
|
||||||
(derived-mode-p 'tex-mode))))
|
|
||||||
|
|
||||||
(defun texpresso--before-change (start end)
|
|
||||||
"A `before-change-functions' hook to update `texpresso--before-change' variable.
|
|
||||||
It records the number of bytes between START and END (the bytes removed)."
|
|
||||||
(when (texpresso--enabled-p)
|
|
||||||
; (message "before change %S %S" start end)
|
|
||||||
(setq texpresso--before-change
|
|
||||||
(list start end (buffer-substring-no-properties start end)))))
|
|
||||||
|
|
||||||
(defun texpresso--after-change (start end removed)
|
|
||||||
"An `after-change-functions' hook to synchronize the buffer with TeXpresso.
|
|
||||||
It instructs `texpresso--process' to replace REMOVED characters by the contents
|
|
||||||
between START and END.
|
|
||||||
Character counts are converted to byte offsets using `texpresso--before-change'."
|
|
||||||
(when (texpresso--enabled-p)
|
|
||||||
; (message "after change %S %S %S" start end removed)
|
|
||||||
(let ((filename (nth 0 texpresso--state))
|
|
||||||
(process (nth 1 texpresso--state))
|
|
||||||
(marker (nth 2 texpresso--state))
|
|
||||||
(bstart (nth 0 texpresso--before-change))
|
|
||||||
(bend (nth 1 texpresso--before-change))
|
|
||||||
(btext (nth 2 texpresso--before-change))
|
|
||||||
same-process)
|
|
||||||
(setq same-process
|
|
||||||
(and (eq filename (buffer-file-name))
|
|
||||||
(eq process texpresso--process)
|
|
||||||
(eq marker (process-get texpresso--process 'marker))))
|
|
||||||
(if (and same-process (<= bstart start (+ start removed) bend))
|
|
||||||
(let ((ofs (- start bstart)))
|
|
||||||
(texpresso--send 'change filename (1- (position-bytes start))
|
|
||||||
(string-bytes (substring btext ofs (+ ofs removed)))
|
|
||||||
(buffer-substring-no-properties start end)))
|
|
||||||
(when same-process
|
|
||||||
(message "TeXpresso: change hooks called with invalid arguments")
|
|
||||||
(message "(before-change %S %S %S)" bstart bend btext)
|
|
||||||
(message "(after-change %S %S %S)" start end removed))
|
|
||||||
(when (process-live-p process)
|
|
||||||
(process-send-string
|
|
||||||
process (prin1-to-string (list 'close filename))))
|
|
||||||
(setq texpresso--state
|
|
||||||
(list (buffer-file-name) texpresso--process
|
|
||||||
(process-get texpresso--process 'marker)))
|
|
||||||
(texpresso--send 'open (buffer-file-name)
|
|
||||||
(buffer-substring-no-properties
|
|
||||||
(point-min) (point-max))))
|
|
||||||
(when texpresso-follow-edition
|
|
||||||
(texpresso--send 'synctex-forward
|
|
||||||
(buffer-file-name)
|
|
||||||
(line-number-at-pos nil t))))))
|
|
||||||
|
|
||||||
(defun texpresso--post-command ()
|
|
||||||
"Function executed on post-command hook.
|
|
||||||
Sends cursor position to TeXpresso if `texpresso-follow-cursor'."
|
|
||||||
(when texpresso-follow-cursor
|
|
||||||
(texpresso-move-to-cursor)))
|
|
||||||
|
|
||||||
(defun texpresso--stderr-filter (process text)
|
|
||||||
"Save debug TEXT from TeXpresso PROCESS in *texpresso-stderr* buffer.
|
|
||||||
The output is truncated to ~50k."
|
|
||||||
(let ((buffer (process-buffer process)))
|
|
||||||
(when buffer
|
|
||||||
(with-current-buffer buffer
|
|
||||||
(save-excursion
|
|
||||||
(when (> (point-max) 49152)
|
|
||||||
(delete-region (point-min) 16384))
|
|
||||||
(goto-char (point-max))
|
|
||||||
(insert text))))))
|
|
||||||
|
|
||||||
(defun texpresso--display-output (buffer)
|
|
||||||
"Display BUFFER in a small window at bottom."
|
|
||||||
(if nil ;(fboundp '+popup/buffer)
|
|
||||||
(with-current-buffer buffer (+popup/buffer))
|
|
||||||
(display-buffer-at-bottom buffer '(nil (allow-no-window . t) (window-height . 0.2)))))
|
|
||||||
|
|
||||||
(defun texpresso--get-output-buffer (name &optional force)
|
|
||||||
"Return the buffer associated to TeXpresso channel NAME.
|
|
||||||
TeXpresso forwards different outputs of TeX process.
|
|
||||||
The standard output is named `'out' and the log file `'log'.
|
|
||||||
If it doesn't exists and FORCE is set, the buffer is created, otherwise nil is
|
|
||||||
returned."
|
|
||||||
(let (fullname buffer)
|
|
||||||
(setq fullname (cond
|
|
||||||
((eq name 'out) "*texpresso-out*")
|
|
||||||
((eq name 'log) "*texpresso-log*")
|
|
||||||
(t (error "TeXpresso: unknown buffer %S" name))))
|
|
||||||
(setq buffer (get-buffer fullname))
|
|
||||||
(when (and (not buffer) force)
|
|
||||||
(setq buffer (get-buffer-create fullname))
|
|
||||||
(with-current-buffer buffer
|
|
||||||
(setq buffer-read-only t
|
|
||||||
buffer-undo-list t)
|
|
||||||
(when (eq name 'out)
|
|
||||||
(compilation-mode)
|
|
||||||
(texpresso--display-output buffer))))
|
|
||||||
buffer))
|
|
||||||
|
|
||||||
(defun texpresso-display-output ()
|
|
||||||
"Open a small window to display TeXpresso output messages."
|
|
||||||
(interactive)
|
|
||||||
(texpresso--display-output (texpresso--get-output-buffer 'out 'force)))
|
|
||||||
|
|
||||||
(defun texpresso--stdout-dispatch (process expr)
|
|
||||||
"Interpret s-expression EXPR sent by TeXpresso PROCESS.
|
|
||||||
TeXpresso communicates with Emacs by writing a sequence of s-expressions on its
|
|
||||||
standard output. This function interprets one of these."
|
|
||||||
(let ((tag (car expr)))
|
|
||||||
(cond
|
|
||||||
((eq tag 'reset-sync)
|
|
||||||
(process-put process 'marker (cons nil nil)))
|
|
||||||
|
|
||||||
((eq tag 'truncate)
|
|
||||||
(let ((buffer (texpresso--get-output-buffer (nth 1 expr))))
|
|
||||||
(when buffer
|
|
||||||
(with-current-buffer buffer
|
|
||||||
(let ((pos (byte-to-position (1+ (nth 2 expr)))))
|
|
||||||
(when pos
|
|
||||||
(texpresso--output-schedule-truncate pos)))))))
|
|
||||||
|
|
||||||
|
|
||||||
((eq tag 'append)
|
|
||||||
(with-current-buffer (texpresso--get-output-buffer (nth 1 expr) 'force)
|
|
||||||
(let ((inhibit-read-only t)
|
|
||||||
(pos (byte-to-position (1+ (nth 2 expr))))
|
|
||||||
(text (nth 3 expr))
|
|
||||||
(window (get-buffer-window))
|
|
||||||
lines endpos)
|
|
||||||
(setq endpos (+ pos (length text)))
|
|
||||||
(unless (and (>= (point-max) endpos)
|
|
||||||
(string= text (buffer-substring pos endpos)))
|
|
||||||
(goto-char pos)
|
|
||||||
(setq lines (line-number-at-pos pos))
|
|
||||||
(insert text)
|
|
||||||
(setq lines (- (line-number-at-pos (point)) lines))
|
|
||||||
(when (> lines 0)
|
|
||||||
(save-excursion
|
|
||||||
(let ((beg (point)))
|
|
||||||
(forward-line lines)
|
|
||||||
(delete-region beg (point)))))
|
|
||||||
(when window (with-selected-window window
|
|
||||||
(goto-char (1- (point-max)))
|
|
||||||
(recenter -1))))
|
|
||||||
(texpresso--output-schedule-truncate endpos))))
|
|
||||||
|
|
||||||
((eq tag 'flush)
|
|
||||||
(dolist (buffer (list (texpresso--get-output-buffer 'out)
|
|
||||||
(texpresso--get-output-buffer 'log)))
|
|
||||||
(when buffer (texpresso--output-truncate buffer))))
|
|
||||||
|
|
||||||
((eq tag 'synctex)
|
|
||||||
(let ((fname (nth 1 expr)) buf)
|
|
||||||
(setq buf (and (file-exists-p fname)
|
|
||||||
(if (string= (buffer-name) "*TeXpresso window*")
|
|
||||||
(find-file-other-window fname)
|
|
||||||
(find-file fname))))
|
|
||||||
(if buf
|
|
||||||
(with-current-buffer buf
|
|
||||||
(goto-char (point-min))
|
|
||||||
(forward-line (1- (nth 2 expr)))
|
|
||||||
(switch-to-buffer buf))
|
|
||||||
(message "TeXpresso: unknown file %s" (nth 1 expr)))))
|
|
||||||
|
|
||||||
(t (message "Unknown message in texpresso output: %S" expr)))))
|
|
||||||
|
|
||||||
(defun texpresso--stdout-filter (process text)
|
|
||||||
"Interpret output of TeXpresso PROCESS.
|
|
||||||
TeXpresso communicates with Emacs by writing a sequence of textual s-expressions
|
|
||||||
on its standard output. This function receives a chunk of this TEXT, parses and
|
|
||||||
forwards the complete ones to `texpresso--stdout-dispatch', and buffers the
|
|
||||||
remainder."
|
|
||||||
(let ((prefix (process-get process 'buffer)))
|
|
||||||
(when prefix (setq text (concat prefix text))))
|
|
||||||
(let ((pos 0))
|
|
||||||
(condition-case nil
|
|
||||||
(while t
|
|
||||||
(let ((result (read-from-string text pos)))
|
|
||||||
(setq pos (cdr result))
|
|
||||||
(condition-case-unless-debug err
|
|
||||||
(texpresso--stdout-dispatch process (car result))
|
|
||||||
(error (message
|
|
||||||
"Error in texpresso--stdout-dispatch: %S\nWhile processing: %S"
|
|
||||||
err (car result))))))
|
|
||||||
((end-of-file)
|
|
||||||
(process-put process 'buffer (substring text pos))))))
|
|
||||||
|
|
||||||
(defun texpresso-reset ()
|
|
||||||
"Invalidate the synchronization state of all buffers."
|
|
||||||
(interactive)
|
|
||||||
(when texpresso--process
|
|
||||||
(process-put texpresso--process 'marker (cons nil nil))))
|
|
||||||
|
|
||||||
(defun texpresso-reset-buffer ()
|
|
||||||
"Invalidate the synchronization state of current buffer."
|
|
||||||
(interactive)
|
|
||||||
(setq texpresso--state nil))
|
|
||||||
|
|
||||||
(defadvice enable-theme (after texpresso--theme-change protect activate)
|
|
||||||
"Tell TeXpresso about new theme colors."
|
|
||||||
(when (process-live-p texpresso--process)
|
|
||||||
(texpresso--send 'theme
|
|
||||||
(color-name-to-rgb (face-attribute 'default :background))
|
|
||||||
(color-name-to-rgb (face-attribute 'default :foreground)))))
|
|
||||||
|
|
||||||
(defun texpresso--make-process (&rest command)
|
|
||||||
"Create and setup a new TeXpresso process with given COMMAND."
|
|
||||||
(when (process-live-p texpresso--process)
|
|
||||||
(kill-process texpresso--process))
|
|
||||||
(let ((texpresso-stderr (get-buffer-create "*texpresso-stderr*")))
|
|
||||||
(with-current-buffer texpresso-stderr (setq buffer-undo-list t))
|
|
||||||
(dolist (buffer (list (texpresso--get-output-buffer 'out 'force)
|
|
||||||
(texpresso--get-output-buffer 'log)))
|
|
||||||
(let ((inhibit-read-only t))
|
|
||||||
(when buffer
|
|
||||||
(with-current-buffer buffer
|
|
||||||
(delete-region (point-min) (point-max))))))
|
|
||||||
(setq texpresso--process
|
|
||||||
(make-process :name "texpresso"
|
|
||||||
:stderr texpresso-stderr
|
|
||||||
:connection-type 'pipe
|
|
||||||
:command command))
|
|
||||||
(set-process-filter (get-buffer-process texpresso-stderr)
|
|
||||||
#'texpresso--stderr-filter)
|
|
||||||
(set-process-filter texpresso--process
|
|
||||||
#'texpresso--stdout-filter)
|
|
||||||
(process-put texpresso--process 'marker (cons nil nil))
|
|
||||||
(texpresso--send 'theme
|
|
||||||
(color-name-to-rgb (face-attribute 'default :background))
|
|
||||||
(color-name-to-rgb (face-attribute 'default :foreground)))))
|
|
||||||
|
|
||||||
(defun texpresso-connect-debugger ()
|
|
||||||
"Create a new TeXpresso process using the debug proxy.
|
|
||||||
Normal TeXpresso processes are started using `texpresso-mode' or
|
|
||||||
`texpresso-restart'. This function is reserved for debugging purposes. It
|
|
||||||
connects to an existing TeXpresso instance launched in a terminal using
|
|
||||||
\"texpresso-debug\" shell command.
|
|
||||||
I came up with this workflow because Emacs (29.0.60 on macOS) bugged
|
|
||||||
when attaching a debugger to a process it launched. More specifically,
|
|
||||||
the bug was that the first interaction was successful, but then Emacs marked the
|
|
||||||
process as exited (in `process-status') and no more contents could be sent to
|
|
||||||
it, even though the process was still sending its stderr to Emacs."
|
|
||||||
(interactive)
|
|
||||||
(texpresso--make-process "texpresso-debug-proxy"))
|
|
||||||
|
|
||||||
(defun texpresso (&optional filename)
|
|
||||||
"Start a new TeXpresso process using FILENAME as the master TeX file.
|
|
||||||
When called interactively with a prefix argument, ask for the file.
|
|
||||||
If FILENAME is nil, use `TeX-master' from AUCTeX or `buffer-file-name'."
|
|
||||||
(interactive "P")
|
|
||||||
(unless texpresso-mode
|
|
||||||
(texpresso-mode 1))
|
|
||||||
|
|
||||||
(let ((tm-fn (when (boundp 'TeX-master)
|
|
||||||
(TeX-master-file t))))
|
|
||||||
(if (or (consp filename) (numberp filename)
|
|
||||||
(and (called-interactively-p) (null filename) (null tm-fn)))
|
|
||||||
;; called interactively with a prefix or default unavailable
|
|
||||||
(setq filename (read-file-name "TeX root file: " nil tm-fn))
|
|
||||||
;; called interactively without prefix or from lisp, fall back
|
|
||||||
(unless filename (setq filename tm-fn)))
|
|
||||||
|
|
||||||
(unless filename (error "TeXpresso: no valid TeX root file available.")))
|
|
||||||
|
|
||||||
(condition-case err
|
|
||||||
(texpresso--make-process (or texpresso-binary "texpresso")
|
|
||||||
(expand-file-name filename))
|
|
||||||
((file-missing)
|
|
||||||
(customize-variable 'texpresso-binary)
|
|
||||||
(message "Cannot launch TeXpresso. Please select the executable file and try again. (error: %S)"
|
|
||||||
(cdr err)))))
|
|
||||||
|
|
||||||
(defun texpresso-signal ()
|
|
||||||
"Tell TeXpresso processes to check filesystem for changed files.
|
|
||||||
This is an alternative, more manual, workflow.
|
|
||||||
During development, it can also be used to hot-reload TeXpresso code."
|
|
||||||
(interactive)
|
|
||||||
(call-process "killall" nil 0 nil "-SIGUSR1" "texpresso"))
|
|
||||||
|
|
||||||
(defun texpresso-previous-page ()
|
|
||||||
"Tell TeXpresso to move to previous page."
|
|
||||||
(interactive)
|
|
||||||
(texpresso--send 'previous-page))
|
|
||||||
|
|
||||||
(defun texpresso-next-page ()
|
|
||||||
"Tell TeXpresso to move to next page."
|
|
||||||
(interactive)
|
|
||||||
(texpresso--send 'next-page))
|
|
||||||
|
|
||||||
(provide 'texpresso)
|
|
||||||
;;; texpresso.el ends here
|
|
||||||
@@ -2,4 +2,8 @@
|
|||||||
# name: provide
|
# name: provide
|
||||||
# key: provide
|
# key: provide
|
||||||
# --
|
# --
|
||||||
|
;; -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
$0
|
||||||
|
|
||||||
(provide '${1:`(file-name-sans-extension (file-name-nondirectory (buffer-file-name)))`})$0
|
(provide '${1:`(file-name-sans-extension (file-name-nondirectory (buffer-file-name)))`})$0
|
||||||
Reference in New Issue
Block a user