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.

71 lines
2.2 KiB

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