Compare commits

..

No commits in common. "1d99fb630f363032fe88f1d013487ba819e093dc" and "fec28354bdd5b4a3e21a825f9f7bac5a5497249a" have entirely different histories.

7 changed files with 162 additions and 252 deletions

View File

@ -5,7 +5,7 @@ spotify-client-secret: ENC[AES256_GCM,data:TnR+zLLklTfzMdR4woaZWuMVJQ9VIYsFM588G
youtube-api: ENC[AES256_GCM,data:qmpFlFvudS9rXQfN+Th/UrPWCW0mg5GkpMucS/01AmOnlChqtojC,iv:q3bKwI2I6BNa3L9ezKCE1fWT/vZLiJ8uzug1z2z+TWA=,tag:gKG3HTz8jp2LAFh8e8O6sg==,type:str] youtube-api: ENC[AES256_GCM,data:qmpFlFvudS9rXQfN+Th/UrPWCW0mg5GkpMucS/01AmOnlChqtojC,iv:q3bKwI2I6BNa3L9ezKCE1fWT/vZLiJ8uzug1z2z+TWA=,tag:gKG3HTz8jp2LAFh8e8O6sg==,type:str]
steamladder-api: ENC[AES256_GCM,data:m30o5atqugwqn/WbXGkUq5GvqiIKQT0kSRQCtHc1Gxk/dC3YcbDvMw==,iv:duLKl1NvysD0XMaUOkl/6nclMQB6seXcQYkGMrm7K7Y=,tag:9dw+UH10uAdca5fVdlw1Mg==,type:str] steamladder-api: ENC[AES256_GCM,data:m30o5atqugwqn/WbXGkUq5GvqiIKQT0kSRQCtHc1Gxk/dC3YcbDvMw==,iv:duLKl1NvysD0XMaUOkl/6nclMQB6seXcQYkGMrm7K7Y=,tag:9dw+UH10uAdca5fVdlw1Mg==,type:str]
webarchive-accesskey: ENC[AES256_GCM,data:jdKlHsZq2Dkk1BcBfUVv5g==,iv:BXCgPb/2W57PYXxRktInz1LxSEwlw6m3xnQU4TOPMeY=,tag:kK4+InaH7K4D4n1hyGaR+w==,type:str] webarchive-accesskey: ENC[AES256_GCM,data:jdKlHsZq2Dkk1BcBfUVv5g==,iv:BXCgPb/2W57PYXxRktInz1LxSEwlw6m3xnQU4TOPMeY=,tag:kK4+InaH7K4D4n1hyGaR+w==,type:str]
webarchive-secretkey: ENC[AES256_GCM,data:t7lZ1aA72BrBxaE+jXmE3w==,iv:A8PF/MyRTIluqEzzt4uCw7eNCYDXAt4iB29PSrwlVyY=,tag:6HbtcrFeFcpagjzPXOANzA==,type:str] webarchive-secretkey: ENC[AES256_GCM,data:nuA9G5dNtrNfbcx0G/GUTg==,iv:RRuTm4kZr5dNjBt9Zvk/NVefHCZYODmRvWAqZizKGJY=,tag:J2V0Q3BzXNWifVVvAkwYyg==,type:str]
certs: ENC[AES256_GCM,data:ttmSNTTx51a3L2HTC8RnSphDLHO2OSyIgXQ0YpZGySTdu69mgEyhaiSi+IAXg/1AHKRjpFJgE4fhsLAiW78pNYb+Zg7aDL47YtABO99sTZrZnBxZo6k6itpZ3oClDch2ZALzoXChLroc0tUbZKwsfOwGe3pw9lOJZJT34AhV+BVoXDDLQcpQoxz23Baa8oxklecT6wpJ1u1nW+aAHw33gm41Vw==,iv:b0aNZwaRKBg+ipe5+19BowyFbCjZt52S738om6emYGo=,tag:lUqtcc4vVWKx/fnc19vj7A==,type:str] certs: ENC[AES256_GCM,data:ttmSNTTx51a3L2HTC8RnSphDLHO2OSyIgXQ0YpZGySTdu69mgEyhaiSi+IAXg/1AHKRjpFJgE4fhsLAiW78pNYb+Zg7aDL47YtABO99sTZrZnBxZo6k6itpZ3oClDch2ZALzoXChLroc0tUbZKwsfOwGe3pw9lOJZJT34AhV+BVoXDDLQcpQoxz23Baa8oxklecT6wpJ1u1nW+aAHw33gm41Vw==,iv:b0aNZwaRKBg+ipe5+19BowyFbCjZt52S738om6emYGo=,tag:lUqtcc4vVWKx/fnc19vj7A==,type:str]
sops: sops:
kms: [] kms: []
@ -22,8 +22,8 @@ sops:
d2dMUUh1RDB3UnpEdFJsNHpQRXFWemMKc41dlOapTsvH91QLNhdPbrzerPFakOiX d2dMUUh1RDB3UnpEdFJsNHpQRXFWemMKc41dlOapTsvH91QLNhdPbrzerPFakOiX
J/uoZDMIhsmQxgQM7Fqxr05NywhI/ZjOtJS2bayp73O57xjjMYcyNQ== J/uoZDMIhsmQxgQM7Fqxr05NywhI/ZjOtJS2bayp73O57xjjMYcyNQ==
-----END AGE ENCRYPTED FILE----- -----END AGE ENCRYPTED FILE-----
lastmodified: "2024-11-18T09:01:39Z" lastmodified: "2024-04-05T22:42:16Z"
mac: ENC[AES256_GCM,data:CVsqff1qCcxyQ0e78ewottYKgqA2rG3j1m8X0Sb8If3qibAiBMMblc8T0doB+Fg4dVhPpbJSZdCx4JiV7sHopv2wNdguXd6Xe0L8iJqWtBeHTGTxSLvJ8UIHknak9c+JeQzZz8jAkbHYUXsc7VyeJaXoQptosz1BbE74D48Xjrg=,iv:0e+etjwabJx7PXgDUoh41Ha3aziQxBlH6QJZGG02ME0=,tag:oQIf503tmFlPoLE5d8Y24w==,type:str] mac: ENC[AES256_GCM,data:KSRGzHipb58uNYaRYXAy3y+D9cBG53RGxZpNrx2gy+CHbGtkUW1SWc4PPrBwBhb6+TN0vb1zHuOB4HK4Bys/jqmvGgVkO2VKj15MTFMpF5n6w0blFM7d5bCDydHAhvXEZA/PFWq97DTI1Zxb+N/HWJlefKCzYOHHWj7i4leKNjk=,iv:88Ekp0sjEo5UTBLUyYSrkP+MbIFcCmegclJIK3+0jOQ=,tag:H/ESeQhC1PEF00RiDnamyw==,type:str]
pgp: pgp:
- created_at: "2024-03-21T22:55:36Z" - created_at: "2024-03-21T22:55:36Z"
enc: |- enc: |-

View File

@ -122,11 +122,6 @@ let
dirvish dirvish
rg rg
shfmt shfmt
mermaid-mode
ob-mermaid
visual-replace
scroll-restore
highlight-indent-guides
# Completions & Minibuffer # Completions & Minibuffer
corfu corfu
company company
@ -142,8 +137,6 @@ let
emacsEnv = pkgs.buildEnv { emacsEnv = pkgs.buildEnv {
name = "emacs-env"; name = "emacs-env";
paths = with pkgs; [ paths = with pkgs; [
plantuml
mermaid-cli
pyright pyright
shfmt shfmt
ripgrep ripgrep

View File

@ -1,86 +1,53 @@
;;; -*- lexical-binding: t; -*- ;;; -*- lexical-binding: t; -*-
;; [[file:emacs-materus-config.org::*Early Init Variables][Early Init Variables:1]] (defvar materus/init-early t) ; Var to ensure early-init loaded
(defvar materus/init-early t
"Is emacs using materus early init") ; Var to ensure early-init loaded, not used anymore but keeping it anyway
(setq materus/init-early t) ; Probably useless (setq materus/init-early t) ; Probably useless
(setenv "LSP_USE_PLISTS" "true")
(setq c-default-style nil)
(setenv "LSP_USE_PLISTS" "true") ; Make lsp-mode use plists (set-language-environment "UTF-8")
;; (setq default-input-method nil)
(setq c-default-style nil) ; Clear default styles for languages, will set them up later
(setq default-input-method nil) ; Disable default input method, I'm not using them anyway so far
(setq initial-major-mode 'fundamental-mode) ; Use fundamental mode in scratch buffer, speed up loading, not really important when emacs used as daemon
(setq auto-save-default nil) ; TODO: configure auto saves, disable for now
(setq backup-directory-alist
`((".*" . ,(concat user-emacs-directory "var/backups/")))) ; Set backup location
(setq auto-save-file-name-transforms
`((".*" ,(concat user-emacs-directory "var/recovery/") t))) ; Set auto-save location
(setq auto-save-list-file-prefix (concat user-emacs-directory "var/auto-save/sessions/")) ; Set auto-save-list location
(setq load-prefer-newer t) ; Prefer newer files to load
;; Packages
(setq package-enable-at-startup t) ; Ensure packages are enable since I'm either using built in package manager or nix
(setq package-quickstart nil) ; Disable package quickstart, it's annoying if forget to update it and doesn't speed up much
;;
(setq inhibit-compacting-font-caches t) ; Don't compact fonts
(set-language-environment "UTF-8") ; Use UTF-8
(setq custom-file (concat user-emacs-directory "etc/custom.el")) ; Set custom file location, don't want clutter in main directory
(setq custom-theme-directory
(concat user-emacs-directory "/etc/materus/themes" )) ; Set custom themes location
(setq ring-bell-function 'ignore) ; Disable bell
(defvar materus-emacs-gc-cons-threshold (* 64 1024 1024)
"The value of `gc-cons-threshold' after Emacs startup.") ; Define after init garbage collector threshold
;; Early Init Variables:1 ends here
;; [[file:emacs-materus-config.org::*Garbage Collector][Garbage Collector:1]]
(setq gc-cons-threshold most-positive-fixnum) ; Set `gc-cons-threshold' so it won't collectect during initialization
(add-hook 'emacs-startup-hook
(lambda ()
(setq gc-cons-threshold materus-emacs-gc-cons-threshold))) ; Set `gc-cons-threshold' to desired value after startup
;; Garbage Collector:1 ends here
;; [[file:emacs-materus-config.org::*Early Frame Settings][Early Frame Settings:1]]
(setq frame-inhibit-implied-resize t)
(setq frame-resize-pixelwise t)
(setq window-resize-pixelwise t) ; Allow pixelwise resizing of window and frame
(setq initial-major-mode 'fundamental-mode)
(setq native-comp-async-report-warnings-errors nil)
(setq package-enable-at-startup nil)
(unless (daemonp) (unless (daemonp)
(add-to-list 'initial-frame-alist '(fullscreen . maximized))) ; Start first frame maximized if not running as daemon, daemon frame are set up later in config (add-to-list 'initial-frame-alist '(fullscreen . maximized)))
(setq default-frame-alist ; Set default size for frames (setq default-frame-alist
'((width . 130) '((width . 130)
(height . 40))) (height . 40)))
(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)
(advice-add #'tty-run-terminal-initialization :override #'ignore) (advice-add #'tty-run-terminal-initialization :override #'ignore)
(add-hook 'window-setup-hook (add-hook 'window-setup-hook
(lambda () (lambda ()
(unless (display-graphic-p)
(advice-remove #'tty-run-terminal-initialization #'ignore) (advice-remove #'tty-run-terminal-initialization #'ignore)
(tty-run-terminal-initialization (selected-frame) nil t) (tty-run-terminal-initialization (selected-frame) nil t)
))) )
;; Early Frame Settings:1 ends here )
)
;; [[file:emacs-materus-config.org::*Native compilation][Native compilation:1]] (when (boundp 'native-comp-eln-load-path) ; Change dir for eln-cache
(setq native-comp-async-report-warnings-errors nil) ; Silence warnings (startup-redirect-eln-cache (expand-file-name "/var/eln-cache/" user-emacs-directory)))
(setq native-comp-speed 3) ; Set native-comp speed
(setq native-comp-jit-compilation t
;;native-comp-deferred-compilation t
package-native-compile t)
;; Setting up native-comp cache location
(when (and (fboundp 'startup-redirect-eln-cache) (when (and (fboundp 'startup-redirect-eln-cache)
(fboundp 'native-comp-available-p) (fboundp 'native-comp-available-p)
(native-comp-available-p)) (native-comp-available-p))
(startup-redirect-eln-cache (startup-redirect-eln-cache
(convert-standard-filename (convert-standard-filename
(concat user-emacs-directory "var/eln-cache/")))) (expand-file-name "var/eln-cache/" user-emacs-directory))))
;; Native compilation:1 ends here
(setq auto-save-default nil)
(setq backup-directory-alist
`((".*" . ,(concat user-emacs-directory "var/backups/")))) ; Change backup and auto save dir to var dir
(setq auto-save-file-name-transforms
`((".*" ,(concat user-emacs-directory "var/recovery/") t)))
(setq auto-save-list-file-prefix (concat user-emacs-directory "var/auto-save/sessions/"))
(setq custom-file (concat user-emacs-directory "etc/custom.el"))

View File

@ -3,18 +3,11 @@
#+DESCRIPTION: materus emacs configuration #+DESCRIPTION: materus emacs configuration
#+STARTUP: overview #+STARTUP: overview
#+PROPERTY: header-args :tangle etc/materus/emacs-config.el :comments link #+PROPERTY: header-args :tangle etc/materus/emacs-config.el :comments link
#+OPTIONS: \n:t
#+auto_tangle: t #+auto_tangle: t
My emacs config, tangled file is [[file:etc/materus/emacs-config.el][there]] My emacs config, tangled file is [[file:etc/materus/emacs-config.el][there]]
* Table of Contents :noexport:TOC_3: * Table of Contents :noexport:TOC_3:
- [[#init-files][Init Files]] - [[#init-files][Init Files]]
- [[#early-init][Early Init]] - [[#early-init][Early Init]]
- [[#early-init-variables][Early Init Variables]]
- [[#garbage-collector][Garbage Collector]]
- [[#early-frame-settings][Early Frame Settings]]
- [[#native-compilation][Native compilation]]
- [[#init][Init]] - [[#init][Init]]
- [[#compile-time][Compile Time]] - [[#compile-time][Compile Time]]
- [[#packages][Packages]] - [[#packages][Packages]]
@ -61,134 +54,85 @@ My emacs config, tangled file is [[file:etc/materus/emacs-config.el][there]]
* Init Files * Init Files
** Early Init ** Early Init
:PROPERTIES: :PROPERTIES:
:header-args: :tangle early-init.el :comments link :header-args: :tangle early-init.el
:END: :END:
Early init file, setting for GC and some paths. Early init file, setting for GC and some paths.
Tangled file is [[./early-init.el][there]]
#+begin_src emacs-lisp :comments no #+begin_src emacs-lisp :comments no
;;; -*- lexical-binding: t; -*- ;;; -*- lexical-binding: t; -*-
#+end_src #+end_src
*** Early Init Variables
Setting early init variables
#+begin_src emacs-lisp #+begin_src emacs-lisp
(defvar materus/init-early t
"Is emacs using materus early init") ; Var to ensure early-init loaded, not used anymore but keeping it anyway (defvar materus/init-early t) ; Var to ensure early-init loaded
(setq materus/init-early t) ; Probably useless (setq materus/init-early t) ; Probably useless
(setenv "LSP_USE_PLISTS" "true")
(setq c-default-style nil)
(setenv "LSP_USE_PLISTS" "true") ; Make lsp-mode use plists (set-language-environment "UTF-8")
;; (setq default-input-method nil)
(setq c-default-style nil) ; Clear default styles for languages, will set them up later
(setq default-input-method nil) ; Disable default input method, I'm not using them anyway so far
(setq initial-major-mode 'fundamental-mode) ; Use fundamental mode in scratch buffer, speed up loading, not really important when emacs used as daemon
(setq auto-save-default nil) ; TODO: configure auto saves, disable for now
(setq backup-directory-alist
`((".*" . ,(concat user-emacs-directory "var/backups/")))) ; Set backup location
(setq auto-save-file-name-transforms
`((".*" ,(concat user-emacs-directory "var/recovery/") t))) ; Set auto-save location
(setq auto-save-list-file-prefix (concat user-emacs-directory "var/auto-save/sessions/")) ; Set auto-save-list location
(setq load-prefer-newer t) ; Prefer newer files to load
;; Packages
(setq package-enable-at-startup t) ; Ensure packages are enable since I'm either using built in package manager or nix
(setq package-quickstart nil) ; Disable package quickstart, it's annoying if forget to update it and doesn't speed up much
;;
(setq inhibit-compacting-font-caches t) ; Don't compact fonts
(set-language-environment "UTF-8") ; Use UTF-8
(setq custom-file (concat user-emacs-directory "etc/custom.el")) ; Set custom file location, don't want clutter in main directory
(setq custom-theme-directory
(concat user-emacs-directory "/etc/materus/themes" )) ; Set custom themes location
(setq ring-bell-function 'ignore) ; Disable bell
(defvar materus-emacs-gc-cons-threshold (* 64 1024 1024)
"The value of `gc-cons-threshold' after Emacs startup.") ; Define after init garbage collector threshold
#+end_src
*** Garbage Collector
Settings for garbage collector
#+begin_src emacs-lisp
(setq gc-cons-threshold most-positive-fixnum) ; Set `gc-cons-threshold' so it won't collectect during initialization
(add-hook 'emacs-startup-hook
(lambda ()
(setq gc-cons-threshold materus-emacs-gc-cons-threshold))) ; Set `gc-cons-threshold' to desired value after startup
#+end_src
*** Early Frame Settings
Early frame settings, maybe some could be move to normal init
#+begin_src emacs-lisp
(setq frame-inhibit-implied-resize t)
(setq frame-resize-pixelwise t)
(setq window-resize-pixelwise t) ; Allow pixelwise resizing of window and frame
(setq initial-major-mode 'fundamental-mode)
(setq native-comp-async-report-warnings-errors nil)
(setq package-enable-at-startup nil)
(unless (daemonp) (unless (daemonp)
(add-to-list 'initial-frame-alist '(fullscreen . maximized))) ; Start first frame maximized if not running as daemon, daemon frame are set up later in config (add-to-list 'initial-frame-alist '(fullscreen . maximized)))
(setq default-frame-alist ; Set default size for frames (setq default-frame-alist
'((width . 130) '((width . 130)
(height . 40))) (height . 40)))
(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)
(advice-add #'tty-run-terminal-initialization :override #'ignore) (advice-add #'tty-run-terminal-initialization :override #'ignore)
(add-hook 'window-setup-hook (add-hook 'window-setup-hook
(lambda () (lambda ()
(unless (display-graphic-p)
(advice-remove #'tty-run-terminal-initialization #'ignore) (advice-remove #'tty-run-terminal-initialization #'ignore)
(tty-run-terminal-initialization (selected-frame) nil t) (tty-run-terminal-initialization (selected-frame) nil t)
))) )
#+end_src )
*** Native compilation )
#+begin_src emacs-lisp
(setq native-comp-async-report-warnings-errors nil) ; Silence warnings
(setq native-comp-speed 3) ; Set native-comp speed
(setq native-comp-jit-compilation t (when (boundp 'native-comp-eln-load-path) ; Change dir for eln-cache
;;native-comp-deferred-compilation t (startup-redirect-eln-cache (expand-file-name "/var/eln-cache/" user-emacs-directory)))
package-native-compile t)
;; Setting up native-comp cache location
(when (and (fboundp 'startup-redirect-eln-cache) (when (and (fboundp 'startup-redirect-eln-cache)
(fboundp 'native-comp-available-p) (fboundp 'native-comp-available-p)
(native-comp-available-p)) (native-comp-available-p))
(startup-redirect-eln-cache (startup-redirect-eln-cache
(convert-standard-filename (convert-standard-filename
(concat user-emacs-directory "var/eln-cache/")))) (expand-file-name "var/eln-cache/" user-emacs-directory))))
(setq auto-save-default nil)
(setq backup-directory-alist
`((".*" . ,(concat user-emacs-directory "var/backups/")))) ; Change backup and auto save dir to var dir
(setq auto-save-file-name-transforms
`((".*" ,(concat user-emacs-directory "var/recovery/") t)))
(setq auto-save-list-file-prefix (concat user-emacs-directory "var/auto-save/sessions/"))
(setq custom-file (concat user-emacs-directory "etc/custom.el"))
#+end_src #+end_src
** Init ** Init
:PROPERTIES: :PROPERTIES:
:header-args: :tangle init.el :comments link :header-args: :tangle init.el
:END: :END:
Init File, tangled [[./init.el][there]] Init File
Checking if using emacs from my nix config, loads config and custom.el Checking if using emacs from my nix config (not used anymore, might use in future), loads config and custom.el
Sets up package.el
#+begin_src emacs-lisp :comments no #+begin_src emacs-lisp :comments no
;;; -*- lexical-binding: t; -*- ;;; -*- lexical-binding: t; -*-
#+end_src #+end_src
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq-default materus/use-nix-packages (require 'materus-config nil 'noerror)) (setq-default materus/use-nix-packages (require 'materus-config nil 'noerror))
(require 'cl-lib) (unless (file-directory-p (concat user-emacs-directory "var/quickstart"))
(require 'package) (make-directory (concat user-emacs-directory "var/quickstart") t))
(add-to-list 'load-path (concat user-emacs-directory "etc/materus/extra")) ; Extra load path for packages
(setq package-user-dir (concat user-emacs-directory "var/elpa/" emacs-version "/" )) ; Set elpa path for this emacs version, should use nix packages anyway so keeping just in case
(setq package-gnupghome-dir (concat user-emacs-directory "var/elpa/gnupg/" )) ; Set path to gnupg for elpa
(add-to-list 'package-archives
'("nongnu-devel" . "https://elpa.nongnu.org/nongnu-devel/")) ; Add nongnu-devel repo to package manager
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) ; Add melpa repo to package manager
(customize-set-variable 'package-archive-priorities '(("gnu" . 99)
("nongnu" . 80)
("nongnu-devel" . 70)
("melpa" . 0))) ; Repository priority
(load (concat user-emacs-directory "etc/materus/nix-init") t) (load (concat user-emacs-directory "etc/materus/nix-init") t)
(load (concat user-emacs-directory "etc/materus/emacs-config")) (load (concat user-emacs-directory "etc/materus/emacs-config"))
(load custom-file t) (load custom-file t)
#+end_src #+end_src
** Compile Time ** Compile Time
Some defvar so native-compile wont complain
#+begin_src emacs-lisp :comments no #+begin_src emacs-lisp :comments no
;;; -*- lexical-binding: t; -*- ;;; -*- lexical-binding: t; -*-
#+end_src #+end_src
@ -208,7 +152,14 @@ Package manager config if not using nix.
After some testing default package manager works best for me. After some testing default package manager works best for me.
** Init package manager config ** Init package manager config
#+begin_src emacs-lisp #+begin_src emacs-lisp
(require 'cl-lib)
(require 'package)
(setq package-user-dir (concat user-emacs-directory "var/elpa/" emacs-version "/" ))
(setq package-gnupghome-dir (concat user-emacs-directory "var/elpa/gnupg/" ))
(add-to-list 'load-path (concat user-emacs-directory "etc/materus/extra"))
(add-to-list 'package-archives '("nongnu-devel" . "https://elpa.nongnu.org/nongnu-devel/"))
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
#+end_src #+end_src
** Packages list & function ** Packages list & function
Packages to install Packages to install
@ -330,7 +281,9 @@ Packages to install
(package-refresh-contents) (package-refresh-contents)
(dolist (p materus/packages) (dolist (p materus/packages)
(when (not (package-installed-p p)) (when (not (package-installed-p p))
(package-install p))))) (package-install p)))
(package-quickstart-refresh)))
(package-initialize)
(unless materus/use-nix-packages (unless materus/use-nix-packages
(materus/install-packages)) (materus/install-packages))
#+end_src #+end_src
@ -348,6 +301,8 @@ Set up no littering
(recentf-expand-file-name no-littering-var-directory)) (recentf-expand-file-name no-littering-var-directory))
(add-to-list 'recentf-exclude (add-to-list 'recentf-exclude
(recentf-expand-file-name no-littering-etc-directory))) (recentf-expand-file-name no-littering-etc-directory)))
(setq custom-theme-directory (concat user-emacs-directory "etc/themes"))
(add-to-list 'custom-theme-load-path custom-theme-directory)
#+end_src #+end_src
** Graphical ** Graphical
Graphical related settings. Graphical related settings.
@ -368,22 +323,22 @@ Graphical related settings.
(lambda (frame) (when (= (length (frame-list)) 2) (lambda (frame) (when (= (length (frame-list)) 2)
(set-frame-parameter frame 'fullscreen 'maximized))))) (set-frame-parameter frame 'fullscreen 'maximized)))))
(setq frame-inhibit-implied-resize t)
(setq frame-resize-pixelwise t)
(setq window-resize-pixelwise t)
(when (display-graphic-p) (when (display-graphic-p)
(set-frame-font "Hack Nerd Font" nil t) (set-frame-font "Hack Nerd Font" nil t)
) )
(setq-default display-line-numbers-width 3) (setq-default display-line-numbers-width 3)
(setq-default display-line-numbers-widen t)
(setq truncate-string-ellipsis "…")
(global-tab-line-mode 1) (global-tab-line-mode 1)
(tool-bar-mode -1) (tool-bar-mode -1)
(setq window-divider-default-bottom-width 1)
(setq window-divider-default-right-width 1)
(window-divider-mode 1)
(setq read-process-output-max (* 1024 1024 3))
(setq ring-bell-function 'ignore)
(setq-default cursor-type '(bar . 1)) (setq-default cursor-type '(bar . 1))
;; Rainbow mode ;; Rainbow mode
(use-package rainbow-mode (use-package rainbow-mode
@ -395,10 +350,12 @@ Graphical related settings.
(use-package rainbow-delimiters :hook (use-package rainbow-delimiters :hook
(prog-mode . rainbow-delimiters-mode) (prog-mode . rainbow-delimiters-mode)
:config :config
(set-face-attribute 'rainbow-delimiters-depth-1-face nil :foreground "#FFFFFF") (custom-set-faces
(set-face-attribute 'rainbow-delimiters-depth-2-face nil :foreground "#FFFF00") '(rainbow-delimiters-depth-1-face ((t (:foreground "#FFFFFF"))))
(set-face-attribute 'rainbow-delimiters-depth-5-face nil :foreground "#6A5ACD") '(rainbow-delimiters-depth-2-face ((t (:foreground "#FFFF00"))))
(set-face-attribute 'rainbow-delimiters-unmatched-face nil :foreground "#FF0000")) '(rainbow-delimiters-depth-5-face ((t (:foreground "#6A5ACD"))))
'(rainbow-delimiters-unmatched-face ((t (:foreground "#FF0000")))))
)
;; Nerd Icons ;; Nerd Icons
(use-package nerd-icons) (use-package nerd-icons)
(use-package nerd-icons-completion (use-package nerd-icons-completion
@ -619,7 +576,7 @@ Other configs
(use-package dap-gdb-lldb) (use-package dap-gdb-lldb)
(setq read-process-output-max (* 1024 1024 3))
(defun lsp-booster--advice-json-parse (old-fn &rest args) (defun lsp-booster--advice-json-parse (old-fn &rest args)
"Try to parse bytecode instead of json." "Try to parse bytecode instead of json."
@ -639,13 +596,13 @@ Other configs
(defun lsp-booster--advice-final-command (old-fn cmd &optional test?) (defun lsp-booster--advice-final-command (old-fn cmd &optional test?)
"Prepend emacs-lsp-booster command to lsp CMD." "Prepend emacs-lsp-booster command to lsp CMD."
(let ((orig-result (funcall old-fn cmd test?))) (let ((orig-result (funcall old-fn cmd test?)))
(if (and (not test?) ; for check lsp-server-present? (if (and (not test?) ;; for check lsp-server-present?
(not (file-remote-p default-directory)) ; see lsp-resolve-final-command, it would add extra shell wrapper (not (file-remote-p default-directory)) ;; see lsp-resolve-final-command, it would add extra shell wrapper
lsp-use-plists lsp-use-plists
(not (functionp 'json-rpc-connection)) ; native json-rpc (not (functionp 'json-rpc-connection)) ;; native json-rpc
(executable-find "emacs-lsp-booster")) (executable-find "emacs-lsp-booster"))
(progn (progn
(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)) (cons "emacs-lsp-booster" orig-result))
@ -705,6 +662,7 @@ Other configs
(use-package lsp-pyright) (use-package lsp-pyright)
(setq lsp-pyright-langserver-command "pyright") (setq lsp-pyright-langserver-command "pyright")
(add-hook 'python-mode-hook 'lsp-deferred) (add-hook 'python-mode-hook 'lsp-deferred)
#+end_src #+end_src
** Java ** Java
#+begin_src emacs-lisp #+begin_src emacs-lisp
@ -817,12 +775,8 @@ Just for testing some code
#+begin_src emacs-lisp #+begin_src emacs-lisp
;;; (global-set-key (kbd "C-∇") (kbd "C-H")) ;;; (global-set-key (kbd "C-∇") (kbd "C-H"))
;;; (global-set-key (kbd "H-∇") (lambda () (interactive) (insert-char #x2207))) ;;; (global-set-key (kbd "H-∇") (lambda () (interactive) (insert-char #x2207)))
;;; (keymap-set corfu--mouse-ignore-map "<mouse-movement>" 'ignore)
;;; (keymap-set corfu-map "<mouse-movement>" 'ignore)
;;; (buffer-text-pixel-size)
;;; (set-window-vscroll nil 960 t t)
;;; (set-window-margins (selected-window) 0 0)
;;; (setq completion-styles '(orderless basic) ;;; (setq completion-styles '(orderless basic)
;;; completion-category-defaults nil ;;; completion-category-defaults nil

View File

@ -13,7 +13,14 @@
;; Compile Time:2 ends here ;; Compile Time:2 ends here
;; [[file:../../emacs-materus-config.org::*Init package manager config][Init package manager config:1]] ;; [[file:../../emacs-materus-config.org::*Init package manager config][Init package manager config:1]]
(require 'cl-lib)
(require 'package)
(setq package-user-dir (concat user-emacs-directory "var/elpa/" emacs-version "/" ))
(setq package-gnupghome-dir (concat user-emacs-directory "var/elpa/gnupg/" ))
(add-to-list 'load-path (concat user-emacs-directory "etc/materus/extra"))
(add-to-list 'package-archives '("nongnu-devel" . "https://elpa.nongnu.org/nongnu-devel/"))
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
;; Init package manager config:1 ends here ;; Init package manager config:1 ends here
;; [[file:../../emacs-materus-config.org::*Packages list & function][Packages list & function:1]] ;; [[file:../../emacs-materus-config.org::*Packages list & function][Packages list & function:1]]
@ -134,7 +141,9 @@
(package-refresh-contents) (package-refresh-contents)
(dolist (p materus/packages) (dolist (p materus/packages)
(when (not (package-installed-p p)) (when (not (package-installed-p p))
(package-install p))))) (package-install p)))
(package-quickstart-refresh)))
(package-initialize)
(unless materus/use-nix-packages (unless materus/use-nix-packages
(materus/install-packages)) (materus/install-packages))
;; Packages list & function:1 ends here ;; Packages list & function:1 ends here
@ -149,6 +158,8 @@
(recentf-expand-file-name no-littering-var-directory)) (recentf-expand-file-name no-littering-var-directory))
(add-to-list 'recentf-exclude (add-to-list 'recentf-exclude
(recentf-expand-file-name no-littering-etc-directory))) (recentf-expand-file-name no-littering-etc-directory)))
(setq custom-theme-directory (concat user-emacs-directory "etc/themes"))
(add-to-list 'custom-theme-load-path custom-theme-directory)
;; No Littering:1 ends here ;; No Littering:1 ends here
;; [[file:../../emacs-materus-config.org::*Mouse][Mouse:1]] ;; [[file:../../emacs-materus-config.org::*Mouse][Mouse:1]]
@ -167,22 +178,22 @@
(lambda (frame) (when (= (length (frame-list)) 2) (lambda (frame) (when (= (length (frame-list)) 2)
(set-frame-parameter frame 'fullscreen 'maximized))))) (set-frame-parameter frame 'fullscreen 'maximized)))))
(setq frame-inhibit-implied-resize t)
(setq frame-resize-pixelwise t)
(setq window-resize-pixelwise t)
(when (display-graphic-p) (when (display-graphic-p)
(set-frame-font "Hack Nerd Font" nil t) (set-frame-font "Hack Nerd Font" nil t)
) )
(setq-default display-line-numbers-width 3) (setq-default display-line-numbers-width 3)
(setq-default display-line-numbers-widen t)
(setq truncate-string-ellipsis "")
(global-tab-line-mode 1) (global-tab-line-mode 1)
(tool-bar-mode -1) (tool-bar-mode -1)
(setq window-divider-default-bottom-width 1)
(setq window-divider-default-right-width 1)
(window-divider-mode 1)
(setq read-process-output-max (* 1024 1024 3))
(setq ring-bell-function 'ignore)
(setq-default cursor-type '(bar . 1)) (setq-default cursor-type '(bar . 1))
;; Rainbow mode ;; Rainbow mode
(use-package rainbow-mode (use-package rainbow-mode
@ -194,10 +205,12 @@
(use-package rainbow-delimiters :hook (use-package rainbow-delimiters :hook
(prog-mode . rainbow-delimiters-mode) (prog-mode . rainbow-delimiters-mode)
:config :config
(set-face-attribute 'rainbow-delimiters-depth-1-face nil :foreground "#FFFFFF") (custom-set-faces
(set-face-attribute 'rainbow-delimiters-depth-2-face nil :foreground "#FFFF00") '(rainbow-delimiters-depth-1-face ((t (:foreground "#FFFFFF"))))
(set-face-attribute 'rainbow-delimiters-depth-5-face nil :foreground "#6A5ACD") '(rainbow-delimiters-depth-2-face ((t (:foreground "#FFFF00"))))
(set-face-attribute 'rainbow-delimiters-unmatched-face nil :foreground "#FF0000")) '(rainbow-delimiters-depth-5-face ((t (:foreground "#6A5ACD"))))
'(rainbow-delimiters-unmatched-face ((t (:foreground "#FF0000")))))
)
;; Nerd Icons ;; Nerd Icons
(use-package nerd-icons) (use-package nerd-icons)
(use-package nerd-icons-completion (use-package nerd-icons-completion
@ -410,7 +423,7 @@
(use-package dap-gdb-lldb) (use-package dap-gdb-lldb)
(setq read-process-output-max (* 1024 1024 3))
(defun lsp-booster--advice-json-parse (old-fn &rest args) (defun lsp-booster--advice-json-parse (old-fn &rest args)
"Try to parse bytecode instead of json." "Try to parse bytecode instead of json."
@ -430,13 +443,13 @@
(defun lsp-booster--advice-final-command (old-fn cmd &optional test?) (defun lsp-booster--advice-final-command (old-fn cmd &optional test?)
"Prepend emacs-lsp-booster command to lsp CMD." "Prepend emacs-lsp-booster command to lsp CMD."
(let ((orig-result (funcall old-fn cmd test?))) (let ((orig-result (funcall old-fn cmd test?)))
(if (and (not test?) ; for check lsp-server-present? (if (and (not test?) ;; for check lsp-server-present?
(not (file-remote-p default-directory)) ; see lsp-resolve-final-command, it would add extra shell wrapper (not (file-remote-p default-directory)) ;; see lsp-resolve-final-command, it would add extra shell wrapper
lsp-use-plists lsp-use-plists
(not (functionp 'json-rpc-connection)) ; native json-rpc (not (functionp 'json-rpc-connection)) ;; native json-rpc
(executable-find "emacs-lsp-booster")) (executable-find "emacs-lsp-booster"))
(progn (progn
(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)) (cons "emacs-lsp-booster" orig-result))
@ -601,12 +614,8 @@
;; [[file:../../emacs-materus-config.org::*Test][Test:1]] ;; [[file:../../emacs-materus-config.org::*Test][Test:1]]
;;; (global-set-key (kbd "C-∇") (kbd "C-H")) ;;; (global-set-key (kbd "C-∇") (kbd "C-H"))
;;; (global-set-key (kbd "H-∇") (lambda () (interactive) (insert-char #x2207))) ;;; (global-set-key (kbd "H-∇") (lambda () (interactive) (insert-char #x2207)))
;;; (keymap-set corfu--mouse-ignore-map "<mouse-movement>" 'ignore)
;;; (keymap-set corfu-map "<mouse-movement>" 'ignore)
;;; (buffer-text-pixel-size)
;;; (set-window-vscroll nil 960 t t)
;;; (set-window-margins (selected-window) 0 0)
;;; (setq completion-styles '(orderless basic) ;;; (setq completion-styles '(orderless basic)
;;; completion-category-defaults nil ;;; completion-category-defaults nil

View File

@ -35,12 +35,12 @@
;; To enable, M-x corfu-mouse-mode. ;; To enable, M-x corfu-mouse-mode.
;; Modified to support pixel-scroll-precision-mode and fixed adding spaces ;; Modified to support pixel-scroll-precision-mode
;;; Code: ;;; Code:
(require 'corfu) (require 'corfu)
(make-gdb-table)
(defgroup corfu-mouse nil (defgroup corfu-mouse nil
"Mouse support for Corfu." "Mouse support for Corfu."
:group 'corfu :group 'corfu
@ -78,17 +78,18 @@
(defun corfu-mouse--format-candidates (fcands) (defun corfu-mouse--format-candidates (fcands)
"Format candidates. "Format candidates.
FCANDS is the return value of `corfu--format-candidates'." FCANDS is the return value of `corfu--format-candidates'."
(let ((index corfu--scroll) (let ((index corfu--scroll)
(cands (caddr fcands))) (cands (caddr fcands)))
(while cands (while cands
(let ((line (car cands))) (let ((line (car cands)))
;; Append necessary amount of spaces to make it as wide as the ;; Append necessary amount of spaces to make it as wide as the
;; popup. ;; popup.
(let ((strlen (- (cadr fcands) (string-width line)))) (setq line (concat line (make-string (- (cadr fcands)
(when (> strlen 0) (string-width line))
(setq line (concat line (make-string strlen ? ))))) ? )))
(add-text-properties 0 (length line) (add-text-properties 0 (length line)
`(mouse-face `(mouse-face
corfu-mouse corfu-mouse

View File

@ -1,22 +1,8 @@
;;; -*- lexical-binding: t; -*- ;;; -*- lexical-binding: t; -*-
;; [[file:emacs-materus-config.org::*Init][Init:2]]
(setq-default materus/use-nix-packages (require 'materus-config nil 'noerror)) (setq-default materus/use-nix-packages (require 'materus-config nil 'noerror))
(require 'cl-lib) (unless (file-directory-p (concat user-emacs-directory "var/quickstart"))
(require 'package) (make-directory (concat user-emacs-directory "var/quickstart") t))
(add-to-list 'load-path (concat user-emacs-directory "etc/materus/extra")) ; Extra load path for packages
(setq package-user-dir (concat user-emacs-directory "var/elpa/" emacs-version "/" )) ; Set elpa path for this emacs version, should use nix packages anyway so keeping just in case
(setq package-gnupghome-dir (concat user-emacs-directory "var/elpa/gnupg/" )) ; Set path to gnupg for elpa
(add-to-list 'package-archives
'("nongnu-devel" . "https://elpa.nongnu.org/nongnu-devel/")) ; Add nongnu-devel repo to package manager
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) ; Add melpa repo to package manager
(customize-set-variable 'package-archive-priorities '(("gnu" . 99)
("nongnu" . 80)
("nongnu-devel" . 70)
("melpa" . 0))) ; Repository priority
(load (concat user-emacs-directory "etc/materus/nix-init") t) (load (concat user-emacs-directory "etc/materus/nix-init") t)
(load (concat user-emacs-directory "etc/materus/emacs-config")) (load (concat user-emacs-directory "etc/materus/emacs-config"))
(load custom-file t) (load custom-file t)
;; Init:2 ends here