From eb746b0e7c860a047deb77d33ea773d25d5e014c Mon Sep 17 00:00:00 2001 From: materus Date: Wed, 30 Oct 2024 16:37:59 +0100 Subject: [PATCH] configurations: emacs changes --- .../profile/home/editor/emacs/default.nix | 11 +-- .../config/emacs/etc/materus/internals.el | 62 +++++++++++++++ extraFiles/config/emacs/etc/materus/lsp.el | 5 +- .../config/emacs/etc/materus/packages.el | 5 +- extraFiles/config/emacs/etc/materus/start.el | 78 +++++-------------- extraFiles/config/emacs/init.el | 2 +- 6 files changed, 97 insertions(+), 66 deletions(-) create mode 100644 extraFiles/config/emacs/etc/materus/internals.el diff --git a/configurations/profile/home/editor/emacs/default.nix b/configurations/profile/home/editor/emacs/default.nix index cd43fac..06d88e8 100644 --- a/configurations/profile/home/editor/emacs/default.nix +++ b/configurations/profile/home/editor/emacs/default.nix @@ -11,7 +11,6 @@ let persp-mode dashboard magit - helm avy corfu vterm @@ -32,6 +31,7 @@ let treemacs-projectile tree-edit vertico + marginalia nerd-icons nerd-icons-completion perspective @@ -63,6 +63,7 @@ let right-click-context moe-theme doom-themes + orderless ]; default-config = '' @@ -125,8 +126,8 @@ in programs.emacs = { enable = true; - package = with pkgs; - lib.mkDefault (pkgs.emacs29.override ({ + package = + lib.mkDefault (pkgs.emacs29.override { withSQLite3 = true; withWebP = true; withX = true; @@ -135,8 +136,8 @@ in withGconf = true; withImageMagick = true; withXwidgets = true; - })); - extraPackages = epkgs: ((packages epkgs)); + }); + extraPackages = epkgs: (packages epkgs); }; }; diff --git a/extraFiles/config/emacs/etc/materus/internals.el b/extraFiles/config/emacs/etc/materus/internals.el new file mode 100644 index 0000000..d30d1fd --- /dev/null +++ b/extraFiles/config/emacs/etc/materus/internals.el @@ -0,0 +1,62 @@ +(require 'recentf) +(require 'no-littering) +(add-to-list 'recentf-exclude + (recentf-expand-file-name no-littering-var-directory)) +(add-to-list 'recentf-exclude + (recentf-expand-file-name no-littering-etc-directory)) + +(setq native-comp-async-report-warnings-errors nil) +(setq package-enable-at-startup nil) +(setq frame-inhibit-implied-resize t) +(defvar materus/init-early nil) +(unless materus/init-early + (tool-bar-mode -1) + (setq initial-major-mode 'fundamental-mode) + (setq-default package-quickstart t) + (setq native-comp-speed 3) + (add-hook 'emacs-startup-hook (lambda () (package-initialize) + (setq gc-cons-threshold 100000000 ; ~100mb + gc-cons-percentage 0.1) + )) + (unless (daemonp) + (setq gc-cons-threshold most-positive-fixnum ; 2^61 bytes + gc-cons-percentage 0.6) + (setq package-enable-at-startup nil) + + (advice-add #'tty-run-terminal-initialization :override #'ignore) + (add-hook 'window-setup-hook + (lambda () + (advice-remove #'tty-run-terminal-initialization #'ignore) + (tty-run-terminal-initialization (selected-frame) nil t) + ) + ) + ) + ) + + + +(setq custom-file (concat user-emacs-directory "etc/custom.el")) + +(setq auto-save-default nil) +(setq backup-directory-alist + `((".*" . ,(concat user-emacs-directory "var/backups/")))) +(setq auto-save-file-name-transforms + `((".*" ,(concat user-emacs-directory "var/recovery/") t))) + + + +;;. Graphical +(setq frame-resize-pixelwise t) +(when (display-graphic-p) + (set-frame-font "Hack Nerd Font" nil t) + ) + + + + +(setq read-process-output-max (* 1024 1024 3)) +(when (or (not (display-graphic-p)) (daemonp)) + (xterm-mouse-mode 1) + ) + +(setq ring-bell-function 'ignore) diff --git a/extraFiles/config/emacs/etc/materus/lsp.el b/extraFiles/config/emacs/etc/materus/lsp.el index c394f19..1707ec8 100644 --- a/extraFiles/config/emacs/etc/materus/lsp.el +++ b/extraFiles/config/emacs/etc/materus/lsp.el @@ -56,4 +56,7 @@ (add-hook 'nix-mode-hook 'display-line-numbers-mode) (add-hook 'java-mode-hook 'lsp-deferred) -(add-hook 'nix-mode-hook 'display-line-numbers-mode) \ No newline at end of file +(add-hook 'nix-mode-hook 'display-line-numbers-mode) + +(add-hook 'emacs-lisp-mode-hook 'display-line-numbers-mode) +(add-hook 'emacs-lisp-mode-hook 'company-mode) diff --git a/extraFiles/config/emacs/etc/materus/packages.el b/extraFiles/config/emacs/etc/materus/packages.el index e72d62b..2dd32c6 100644 --- a/extraFiles/config/emacs/etc/materus/packages.el +++ b/extraFiles/config/emacs/etc/materus/packages.el @@ -20,7 +20,6 @@ (straight-use-package 'persp-mode) (straight-use-package 'dashboard) (straight-use-package 'magit) -(straight-use-package 'helm) (straight-use-package 'avy) (straight-use-package 'corfu) (straight-use-package 'vterm) @@ -41,6 +40,7 @@ (straight-use-package 'treemacs-projectile) (straight-use-package 'tree-edit) (straight-use-package 'vertico) +(straight-use-package 'marginalia) (straight-use-package 'nerd-icons) (straight-use-package 'nerd-icons-completion) (straight-use-package 'perspective) @@ -71,4 +71,5 @@ (straight-use-package 'no-littering) (straight-use-package 'right-click-context) (straight-use-package 'moe-theme) -(straight-use-package 'doom-themes) \ No newline at end of file +(straight-use-package 'doom-themes) +(straight-use-package 'orderless) \ No newline at end of file diff --git a/extraFiles/config/emacs/etc/materus/start.el b/extraFiles/config/emacs/etc/materus/start.el index 7c292e0..78e3041 100644 --- a/extraFiles/config/emacs/etc/materus/start.el +++ b/extraFiles/config/emacs/etc/materus/start.el @@ -1,48 +1,5 @@ -(require 'recentf) -(require 'no-littering) -(add-to-list 'recentf-exclude - (recentf-expand-file-name no-littering-var-directory)) -(add-to-list 'recentf-exclude - (recentf-expand-file-name no-littering-etc-directory)) - -(setq native-comp-async-report-warnings-errors nil) -(setq package-enable-at-startup nil) -(setq frame-inhibit-implied-resize t) -(defvar materus/init-early nil) -(unless materus/init-early - (tool-bar-mode -1) - (setq initial-major-mode 'fundamental-mode) - (setq-default package-quickstart t) - (setq native-comp-speed 3) - (add-hook 'emacs-startup-hook (lambda () (package-initialize) - (setq gc-cons-threshold 100000000 ; ~100mb - gc-cons-percentage 0.1) - )) - (unless (daemonp) - (setq gc-cons-threshold most-positive-fixnum ; 2^61 bytes - gc-cons-percentage 0.6) - (setq package-enable-at-startup nil) - - (advice-add #'tty-run-terminal-initialization :override #'ignore) - (add-hook 'window-setup-hook - (lambda () - (advice-remove #'tty-run-terminal-initialization #'ignore) - (tty-run-terminal-initialization (selected-frame) nil t) - ) - ) -) -) - - - -(setq custom-file (concat user-emacs-directory "etc/custom.el")) - -(setq auto-save-default nil) -(setq backup-directory-alist - `((".*" . ,(concat user-emacs-directory "var/backups/")))) -(setq auto-save-file-name-transforms - `((".*" ,(concat user-emacs-directory "var/recovery/") t))) - +(defvar materus/cfg nil) +(setq materus/cfg (concat user-emacs-directory "etc/materus")) ; Load packages (require 'telephone-line) @@ -56,25 +13,20 @@ (require 'treemacs) (require 'treemacs-projectile) (require 'treemacs-nerd-icons) - -;Graphical -(setq frame-resize-pixelwise t) -(when (display-graphic-p) - (set-frame-font "Hack Nerd Font" nil t) -) +(require 'vertico) +(require 'orderless) +(require 'marginalia) + + + -(setq read-process-output-max (* 1024 1024 3)) -(when (or (not (display-graphic-p)) (daemonp)) - (xterm-mouse-mode 1) -) (tool-bar-mode -1) (load-theme 'doom-horizon t) -(setq ring-bell-function 'ignore) (setq-default cursor-type '(bar . 1)) (pixel-scroll-precision-mode 1) @@ -116,6 +68,15 @@ ;Enable treemacs (global-set-key (kbd "C-H-t") 'treemacs) +;; Enable vertico +(vertico-mode 1) +(marginalia-mode 1) + + +;(setq completion-styles '(orderless basic) +; completion-category-defaults nil +; completion-category-overrides '((file (styles partial-completion)))) + ;CUA (cua-mode 1) (global-set-key (kbd "C-y") 'undo-redo) @@ -129,4 +90,7 @@ (define-key key-translation-map (kbd "∇") 'event-apply-hyper-modifier ) ;(global-set-key (kbd "C-∇") (kbd "C-H")) -;(global-set-key (kbd "H-∇") (lambda () (interactive) (insert-char #x2207))) \ No newline at end of file +;(global-set-key (kbd "H-∇") (lambda () (interactive) (insert-char #x2207))) + + +(load (concat materus/cfg "/lsp")) diff --git a/extraFiles/config/emacs/init.el b/extraFiles/config/emacs/init.el index 56c7037..b9fd27f 100644 --- a/extraFiles/config/emacs/init.el +++ b/extraFiles/config/emacs/init.el @@ -1,4 +1,4 @@ (setq-default materus/nix-packages (require 'doom-themes nil 'noerror)) (unless materus/nix-packages (load (concat user-emacs-directory "etc/materus/packages"))) +(load (concat user-emacs-directory "etc/materus/internals")) (load (concat user-emacs-directory "etc/materus/start")) -(load (concat user-emacs-directory "etc/materus/lsp"))