Update
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -35,6 +35,7 @@ rime
|
|||||||
.yas-compiled-snippets.el
|
.yas-compiled-snippets.el
|
||||||
flycheck_*.el
|
flycheck_*.el
|
||||||
tabsession.el
|
tabsession.el
|
||||||
|
.lsp-session-v1
|
||||||
emacs.desktop
|
emacs.desktop
|
||||||
history
|
history
|
||||||
!alias
|
!alias
|
||||||
|
|||||||
@@ -1,2 +1 @@
|
|||||||
* Basically there is nothing extra you need to do
|
* Just Pull and run. Enjoy
|
||||||
run M-x my/generate-envvar-file
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
(setq use-package-enable-imenu-support t)
|
(setq use-package-enable-imenu-support t)
|
||||||
(setq load-prefer-newer noninteractive)
|
(setq load-prefer-newer noninteractive)
|
||||||
|
|
||||||
(setenv "LSP_USE_PLISTS" "true")
|
(setenv "LSP_USE_PLISTS" "true") ;; Lsp-mode plists
|
||||||
|
|
||||||
;; PERF: Many elisp file API calls consult `file-name-handler-alist'.
|
;; PERF: Many elisp file API calls consult `file-name-handler-alist'.
|
||||||
;; Setting it to nil speeds up startup significantly.
|
;; Setting it to nil speeds up startup significantly.
|
||||||
@@ -34,6 +34,15 @@
|
|||||||
;; Inhibit resizing frame
|
;; Inhibit resizing frame
|
||||||
(setq frame-inhibit-implied-resize t)
|
(setq frame-inhibit-implied-resize t)
|
||||||
|
|
||||||
|
;; Suppress GUI features
|
||||||
|
(setq use-file-dialog nil
|
||||||
|
use-dialog-box nil
|
||||||
|
inhibit-startup-screen t
|
||||||
|
inhibit-startup-echo-area-message user-login-name
|
||||||
|
inhibit-default-init t
|
||||||
|
initial-major-mode 'fundamental-mode
|
||||||
|
initial-scratch-message nil)
|
||||||
|
|
||||||
;; 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)
|
||||||
|
|||||||
2
init.el
2
init.el
@@ -52,7 +52,7 @@
|
|||||||
|
|
||||||
(require 'init-org)
|
(require 'init-org)
|
||||||
(require 'init-tex)
|
(require 'init-tex)
|
||||||
(require 'init-markdown)
|
;; (require 'init-markdown)
|
||||||
(require 'init-typst)
|
(require 'init-typst)
|
||||||
(require 'init-cc)
|
(require 'init-cc)
|
||||||
(require 'init-python)
|
(require 'init-python)
|
||||||
|
|||||||
@@ -1,10 +1,16 @@
|
|||||||
;; -*- lexical-binding: t -*-
|
;; -*- lexical-binding: t -*-
|
||||||
|
|
||||||
(use-package benchmark-init
|
(use-package benchmark-init :demand t
|
||||||
:demand t
|
:hook (after-init . benchmark-init/deactivate))
|
||||||
:config
|
|
||||||
;; To disable collection of benchmark data after init is done.
|
(let (
|
||||||
(add-hook 'emacs-startup-hook 'benchmark-init/deactivate)
|
;; 加载的时候临时增大`gc-cons-threshold'以加速启动速度。
|
||||||
|
(gc-cons-threshold most-positive-fixnum)
|
||||||
|
;; 清空避免加载远程文件的时候分析文件。
|
||||||
|
(file-name-handler-alist nil))
|
||||||
|
(require 'benchmark-init-modes)
|
||||||
|
(require 'benchmark-init)
|
||||||
|
(benchmark-init/activate)
|
||||||
)
|
)
|
||||||
|
|
||||||
;; Load some component of large package (org, magit etc.) before complete mount
|
;; Load some component of large package (org, magit etc.) before complete mount
|
||||||
@@ -153,11 +159,11 @@ If this is a daemon session, load them all immediately instead."
|
|||||||
"\\.\\(?:gz\\|gif\\|svg\\|png\\|jpe?g\\|bmp\\|xpm\\)$"
|
"\\.\\(?:gz\\|gif\\|svg\\|png\\|jpe?g\\|bmp\\|xpm\\)$"
|
||||||
"\\.?ido\\.last$" "\\.revive$" "/G?TAGS$" "/.elfeed/"
|
"\\.?ido\\.last$" "\\.revive$" "/G?TAGS$" "/.elfeed/"
|
||||||
"^/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)))
|
||||||
|
recentf-auto-cleanup 'never)
|
||||||
:config
|
:config
|
||||||
(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
|
||||||
:straight nil
|
:straight nil
|
||||||
@@ -263,6 +269,11 @@ If this is a daemon session, load them all immediately instead."
|
|||||||
;; (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)))
|
||||||
|
|
||||||
|
(setq tramp-default-method "rpc")
|
||||||
|
|
||||||
|
(use-package tramp
|
||||||
|
:straight (:type built-in))
|
||||||
|
|
||||||
(use-package tramp-hlo
|
(use-package tramp-hlo
|
||||||
:config
|
:config
|
||||||
(tramp-hlo-setup))
|
(tramp-hlo-setup))
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
(use-package smartparens
|
(use-package smartparens
|
||||||
:diminish
|
:diminish
|
||||||
:hook (after-init . smartparens-global-mode)
|
:hook (after-init . smartparens-global-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
|
||||||
@@ -59,7 +58,7 @@
|
|||||||
(prog-mode . goto-address-prog-mode)))
|
(prog-mode . goto-address-prog-mode)))
|
||||||
|
|
||||||
(use-package multiple-cursors
|
(use-package multiple-cursors
|
||||||
:hook after-init
|
:hook prog-mode
|
||||||
: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)
|
||||||
|
|||||||
@@ -178,10 +178,9 @@
|
|||||||
(when-let ((command-from-exec-path (executable-find (car orig-result)))) ;; resolve command from exec-path (in case not found in $PATH)
|
(when-let ((command-from-exec-path (executable-find (car orig-result)))) ;; resolve command from exec-path (in case not found in $PATH)
|
||||||
(setcar orig-result command-from-exec-path))
|
(setcar orig-result command-from-exec-path))
|
||||||
(message "Using emacs-lsp-booster for %s!" orig-result)
|
(message "Using emacs-lsp-booster for %s!" orig-result)
|
||||||
(cons "emacs-lsp-booster" orig-result))
|
(append (list "emacs-lsp-booster" "--") orig-result))
|
||||||
orig-result)))
|
orig-result)))
|
||||||
(advice-add 'lsp-resolve-final-command :around #'lsp-booster--advice-final-command)
|
(advice-add 'lsp-resolve-final-command :around #'lsp-booster--advice-final-command)
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,10 +5,9 @@
|
|||||||
:straight 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))
|
||||||
(add-hook 'tuareg-mode-hook (lambda () )))
|
|
||||||
|
|
||||||
(use-package dune)
|
;; (use-package dune)
|
||||||
|
|
||||||
(use-package opam-switch-mode
|
(use-package opam-switch-mode
|
||||||
:hook (tuareg-mode . opam-switch-mode)
|
:hook (tuareg-mode . opam-switch-mode)
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ the element after the #+HEADER: tag."
|
|||||||
:hook (org-latex-preview-mode . org-latex-preview-center-mode)
|
:hook (org-latex-preview-mode . org-latex-preview-center-mode)
|
||||||
:config
|
:config
|
||||||
;; Higher resolution when using dvipng
|
;; Higher resolution when using dvipng
|
||||||
(plist-put org-latex-preview-appearance-options :page-width 0.6)
|
(plist-put org-latex-preview-appearance-options :page-width 1.0)
|
||||||
;; (plist-put org-latex-preview-appearance-options :margin 1)
|
;; (plist-put org-latex-preview-appearance-options :margin 1)
|
||||||
(plist-put org-latex-preview-appearance-options :scale 2.0)
|
(plist-put org-latex-preview-appearance-options :scale 2.0)
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,37 @@
|
|||||||
|
|
||||||
(use-package shell
|
(use-package shell
|
||||||
:straight nil
|
:straight nil
|
||||||
:hook ((comint-output-filter-functions . comint-strip-ctrl-m))
|
:hook ((shell-mode . my/shell-mode-hook)
|
||||||
|
(comint-output-filter-functions . comint-strip-ctrl-m))
|
||||||
:init
|
:init
|
||||||
(setq system-uses-terminfo nil))
|
(setq system-uses-terminfo nil)
|
||||||
|
|
||||||
|
(with-no-warnings
|
||||||
|
(defun my/shell-simple-send (proc command)
|
||||||
|
"Various PROC COMMANDs pre-processing before sending to shell."
|
||||||
|
(cond
|
||||||
|
;; Checking for clear command and execute it.
|
||||||
|
((string-match "^[ \t]*clear[ \t]*$" command)
|
||||||
|
(comint-send-string proc "\n")
|
||||||
|
(erase-buffer))
|
||||||
|
;; Checking for man command and execute it.
|
||||||
|
((string-match "^[ \t]*man[ \t]*" command)
|
||||||
|
(comint-send-string proc "\n")
|
||||||
|
(setq command (replace-regexp-in-string "^[ \t]*man[ \t]*" "" command))
|
||||||
|
(setq command (replace-regexp-in-string "[ \t]+$" "" command))
|
||||||
|
;;(message (format "command %s command" command))
|
||||||
|
(funcall 'man command))
|
||||||
|
;; Send other commands to the default handler.
|
||||||
|
(t (comint-simple-send proc command))))
|
||||||
|
|
||||||
|
(defun my/shell-mode-hook ()
|
||||||
|
"Shell mode customization."
|
||||||
|
(local-set-key '[up] 'comint-previous-input)
|
||||||
|
(local-set-key '[down] 'comint-next-input)
|
||||||
|
(local-set-key '[(shift tab)] 'comint-next-matching-input-from-input)
|
||||||
|
|
||||||
|
(ansi-color-for-comint-mode-on)
|
||||||
|
(setq comint-input-sender 'my/shell-simple-send))))
|
||||||
|
|
||||||
;; Emacs command shell
|
;; Emacs command shell
|
||||||
(use-package eshell
|
(use-package eshell
|
||||||
@@ -12,10 +40,13 @@
|
|||||||
:defines eshell-prompt-function
|
:defines eshell-prompt-function
|
||||||
:bind (:map eshell-mode-map
|
:bind (:map eshell-mode-map
|
||||||
([remap recenter-top-bottom] . eshell/clear))
|
([remap recenter-top-bottom] . eshell/clear))
|
||||||
|
|
||||||
:config
|
:config
|
||||||
|
(setq eshell-banner-message "")
|
||||||
(with-no-warnings
|
(with-no-warnings
|
||||||
(defun eshell/clear ()
|
(defun eshell/clear ()
|
||||||
"Clear the eshell buffer."
|
"Clear the eshell buffer."
|
||||||
|
(interactive)
|
||||||
(let ((inhibit-read-only t))
|
(let ((inhibit-read-only t))
|
||||||
(erase-buffer)
|
(erase-buffer)
|
||||||
(eshell-send-input)))
|
(eshell-send-input)))
|
||||||
@@ -113,11 +144,9 @@
|
|||||||
(advice-add 'gud-filter :around #'my/advice-compilation-filter)
|
(advice-add 'gud-filter :around #'my/advice-compilation-filter)
|
||||||
)
|
)
|
||||||
|
|
||||||
(setq eshell-banner-message "")
|
|
||||||
|
|
||||||
(use-package eat
|
(use-package eat
|
||||||
:bind ("C-`" . eat-toggle)
|
:bind ("C-<escape>" . eat-toggle)
|
||||||
:bind ("C-<escape>" . eshell-toggle)
|
:bind ("C-`" . eshell-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))
|
||||||
:straight `(eat :repo "https://codeberg.org/akib/emacs-eat"
|
:straight `(eat :repo "https://codeberg.org/akib/emacs-eat"
|
||||||
@@ -143,7 +172,8 @@
|
|||||||
;; Improve latency
|
;; Improve latency
|
||||||
(setq process-adaptive-read-buffering t)
|
(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="))
|
(with-eval-after-load 'tramp
|
||||||
|
(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)
|
||||||
(define-key eat-semi-char-mode-map (kbd "C-h") #'eat-self-input)
|
(define-key eat-semi-char-mode-map (kbd "C-h") #'eat-self-input)
|
||||||
(define-key eat-semi-char-mode-map (kbd "<backspace>") (kbd "C-h"))))
|
(define-key eat-semi-char-mode-map (kbd "<backspace>") (kbd "C-h"))))
|
||||||
|
|||||||
@@ -7,22 +7,13 @@
|
|||||||
|
|
||||||
(use-package diminish)
|
(use-package diminish)
|
||||||
|
|
||||||
;; Suppress GUI features
|
|
||||||
(setq use-file-dialog nil
|
|
||||||
use-dialog-box nil
|
|
||||||
inhibit-startup-screen t
|
|
||||||
inhibit-startup-echo-area-message user-login-name
|
|
||||||
inhibit-default-init t
|
|
||||||
initial-scratch-message nil)
|
|
||||||
|
|
||||||
(setq-default cursor-in-non-selected-windows nil)
|
(setq-default cursor-in-non-selected-windows nil)
|
||||||
(setq highlight-nonselected-windows nil)
|
(setq highlight-nonselected-windows nil)
|
||||||
|
|
||||||
(setq fast-but-imprecise-scrolling t)
|
(setq fast-but-imprecise-scrolling t)
|
||||||
(setq redisplay-skip-fontification-on-input t)
|
(setq redisplay-skip-fontification-on-input t)
|
||||||
|
|
||||||
(setq frame-inhibit-implied-resize t
|
(setq frame-resize-pixelwise t)
|
||||||
frame-resize-pixelwise t)
|
|
||||||
|
|
||||||
;; 隐藏 title bar
|
;; 隐藏 title bar
|
||||||
(add-to-list 'default-frame-alist '(undecorated-round . t))
|
(add-to-list 'default-frame-alist '(undecorated-round . t))
|
||||||
@@ -46,31 +37,41 @@
|
|||||||
:bind ("C-<f5>" . (lambda () (interactive) (doric-themes-load-random 'light)))
|
:bind ("C-<f5>" . (lambda () (interactive) (doric-themes-load-random 'light)))
|
||||||
:bind ("M-<f5>" . (lambda () (interactive) (doric-themes-load-random 'dark)))
|
:bind ("M-<f5>" . (lambda () (interactive) (doric-themes-load-random 'dark)))
|
||||||
:commands doric-themes-load-random
|
:commands doric-themes-load-random
|
||||||
:init
|
;; :init
|
||||||
(defun synchronise-theme ()
|
;; (defun synchronise-theme ()
|
||||||
(let* ((hour (string-to-number
|
;; (let* ((hour (string-to-number
|
||||||
(substring (current-time-string) 11 13))))
|
;; (substring (current-time-string) 11 13))))
|
||||||
(if (member hour (number-sequence 6 18))
|
;; (if (member hour (number-sequence 6 18))
|
||||||
(doric-themes-load-random 'light)
|
;; (doric-themes-load-random 'light)
|
||||||
(doric-themes-load-random 'dark))))
|
;; (doric-themes-load-random 'dark))))
|
||||||
:init
|
;; (synchronise-theme)
|
||||||
(synchronise-theme)
|
;; (run-with-timer 3600 3600 'synchronise-theme)
|
||||||
(run-with-timer 3600 3600 'synchronise-theme)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
(use-package auto-dark
|
||||||
|
:ensure t
|
||||||
|
;; :custom
|
||||||
|
;; (auto-dark-themes '((doric-beach) (leuven)))
|
||||||
|
;; (auto-dark-allow-osascript t)
|
||||||
|
;; (auto-dark-detection-method nil) ;; dangerous to be set manually
|
||||||
|
:hook
|
||||||
|
(auto-dark-dark-mode
|
||||||
|
. (lambda ()
|
||||||
|
;; something to execute when dark mode is detected
|
||||||
|
(doric-themes-load-random 'dark))
|
||||||
|
)
|
||||||
|
(auto-dark-light-mode
|
||||||
|
. (lambda ()
|
||||||
|
;; something to execute when light mode is detected
|
||||||
|
(doric-themes-load-random 'light)
|
||||||
|
))
|
||||||
|
:hook after-init)
|
||||||
|
|
||||||
(use-package rainbow-delimiters
|
(use-package rainbow-delimiters
|
||||||
:hook ((prog-mode . rainbow-delimiters-mode)
|
:hook ((prog-mode . rainbow-delimiters-mode)
|
||||||
(typst-ts-mode . rainbow-delimiters-mode)
|
(typst-ts-mode . rainbow-delimiters-mode)
|
||||||
(python-ts-mode . rainbow-delimiters-mode)))
|
(python-ts-mode . rainbow-delimiters-mode)))
|
||||||
|
|
||||||
;; (use-package prism
|
|
||||||
;; :hook (prog-mode . prism-mode)
|
|
||||||
;; :hook (text-mode . prism-mode)
|
|
||||||
;; :hook (typst-ts-mode . prism-mode)
|
|
||||||
;; :hook (python-ts-mode . prism-whitespace-mode)
|
|
||||||
;; :config
|
|
||||||
;; (setq prism-parens t))
|
|
||||||
|
|
||||||
(use-package rainbow-mode
|
(use-package rainbow-mode
|
||||||
:hook text-mode
|
:hook text-mode
|
||||||
:hook prog-mode)
|
:hook prog-mode)
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
("X" ace-delete-other-windows "delete other" :exit t)
|
("X" ace-delete-other-windows "delete other" :exit t)
|
||||||
("s" ace-swap-window "swap")
|
("s" ace-swap-window "swap")
|
||||||
("a" ace-select-window "select" :exit t)
|
("a" ace-select-window "select" :exit t)
|
||||||
("m" toggle-frame-maximized "maximize" :exit t)
|
("m" maximize-window "maximize" :exit t)
|
||||||
("u" toggle-frame-fullscreen "fullscreen" :exit t))
|
("u" toggle-frame-fullscreen "fullscreen" :exit t))
|
||||||
"Resize"
|
"Resize"
|
||||||
(("h" shrink-window-horizontally "←")
|
(("h" shrink-window-horizontally "←")
|
||||||
|
|||||||
Reference in New Issue
Block a user