nixos-config/extraFiles/config/emacs/emacs-materus-config.org

1 line
16 KiB
Org Mode
Raw Normal View History

2024-11-10 13:02:42 +01:00
#+TITLE: Materus Emacs Cfg #+DESCRIPTION: materus emacs configuration #+STARTUP: overview #+AUTHOR: materus #+LANGUAGE: en #+PROPERTY: header-args :tangle etc/materus/emacs-config.el #+auto_tangle: t * Table of Contents :noexport:TOC_3_gh: - [[#init-files][Init Files]] - [[#early-init][Early Init]] - [[#init][Init]] - [[#byte-compile][Byte compile]] - [[#packages][Packages]] - [[#init-1][Init]] - [[#packages-1][Packages]] - [[#configuration][Configuration]] - [[#no-littering][No Littering]] - [[#graphical][Graphical]] - [[#mouse][Mouse]] - [[#misc][Misc]] - [[#dashboard][Dashboard]] - [[#modeline][Modeline]] - [[#org-mode][Org-mode]] - [[#completions][Completions]] - [[#minibuffer][Minibuffer]] - [[#company][Company]] - [[#miscellaneous][Miscellaneous]] - [[#defaults][Defaults]] - [[#elcord][Elcord]] - [[#undo-tree][Undo-Tree]] - [[#projectile][Projectile]] - [[#treemacs][Treemacs]] - [[#programming][Programming]] - [[#lsp][LSP]] - [[#nix][Nix]] - [[#emacs-lisp][Emacs Lisp]] - [[#cc][C/C++]] - [[#java][Java]] - [[#keybindings][Keybindings]] - [[#test][Test]] * Init Files ** Early Init :PROPERTIES: :header-args: :tangle early-init.el :END: Early init file, setting for GC and some paths. #+begin_src emacs-lisp (defvar materus/init-early t) ; Var to ensure early-init loaded (setq materus/init-early t) ; Probably useless (setq initial-major-mode 'fundamental-mode) (setq native-comp-async-report-warnings-errors nil) (setq package-enable-at-startup nil) (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) (add-hook 'window-setup-hook (lambda () (advice-remove #'tty-run-terminal-initialization #'ignore) (tty-run-terminal-initialization (selected-frame) nil t) ) ) ) (when (boundp 'native-comp-eln-load-path) ; Change dir for eln-cache (startup-redirect-eln-cache (expand-file-name "/var/eln-cache/" user-emacs-directory))) (when (and (fboundp 'startup-redirect-eln-cache) (fboundp 'native-comp-available-p) (native-comp-available-p)) (startup-redirect-eln-cache (convert-standard-filename (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 ** Init :PROPERTIES: :header-args: :tangle init.el :END: Init File Checking if using emacs from nix package, loads config and custom.el #+begin_src emacs-lisp (setq-default materus/use-nix-packages (require 'materus-config nil 'noerror)) (cua-mode 0) ; To load cua variables/functions but not set it up yet (load (concat user-emacs-directory "etc/materus/emacs-config")) (when (file-exists-p custom-file) (load custom-file)) #+end_src ** Byte compile #+begin_src emacs-lisp (unless (file-exists-p (concat user-emacs-directory "etc/materus/emacs-config.elc")) (byte-compile-file (concat user-emacs-directory "etc/materus/emacs-config.el"))) (unless (file-exists-p (concat user-emacs-directory "init.elc")) (byte-compile-file (concat user-emacs-directory "init.el"))) (unless (file-exists-p (concat user-emacs-directory "early-init.elc")) (byte-compile-file (concat user-emacs-directory "early-init.el"))) #+end_src * Packages