Optimise
This commit is contained in:
@@ -1,11 +1,19 @@
|
||||
;; -*- lexical-binding: t -*-
|
||||
|
||||
(add-hook 'prog-mode-hook #'display-line-numbers-mode)
|
||||
(add-hook 'org-mode-hook #'display-line-numbers-mode)
|
||||
(use-package benchmark-init
|
||||
:ensure t
|
||||
:demand t
|
||||
:config
|
||||
;; To disable collection of benchmark data after init is done.
|
||||
(add-hook 'elpaca-after-init-hook 'benchmark-init/deactivate))
|
||||
|
||||
(server-mode 1)
|
||||
(global-display-line-numbers-mode)
|
||||
(setq-default cursor-type 'bar)
|
||||
(setq display-line-numbers-type 'relative)
|
||||
(show-paren-mode t)
|
||||
(recentf-mode 1)
|
||||
(setq recentf-max-saved-items 500)
|
||||
(setq make-backup-files nil)
|
||||
(setq custom-file (expand-file-name "~/.emacs.d/custom.el"))
|
||||
(load custom-file 'no-error 'no-message)
|
||||
@@ -31,7 +39,7 @@
|
||||
|
||||
;; Interactively insert and edit items from kill-ring
|
||||
(use-package browse-kill-ring
|
||||
:hook (after-init . browse-kill-ring-default-keybindings)
|
||||
:hook (elpaca-after-init . browse-kill-ring-default-keybindings)
|
||||
:init (setq browse-kill-ring-separator "────────────────"
|
||||
browse-kill-ring-separator-face 'shadow))
|
||||
|
||||
@@ -46,14 +54,7 @@
|
||||
:init
|
||||
(setq scroll-conservatively 3
|
||||
scroll-margin 0)
|
||||
:config
|
||||
(ultra-scroll-mode 1))
|
||||
|
||||
(use-package benchmark-init
|
||||
:ensure t
|
||||
:demand t
|
||||
:config
|
||||
;; To disable collection of benchmark data after init is done.
|
||||
(add-hook 'after-init-hook 'benchmark-init/deactivate))
|
||||
:hook (elpaca-after-init . ultra-scroll-mode))
|
||||
|
||||
|
||||
(provide 'init-better-default)
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
(use-package transient)
|
||||
|
||||
(use-package magit
|
||||
:defer
|
||||
:config
|
||||
(setq magit-show-long-lines-warning nil))
|
||||
|
||||
@@ -18,17 +17,15 @@
|
||||
;; )
|
||||
|
||||
(use-package vterm
|
||||
:defer
|
||||
:bind ("C-\\" . vterm))
|
||||
(use-package editorconfig
|
||||
:diminish
|
||||
:hook after-init)
|
||||
:hook elpaca-after-init)
|
||||
|
||||
|
||||
(use-package yaml-mode)
|
||||
;; Fish shell mode and auto-formatting
|
||||
(use-package fish-mode
|
||||
:defer t
|
||||
:commands fish_indent-before-save
|
||||
:defines eglot-server-programs
|
||||
:hook (fish-mode . (lambda ()
|
||||
@@ -43,4 +40,11 @@
|
||||
|
||||
(use-package leetcode)
|
||||
|
||||
(use-package treesit-auto
|
||||
:hook (elpaca-after-init . treesit-auto-mode)
|
||||
:custom
|
||||
(treesit-auto-install 'prompt)
|
||||
:config
|
||||
(treesit-auto-add-to-auto-mode-alist 'all))
|
||||
|
||||
(provide 'init-coding)
|
||||
|
||||
@@ -55,8 +55,9 @@
|
||||
("RET" . vertico-directory-enter)
|
||||
("DEL" . vertico-directory-delete-char)
|
||||
("M-DEL" . vertico-directory-delete-word))
|
||||
:init
|
||||
(vertico-mode t))
|
||||
:hook (elpaca-after-init . vertico-mode)
|
||||
:hook (rfn-eshadow-update-overlay . vertico-directory-tidy))
|
||||
|
||||
|
||||
;; (use-package vertico-posframe
|
||||
;; :after vertico
|
||||
@@ -101,14 +102,12 @@
|
||||
|
||||
;; Enrich existing commands with completion annotations
|
||||
(use-package marginalia
|
||||
:init
|
||||
(marginalia-mode))
|
||||
:hook (elpaca-after-init . marginalia-mode))
|
||||
|
||||
|
||||
;; Add icons to completion candidates
|
||||
(use-package nerd-icons-completion
|
||||
:hook (marginalia-mode . nerd-icons-completion-marginalia-setup)
|
||||
:init
|
||||
(nerd-icons-completion-mode))
|
||||
:hook (marginalia-mode . nerd-icons-completion-marginalia-setup))
|
||||
|
||||
;; Consulting completing-read
|
||||
(use-package consult
|
||||
@@ -120,13 +119,22 @@
|
||||
:functions (list-colors-duplicates consult-colors--web-list)
|
||||
:bind (("C-." . consult-imenu)
|
||||
("C-c T" . consult-theme)
|
||||
|
||||
|
||||
([remap Info-search] . consult-info)
|
||||
;; ([remap isearch-forward] . consult-line)
|
||||
([remap recentf-open-files] . consult-recent-file)
|
||||
|
||||
|
||||
("s-f" . consult-line)
|
||||
("C-c s s" . consult-line)
|
||||
("C-c p f" . consult-project-buffer)
|
||||
("C-c f r" . consult-recent-file)
|
||||
("C-x C-b" . consult-buffer)
|
||||
("C-c s p" . consult-ripgrep)))
|
||||
("C-c s p" . consult-ripgrep))
|
||||
:hook (completion-list-mode . consult-preview-at-point-mode)
|
||||
:init
|
||||
(setq register-preview-delay 0.5
|
||||
register-preview-function #'consult-register-format))
|
||||
|
||||
|
||||
(use-package consult-dir
|
||||
@@ -180,7 +188,16 @@
|
||||
:config
|
||||
;;Quit completion before saving
|
||||
(add-hook 'before-save-hook #'corfu-quit)
|
||||
(advice-add #'persistent-scratch-save :before #'corfu-quit))
|
||||
(advice-add #'persistent-scratch-save :before #'corfu-quit)
|
||||
(defun corfu-move-to-minibuffer ()
|
||||
(interactive)
|
||||
(pcase completion-in-region--data
|
||||
(`(,beg ,end ,table ,pred ,extras)
|
||||
(let ((completion-extra-properties extras)
|
||||
completion-cycle-threshold completion-cycling)
|
||||
(consult-completion-in-region beg end table pred)))))
|
||||
(keymap-set corfu-map "M-m" #'corfu-move-to-minibuffer)
|
||||
(add-to-list 'corfu-continue-commands #'corfu-move-to-minibuffer))
|
||||
|
||||
(use-package nerd-icons-corfu
|
||||
:init
|
||||
@@ -212,6 +229,9 @@
|
||||
(read-extended-command-predicate #'command-completion-default-include-p))
|
||||
|
||||
(use-package cape
|
||||
:commands (cape-file cape-elisp-block cape-keyword)
|
||||
:autoload (cape-wrap-noninterruptible cape-wrap-nonexclusive cape-wrap-buster)
|
||||
:autoload (cape-wrap-silent)
|
||||
:init
|
||||
;; Add `completion-at-point-functions', used by `completion-at-point'.
|
||||
;; (add-to-list 'completion-at-point-functions #'cape-dabbrev)
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
(dashboard-items-face ((t (:weight normal))))
|
||||
(dashboard-no-items-face ((t (:weight normal))))
|
||||
:hook (dashboard-mode . (lambda () (setq-local frame-title-format nil)))
|
||||
:config
|
||||
(add-hook 'elpaca-after-init-hook #'dashboard-insert-startupify-lists)
|
||||
(add-hook 'elpaca-after-init-hook #'dashboard-initialize)
|
||||
:init
|
||||
(setq dashboard-banner-logo-title "ZEMACS - Enjoy Programming & Writing"
|
||||
;; dashboard-page-separator "\n\f\n"
|
||||
@@ -31,7 +34,6 @@
|
||||
dashboard-insert-init-info
|
||||
dashboard-insert-items
|
||||
dashboard-insert-newline
|
||||
dashboard-insert-footer))
|
||||
|
||||
(dashboard-setup-startup-hook))
|
||||
dashboard-insert-footer)))
|
||||
|
||||
(provide 'init-dashboard)
|
||||
|
||||
@@ -11,19 +11,19 @@
|
||||
(add-hook 'text-mode-hook #'electric-pair-mode)
|
||||
|
||||
(use-package winum
|
||||
:init
|
||||
(winum-mode)
|
||||
:hook (elpaca-after-init . winum-mode)
|
||||
:config
|
||||
(winum-set-keymap-prefix (kbd "C-c w")))
|
||||
|
||||
;; Yasnippet settings
|
||||
(use-package yasnippet
|
||||
:ensure t
|
||||
:hook (elpaca-after-init . yas-global-mode)
|
||||
:hook ((LaTeX-mode . yas-minor-mode)
|
||||
(post-self-insert . my/yas-try-expanding-auto-snippets))
|
||||
:config
|
||||
(yas-global-mode)
|
||||
(use-package warnings
|
||||
:ensure nil
|
||||
:config
|
||||
(cl-pushnew '(yasnippet backquote-change)
|
||||
warning-suppress-types
|
||||
|
||||
10
lisp/init-gc.el
Normal file
10
lisp/init-gc.el
Normal file
@@ -0,0 +1,10 @@
|
||||
;; -*- lexical-binding: t; -*-
|
||||
|
||||
|
||||
(use-package gcmh
|
||||
:init
|
||||
(gcmh-mode 1)
|
||||
:config
|
||||
(setq gcmh-high-cons-threshold #x6400000))
|
||||
|
||||
(provide 'init-gc)
|
||||
@@ -8,8 +8,6 @@
|
||||
:config
|
||||
(setq haskell-process-suggest-remove-import-lines t
|
||||
haskell-process-auto-import-loaded-modules t)
|
||||
(add-hook 'haskell-mode-local-vars-hook #'lsp! 'append)
|
||||
(add-hook 'haskell-literate-mode-local-vars-hook #'lsp! 'append)
|
||||
(add-to-list 'completion-ignored-extensions ".hi")
|
||||
)
|
||||
|
||||
|
||||
@@ -85,11 +85,9 @@
|
||||
|
||||
(use-package meow
|
||||
:demand t
|
||||
:init
|
||||
(meow-global-mode 1)
|
||||
:hook (elpaca-after-init . meow-global-mode)
|
||||
:config
|
||||
(meow-setup)
|
||||
(setq meow-cursor-type-normal 'bar)
|
||||
)
|
||||
(setq meow-cursor-type-normal 'bar))
|
||||
|
||||
(provide 'init-meow)
|
||||
|
||||
@@ -3,16 +3,24 @@
|
||||
|
||||
(use-package typst-ts-mode
|
||||
:ensure (:type git :host codeberg :repo "meow_king/typst-ts-mode")
|
||||
:hook (typst-ts-mode . eglot-ensure)
|
||||
: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))
|
||||
(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")))))))
|
||||
|
||||
(use-package typst-preview
|
||||
:ensure (: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-open-browser-automatically t) ; open browser automatically when typst-preview-start is run
|
||||
|
||||
@@ -24,7 +32,8 @@
|
||||
|
||||
:config
|
||||
(define-key typst-ts-mode-map (kbd "C-c C-j") 'typst-preview-send-position)
|
||||
(define-key typst-ts-mode-map (kbd "C-c C-l") #'typst-preview-mode)
|
||||
)
|
||||
(define-key typst-ts-mode-map (kbd "C-c C-l") #'typst-preview-mode))
|
||||
|
||||
|
||||
|
||||
(provide 'init-typst)
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
frame-resize-pixelwise t)
|
||||
|
||||
(use-package solaire-mode
|
||||
:hook (after-init . solaire-global-mode))
|
||||
:hook (elpaca-after-init . solaire-global-mode))
|
||||
(use-package ef-themes
|
||||
:ensure t
|
||||
:init
|
||||
@@ -45,7 +45,9 @@
|
||||
(foo-mode . rainbow-delimiters-mode)))
|
||||
|
||||
(use-package doom-modeline
|
||||
:init (doom-modeline-mode 1))
|
||||
:hook (elpaca-after-init . doom-modeline-mode))
|
||||
(use-package minions
|
||||
:hook elpaca-after-init)
|
||||
|
||||
(use-package hide-mode-line
|
||||
:autoload turn-off-hide-mode-line-mode
|
||||
@@ -88,7 +90,7 @@
|
||||
|
||||
;; Easily adjust the font size in all frames
|
||||
(use-package default-text-scale
|
||||
:hook (after-init . default-text-scale-mode)
|
||||
:hook (elpaca-after-init . default-text-scale-mode)
|
||||
:bind (:map default-text-scale-mode-map
|
||||
("s-=" . default-text-scale-increase)
|
||||
("s--" . default-text-scale-decrease)
|
||||
|
||||
Reference in New Issue
Block a user