Update
This commit is contained in:
@@ -151,7 +151,8 @@ If this is a daemon session, load them all immediately instead."
|
||||
'("\\.?cache" ".cask" "url" "COMMIT_EDITMSG\\'" "bookmarks"
|
||||
"\\.\\(?:gz\\|gif\\|svg\\|png\\|jpe?g\\|bmp\\|xpm\\)$"
|
||||
"\\.?ido\\.last$" "\\.revive$" "/G?TAGS$" "/.elfeed/"
|
||||
"^/tmp/" "^/var/folders/.+$" "^/ssh:" "/persp-confs/"
|
||||
"^/tmp/" "^/var/folders/.+$" "^/ssh:" "^/rpc:" "/persp-confs/"
|
||||
"^/sshx:" "^/sudo:"
|
||||
(lambda (file) (file-in-directory-p file package-user-dir)))
|
||||
recentf-auto-cleanup 'never)
|
||||
:config
|
||||
@@ -267,14 +268,14 @@ If this is a daemon session, load them all immediately instead."
|
||||
;; (setq auto-save-file-name-transforms
|
||||
;; `((".*" ,(concat user-emacs-directory "auto-save/") t)))
|
||||
|
||||
(setq tramp-default-method "rpc")
|
||||
|
||||
(use-package tramp)
|
||||
(use-package tramp
|
||||
:config
|
||||
(setq tramp-default-method "rpc"))
|
||||
|
||||
(use-package tramp-hlo
|
||||
:config
|
||||
(tramp-hlo-setup))
|
||||
:hook (elpaca-after-init . tramp-hlo-setup))
|
||||
|
||||
(use-package msgpack)
|
||||
(use-package tramp-rpc
|
||||
:ensure (tramp-rpc :host github :repo "ArthurHeymans/emacs-tramp-rpc")
|
||||
:config
|
||||
|
||||
@@ -20,13 +20,13 @@
|
||||
;; Display errors a little quicker (default is 0.9s)
|
||||
flycheck-display-errors-delay 0.25))
|
||||
|
||||
(use-package flyover
|
||||
:diminish
|
||||
:hook prog-mode
|
||||
:config
|
||||
;; Disable flyover-mode in emacs-lisp-mode
|
||||
(add-hook 'emacs-lisp-mode-hook (lambda () (flyover-mode -1)))
|
||||
:custom (flyover-checkers '(flycheck)))
|
||||
;; (use-package flyover
|
||||
;; :diminish
|
||||
;; :hook prog-mode
|
||||
;; :config
|
||||
;; ;; Disable flyover-mode in emacs-lisp-mode
|
||||
;; (add-hook 'emacs-lisp-mode-hook (lambda () (flyover-mode -1)))
|
||||
;; :custom (flyover-checkers '(flycheck)))
|
||||
|
||||
|
||||
(provide 'init-check)
|
||||
|
||||
@@ -236,6 +236,7 @@
|
||||
circe-mode
|
||||
help-mode
|
||||
gud-mode
|
||||
eat-mode
|
||||
vterm-mode)
|
||||
t))
|
||||
:custom-face
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
;; Always delete and copy recursively
|
||||
(setq dired-recursive-deletes 'always
|
||||
dired-recursive-copies 'always
|
||||
dired-dwim-target t
|
||||
dired-kill-when-opening-new-dired-buffer t)
|
||||
|
||||
;; Show directory first
|
||||
|
||||
@@ -135,7 +135,7 @@
|
||||
(use-package olivetti
|
||||
:hook org-mode
|
||||
:diminish
|
||||
:bind ("<f7>" . olivetti-mode)
|
||||
:bind (("<f7>" . olivetti-mode))
|
||||
:custom
|
||||
(olivetti-style 'fancy)
|
||||
(olivetti-margin-width 5)
|
||||
|
||||
@@ -14,5 +14,16 @@
|
||||
haskell-process-auto-import-loaded-modules t)
|
||||
(add-to-list 'completion-ignored-extensions ".hi"))
|
||||
|
||||
(use-package haskell-ts-mode
|
||||
:custom
|
||||
(haskell-ts-font-lock-level 4)
|
||||
(haskell-ts-use-indent t)
|
||||
(haskell-ts-ghci "ghci")
|
||||
(haskell-ts-use-indent t)
|
||||
:config
|
||||
(add-to-list 'major-mode-remap-alist '(haskell-mode . haskell-ts-mode)))
|
||||
|
||||
|
||||
(use-package lsp-haskell)
|
||||
|
||||
(provide 'init-haskell)
|
||||
|
||||
@@ -82,9 +82,12 @@
|
||||
'("z" . meow-pop-selection)
|
||||
'("'" . repeat)
|
||||
'("<escape>" . ignore))
|
||||
(meow-define-keys
|
||||
'beacon
|
||||
'("C-g" . meow-grab))
|
||||
;; (meow-define-keys
|
||||
;; 'beacon
|
||||
;; '("C-g" . meow-grab))
|
||||
;; (meow-define-keys
|
||||
;; 'insert
|
||||
;; '("ESC" . <escape>))
|
||||
)
|
||||
|
||||
(use-package meow
|
||||
|
||||
@@ -23,9 +23,4 @@
|
||||
(with-eval-after-load 'exec-path-from-shell
|
||||
(exec-path-from-shell-copy-env "PYTHONPATH")))
|
||||
|
||||
;; (with-eval-after-load 'eglot
|
||||
;; (add-hook 'python-ts-mode-hook #'eglot-ensure)
|
||||
;; (add-to-list 'eglot-server-programs '((python-mode python-ts-mode) . ("pyright-langserver" "--stdio"))))
|
||||
|
||||
|
||||
(provide 'init-python)
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
;; Rust -*- lexical-binding: t; -*-
|
||||
(use-package rust-mode
|
||||
:functions treesit-available-p
|
||||
:init (setq rust-format-on-save t
|
||||
rust-mode-treesitter-derive (treesit-available-p)))
|
||||
:config
|
||||
(add-to-list 'major-mode-remap-alist '(rust-mode . rust-ts-mode)))
|
||||
|
||||
(use-package ron-mode
|
||||
:mode ("\\.ron" . ron-mode))
|
||||
|
||||
@@ -40,71 +40,8 @@
|
||||
:defines eshell-prompt-function
|
||||
:bind (:map eshell-mode-map
|
||||
([remap recenter-top-bottom] . eshell/clear))
|
||||
|
||||
:config
|
||||
(setq eshell-banner-message "")
|
||||
(with-no-warnings
|
||||
(defun eshell/clear ()
|
||||
"Clear the eshell buffer."
|
||||
(interactive)
|
||||
(let ((inhibit-read-only t))
|
||||
(erase-buffer)
|
||||
(eshell-send-input)))
|
||||
(defun eshell/emacs (&rest args)
|
||||
"Open a file (ARGS) in Emacs. Some habits die hard."
|
||||
(if (null args)
|
||||
;; If I just ran "emacs", I probably expect to be launching
|
||||
;; Emacs, which is rather silly since I'm already in Emacs.
|
||||
;; So just pretend to do what I ask.
|
||||
(bury-buffer)
|
||||
;; We have to expand the file names or else naming a directory in an
|
||||
;; argument causes later arguments to be looked for in that directory,
|
||||
;; not the starting directory
|
||||
(mapc #'find-file (mapcar #'expand-file-name (flatten-tree (reverse args))))))
|
||||
(defalias 'eshell/e #'eshell/emacs)
|
||||
(defalias 'eshell/ec #'eshell/emacs)
|
||||
(defun eshell/ebc (&rest args)
|
||||
"Compile a file (ARGS) in Emacs. Use `compile' to do background make."
|
||||
(if (eshell-interactive-output-p)
|
||||
(let ((compilation-process-setup-function
|
||||
(list 'lambda nil
|
||||
(list 'setq 'process-environment
|
||||
(list 'quote (eshell-copy-environment))))))
|
||||
(compile (eshell-flatten-and-stringify args))
|
||||
(pop-to-buffer compilation-last-buffer))
|
||||
(throw 'eshell-replace-command
|
||||
(let ((l (eshell-stringify-list (flatten-tree args))))
|
||||
(eshell-parse-command (car l) (cdr l))))))
|
||||
(put 'eshell/ebc 'eshell-no-numeric-conversions t)
|
||||
(defun eshell-view-file (file)
|
||||
"View FILE. A version of `view-file' which properly rets the eshell prompt."
|
||||
(interactive "fView file: ")
|
||||
(unless (file-exists-p file) (error "%s does not exist" file))
|
||||
(let ((buffer (find-file-noselect file)))
|
||||
(if (eq (get (buffer-local-value 'major-mode buffer) 'mode-class)
|
||||
'special)
|
||||
(progn
|
||||
(switch-to-buffer buffer)
|
||||
(message "Not using View mode because the major mode is special"))
|
||||
(let ((undo-window (list (window-buffer) (window-start)
|
||||
(+ (window-point)
|
||||
(length (funcall eshell-prompt-function))))))
|
||||
(switch-to-buffer buffer)
|
||||
(view-mode-enter (cons (selected-window) (cons nil undo-window))
|
||||
'kill-buffer)))))
|
||||
|
||||
(defun eshell/less (&rest args)
|
||||
"Invoke `view-file' on a file (ARGS).
|
||||
|
||||
\"less +42 foo\" will go to line 42 in the buffer for foo."
|
||||
(while args
|
||||
(if (string-match "\\`\\+\\([0-9]+\\)\\'" (car args))
|
||||
(let* ((line (string-to-number (match-string 1 (pop args))))
|
||||
(file (pop args)))
|
||||
(eshell-view-file file)
|
||||
(forward-line line))
|
||||
(eshell-view-file (pop args)))))
|
||||
(defalias 'eshell/more #'eshell/less)))
|
||||
(setq eshell-banner-message ""))
|
||||
|
||||
(use-package xterm-color
|
||||
:defines (compilation-environment
|
||||
@@ -150,11 +87,11 @@
|
||||
:hook ((eshell-load . eat-eshell-mode)
|
||||
(eshell-load . eat-eshell-visual-command-mode))
|
||||
:ensure `(eat :repo "https://codeberg.org/akib/emacs-eat"
|
||||
:files ("*.el" ("term" "term/*.el") "*.texi"
|
||||
"*.ti" ("terminfo/e" "terminfo/e/*")
|
||||
("terminfo/65" "terminfo/65/*")
|
||||
("integration" "integration/*")
|
||||
(:exclude ".dir-locals.el" "*-tests.el")))
|
||||
:files ("*.el" ("term" "term/*.el") "*.texi"
|
||||
"*.ti" ("terminfo/e" "terminfo/e/*")
|
||||
("terminfo/65" "terminfo/65/*")
|
||||
("integration" "integration/*")
|
||||
(:exclude ".dir-locals.el" "*-tests.el")))
|
||||
:custom
|
||||
(eat-term-name "xterm-256color")
|
||||
(eat-kill-buffer-on-exit t)
|
||||
|
||||
@@ -88,6 +88,33 @@
|
||||
(?c ("\\circ"))
|
||||
))
|
||||
(setq cdlatex-math-modify-alist '((?f "\\mathbb" nil t nil nil)))
|
||||
|
||||
(defun tjh/cdlatex-yas-expand ()
|
||||
"Resolve the conflict between cdlatex and yasnippet. When this
|
||||
function returns true, the default `cdlatex-tab` will not be
|
||||
executed. The effect of function is to first try yasnippet
|
||||
expansion, then cdlatex expansion."
|
||||
(interactive)
|
||||
(if (or (bound-and-true-p yas-minor-mode)
|
||||
(bound-and-true-p yas-global-mode))
|
||||
(if (yas-expand)
|
||||
t
|
||||
nil)
|
||||
nil))
|
||||
(add-hook 'cdlatex-tab-hook 'tjh/cdlatex-yas-expand)
|
||||
(cdlatex-reset-mode))
|
||||
|
||||
(use-package lazytab
|
||||
:demand t
|
||||
:after cdlatex latex
|
||||
:ensure '(lazytab :type git :host github :repo "karthink/lazytab" :files ("*.el"))
|
||||
:bind (:map LaTeX-mode-map
|
||||
("C-x |" . (lambda () (interactive) (lazytab-position-cursor-and-edit))))
|
||||
:bind (:map orgtbl-mode-map
|
||||
("<tab>" . lazytab-org-table-next-field-maybe)
|
||||
("TAB" . lazytab-org-table-next-field-maybe))
|
||||
:config
|
||||
(add-hook 'cdlatex-tab-hook #'lazytab-cdlatex-or-orgtbl-next-field 90)
|
||||
(dolist (cmd '(("smat" "Insert smallmatrix env"
|
||||
"\\left( \\begin{smallmatrix} ? \\end{smallmatrix} \\right)"
|
||||
lazytab-position-cursor-and-edit
|
||||
@@ -109,29 +136,7 @@
|
||||
lazytab-position-cursor-and-edit
|
||||
nil t nil)))
|
||||
(push cmd cdlatex-command-alist))
|
||||
(defun tjh/cdlatex-yas-expand ()
|
||||
"Resolve the conflict between cdlatex and yasnippet. When this
|
||||
function returns true, the default `cdlatex-tab` will not be
|
||||
executed. The effect of function is to first try yasnippet
|
||||
expansion, then cdlatex expansion."
|
||||
(interactive)
|
||||
(if (or (bound-and-true-p yas-minor-mode)
|
||||
(bound-and-true-p yas-global-mode))
|
||||
(if (yas-expand)
|
||||
t
|
||||
nil)
|
||||
nil))
|
||||
(add-hook 'cdlatex-tab-hook 'tjh/cdlatex-yas-expand))
|
||||
|
||||
(use-package lazytab
|
||||
:demand t
|
||||
:after cdlatex
|
||||
:ensure '(lazytab :type git :host github :repo "karthink/lazytab" :files ("*.el"))
|
||||
:bind (:map orgtbl-mode-map
|
||||
("<tab>" . lazytab-org-table-next-field-maybe)
|
||||
("TAB" . lazytab-org-table-next-field-maybe))
|
||||
:config
|
||||
(add-hook 'cdlatex-tab-hook #'lazytab-cdlatex-or-orgtbl-next-field 90)
|
||||
(cdlatex-reset-mode)
|
||||
)
|
||||
|
||||
;; (use-package texpresso
|
||||
|
||||
@@ -3,19 +3,13 @@
|
||||
|
||||
(use-package typst-ts-mode
|
||||
:ensure (:type git :host codeberg :repo "meow_king/typst-ts-mode")
|
||||
:hook (typst-ts-mode . lsp-deferred)
|
||||
:custom
|
||||
;; (typst-ts-watch-options "--open")
|
||||
(typst-ts-mode-grammar-location (expand-file-name "tree-sitter/libtree-sitter-typst.so" user-emacs-directory))
|
||||
(typst-ts-mode-enable-raw-blocks-highlight t)
|
||||
:config
|
||||
(keymap-set typst-ts-mode-map "C-c C-c" #'typst-ts-tmenu)
|
||||
;; (with-eval-after-load 'eglot
|
||||
;; (with-eval-after-load 'typst-ts-mode
|
||||
;; (add-to-list 'eglot-server-programs
|
||||
;; `((typst-ts-mode) .
|
||||
;; ,(eglot-alternatives `(,typst-ts-lsp-download-path
|
||||
;; "tinymist"
|
||||
;; "typst-lsp"))))))
|
||||
(setq typst-ts-preview-function 'find-file-other-window))
|
||||
|
||||
(use-package typst-preview
|
||||
|
||||
@@ -114,19 +114,19 @@
|
||||
window-divider-default-right-width 1)
|
||||
(add-hook 'window-setup-hook #'window-divider-mode)
|
||||
|
||||
(pcase system-type
|
||||
('darwin ; macOS
|
||||
(set-face-attribute 'default nil :font "Sarasa Term SC-22") ; 20 * 1.5
|
||||
(set-face-attribute 'variable-pitch nil :font "Bookerly-22" :weight 'light)
|
||||
(set-face-attribute 'fixed-pitch nil :font "Sarasa Term SC-22")
|
||||
;; (pcase system-type
|
||||
;; ('darwin ; macOS
|
||||
(set-face-attribute 'default nil :font "Sarasa Term SC-22") ; 20 * 1.5
|
||||
(set-face-attribute 'variable-pitch nil :font "Bookerly-20" :weight 'light)
|
||||
(set-face-attribute 'fixed-pitch nil :font "Sarasa Term SC-22")
|
||||
|
||||
(add-to-list 'default-frame-alist '(height . 53))
|
||||
(add-to-list 'default-frame-alist '(width . 90)))
|
||||
(add-to-list 'default-frame-alist '(height . 53))
|
||||
(add-to-list 'default-frame-alist '(width . 90))
|
||||
|
||||
('gnu/linux ; Linux (including Debian)
|
||||
(set-face-attribute 'variable-pitch nil :font "Sarasa Mono TC Nerd Font-14") ; 20 * 1.5
|
||||
(add-to-list 'default-frame-alist '(height . 40))
|
||||
(add-to-list 'default-frame-alist '(width . 90))))
|
||||
;; ('gnu/linux ; Linux (including Debian)
|
||||
;; (set-face-attribute 'variable-pitch nil :font "Sarasa Mono TC Nerd Font-14") ; 20 * 1.5
|
||||
;; (add-to-list 'default-frame-alist '(height . 40))
|
||||
;; (add-to-list 'default-frame-alist '(width . 90))))
|
||||
|
||||
(use-package mixed-pitch
|
||||
:diminish
|
||||
@@ -195,7 +195,7 @@
|
||||
;; hl current line
|
||||
(use-package hl-line
|
||||
:ensure nil
|
||||
:hook ((after-init . global-hl-line-mode)
|
||||
:hook ((elpaca-after-init . global-hl-line-mode)
|
||||
((dashboard-mode eshell-mode shell-mode term-mode vterm-mode eat-mode) .
|
||||
(lambda () (setq-local global-hl-line-mode nil)))))
|
||||
|
||||
|
||||
@@ -30,19 +30,18 @@
|
||||
(which-key-add-key-based-replacements "C-x t" "tabs")
|
||||
(which-key-add-key-based-replacements "C-x v" "version control"))
|
||||
|
||||
(use-package grep
|
||||
:ensure nil
|
||||
:autoload grep-apply-setting
|
||||
:init
|
||||
(when (executable-find "rg")
|
||||
(grep-apply-setting
|
||||
'grep-command "rg --color=auto --null -nH --no-heading -e ")
|
||||
(grep-apply-setting
|
||||
'grep-template "rg --color=auto --null --no-heading -g '!*/' -e <R> <D>")
|
||||
(grep-apply-setting
|
||||
'grep-find-command '("rg --color=auto --null -nH --no-heading -e ''" . 38))
|
||||
(grep-apply-setting
|
||||
'grep-find-template "rg --color=auto --null -nH --no-heading -e <R> <D>")))
|
||||
;; (use-package grep
|
||||
;; :ensure nil
|
||||
;; :autoload grep-apply-setting
|
||||
;; :init
|
||||
;; (grep-apply-setting
|
||||
;; 'grep-command "rg --color=auto --null -nH --no-heading -e ")
|
||||
;; (grep-apply-setting
|
||||
;; 'grep-template "rg --color=auto --null --no-heading -g '!*/' -e <R> <D>")
|
||||
;; (grep-apply-setting
|
||||
;; 'grep-find-command '("rg --color=auto --null -nH --no-heading -e ''" . 38))
|
||||
;; (grep-apply-setting
|
||||
;; 'grep-find-template "rg --color=auto --null -nH --no-heading -e <R> <D>"))
|
||||
|
||||
;; Writable grep buffer
|
||||
(use-package wgrep
|
||||
@@ -51,7 +50,7 @@
|
||||
|
||||
;; Fast search tool `ripgrep'
|
||||
(use-package rg
|
||||
:hook (elpaca-after-init . rg-enable-default-bindings)
|
||||
:bind ("C-c s" . rg-menu)
|
||||
:bind (:map rg-global-map
|
||||
("c" . rg-dwim-current-dir)
|
||||
("f" . rg-dwim-current-file)
|
||||
@@ -62,13 +61,9 @@
|
||||
(rg-enable-default-bindings)
|
||||
)
|
||||
|
||||
;; (use-package pdf-tools
|
||||
;; :config
|
||||
;; (pdf-tools-install))
|
||||
|
||||
;; (use-package saveplace-pdf-view
|
||||
;; :after pdf-tools
|
||||
;; :demand t)
|
||||
;; (use-package sudo-edit
|
||||
;; :commands sudo-edit sudo-edit-find-file
|
||||
;; :bind ("C-c C-r" . sudo-edit))
|
||||
|
||||
;; (use-package keycast
|
||||
;; :hook (elpaca-after-init . keycast-mode-line-mode)
|
||||
|
||||
Reference in New Issue
Block a user