;;; init.el --- .Emacs Configuration -*- lexical-binding: t -*- ;;; Commentary: ;; ;; Emacs!!! ;;; Code: ;; Without this comment emacs25 adds (package-initialize) here ;; (package-initialize) ;;; Time Mark (setq emacs-load-start-time (current-time)) (setq package-check-signature 'allow-unsigned) ;;; Fix TLS emacs 26.x (if (version<= emacs-version "26.2") (setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")) ;;; Welcome message (setq-default initial-scratch-message (concat ";; Happy hacking, " user-login-name " - Emacs loves you!\n\n")) (defvar before-user-init-time (current-time) "Value of `current-time' when Emacs begins loading `user-init-file'.") ;;; Garbage Collector (progn ;; Set this to true to find GC issues. (setq garbage-collection-messages nil) ;; Increase the gc-cons-threshold to a very high number to decrease ;; the load and compile time. The value will be decreased ;; significantly after initialization to avoid long GC pauses during ;; normal usage. (setq gc-cons-threshold 402653184 gc-cons-percentage 0.6) (setq read-process-output-max (* 1024 1024)) ;; 1mb ;; Reset GC to normal values. (add-hook 'emacs-startup-hook (lambda () (message "[STARTUP] Loading %s...done (%.3fs)" user-init-file (float-time (time-subtract (current-time) before-user-init-time))) (when init-file-debug (message "Rolling back GC settings to sane values.")) (setq gc-cons-threshold 16777216 gc-cons-percentage 0.1)))) ;;; Modules directory (push (concat user-emacs-directory "lisp") load-path) ;;;------------------------------ ;;; Features ;;;------------------------------ ;;; https://stackoverflow.com/questions/2816019/in-lisp-avoid-cannot-open-load-file-when-using-require ;; @see https://www.reddit.com/r/emacs/comments/3kqt6e/2_easy_little_known_steps_to_speed_up_emacs_start/ ;; Normally file-name-handler-alist is set to ;; (("\\`/[^/]*\\'" . tramp-completion-file-name-handler) ;; ("\\`/[^/|:][^/|]*:" . tramp-file-name-handler) ;; ("\\`/:" . file-name-non-special)) ;; Which means on every .el and .elc file loaded during start up, it has to runs those regexps against the filename. (let* ((file-name-handler-alist nil)) ;; package-initialize' takes 35% of startup time ;; need check https://github.com/hlissner/doom-emacs/wiki/FAQ#how-is-dooms-startup-so-fast for solution (require 'init-security) (require 'init-elpa) ;; theme (require 'init-theme) ;; Utils (require 'init-utils) ;; GUI (require 'init-nlinum) (require 'init-gui) (require 'init-editing-utils) (require 'init-modeline) ;; Tools (require 'init-flycheck) ;; Languages (require 'init-markdown) (require 'init-python) (require 'init-pkgbuild) (require 'init-php) (require 'init-less) (require 'init-sass) (require 'init-scss) ;; Plus (require 'init-rainbow) ) ;;; Custom variables (setq custom-file (expand-file-name "custom.el" user-emacs-directory)) ;;; Loads custom file (when (file-exists-p custom-file) (load custom-file)) ;;; Settings (setq settings-file (expand-file-name "settings.el" user-emacs-directory)) ;;; Loads settings file (when (file-exists-p custom-file) (load settings-file)) ;; enable erase-buffer command (put 'erase-buffer 'disabled nil) (provide 'init) ;; Local Variables: ;; byte-compile-warnings: (not free-vars) ;; End: ;;; init.el ends here