My attempt to optimize my emacs load time <1 second
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.8 KiB

  1. ;; -*- lexical-binding: t; -*-
  2. ;;; custom-init --- Provide custom basic init for emacs
  3. (defvar backup-dir (expand-file-name "~/.emacs.d/backup/"))
  4. (defvar autosave-dir (expand-file-name "~/.emacs.d/autosave/"))
  5. (cond ((member "PragmataPro Liga" (font-family-list))
  6. (set-face-attribute 'default nil :font "PragmataPro Liga-12")))
  7. (setq initial-scratch-message nil
  8. backup-directory-alist (list (cons ".*" backup-dir))
  9. auto-save-list-file-prefix autosave-dir
  10. auto-save-file-name-transforms `((".*" ,autosave-dir t)))
  11. ;; Turn off the menus, scrollbars, and toolbars
  12. (menu-bar-mode 0)
  13. (scroll-bar-mode 0)
  14. (tool-bar-mode 0)
  15. (horizontal-scroll-bar-mode 0)
  16. ;; Revert to file on disk if it changes
  17. (global-auto-revert-mode t)
  18. ;; Highlight the current line
  19. (global-hl-line-mode t)
  20. ;; Show the column number after the line number (i.e. 50:57)
  21. (column-number-mode t)
  22. ;; C-c <left>|<right> to undo|redo window changes like adding buffers.
  23. (winner-mode t)
  24. ;; Show matching paren
  25. (show-paren-mode t)
  26. ;; Indent w/spaces only
  27. (setq indent-tabs-mode nil)
  28. ;; Prevent stale elisp bytecode
  29. (setq load-prefer-newer t)
  30. ;; Add newline on save
  31. (setq require-final-newline t)
  32. ;; C-c to copy in Linux can be pasted in emacs
  33. (setq select-enable-clipboard t)
  34. ;; after mouse selection can be pasted in emacs
  35. (setq select-enable-primary t)
  36. ;; Paste at current point, not mouse location when "middle-clicking"
  37. (setq mouse-yank-at-point t)
  38. (add-hook 'before-save-hook 'delete-trailing-whitespace)
  39. ;; Set auth source
  40. ;; (setq auth-sources '("~/.authinfo.gpg"))
  41. (defalias 'yes-or-no-p 'y-or-n-p)
  42. (setq browse-url-generic-program "brave"
  43. browse-url-browser-function 'browse-url-generic)
  44. (defun display-startup-echo-area-message ()
  45. "Display startup echo area message."
  46. (message "Initialized in %s" (emacs-init-time)))
  47. (provide 'custom-init)