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.
 
 

84 lines
2.7 KiB

;;; 04-custom-init --- Provide custom basic init for emacs
;;; Commentary:
;;; Code:
(defvar backup-dir (expand-file-name "~/.emacs.d/backup/") "Set the default location of file backups.")
;; (defvar autosave-dir (expand-file-name "~/.emacs.d/autosave/") "Set the default location of autosaves.")
(cond ((member "PragmataPro Liga" (font-family-list))
(set-face-attribute 'default nil :font "PragmataPro Liga-16")))
(setq-default initial-scratch-message nil
backup-directory-alist (list (cons ".*" backup-dir))
inhibit-startup-screen t
;; auto-save-list-file-prefix autosave-dir
;; auto-save-file-name-transforms `((".*" ,autosave-dir t))
)
;; Turn off the menus, scrollbars, and toolbars
(menu-bar-mode 0)
(scroll-bar-mode 0)
(tool-bar-mode 0)
(horizontal-scroll-bar-mode 0)
;; Revert to file on disk if it changes
(global-auto-revert-mode t)
;; Highlight the current line
(when window-system (global-hl-line-mode t))
;; Global line numbering
(global-linum-mode 0)
;; Show the column number after the line number (i.e. 50:57)
(column-number-mode t)
;; C-c <left>|<right> to undo|redo window changes like adding buffers.
(winner-mode t)
;; Show matching paren
(show-paren-mode t)
;; Pretty Symbols
(when window-system (global-prettify-symbols-mode t))
;; Meta-b better defaults testStringHereToTestBelow_Setting
(global-subword-mode 1)
;; Indent w/spaces only
(setq indent-tabs-mode nil
tab-width 4)
(setq-default indent-tabs-mode nil
tab-width 4)
;; This will expand 4 8 12 16 ... 200
(setq tab-stop-list (number-sequence 4 200 4))
;; Prevent stale elisp bytecode
(setq load-prefer-newer t)
;; Add newline on save
(setq require-final-newline t)
;; C-c to copy in Linux can be pasted in emacs
(setq select-enable-clipboard t)
;; after mouse selection can be pasted in emacs
(setq select-enable-primary t)
;; Paste at current point, not mouse location when "middle-clicking"
(setq mouse-yank-at-point t)
(add-hook 'prog-mode-hook (lambda() (add-hook 'before-save-hook #'delete-trailing-whitespace t t)))
;; Set auth source
;; (setq auth-sources '("~/.authinfo.gpg"))
(setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")
(defalias 'yes-or-no-p 'y-or-n-p)
(defvar browse-url-generic-program)
(defvar engine/browser-function)
(setq browse-url-browser-function 'browse-url-generic
browse-url-generic-program "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"
browse-url-generic-args '("--profile-directory=Default"))
(defun display-startup-echo-area-message ()
"Display startup echo area message."
(message "Initialized in %s" (emacs-init-time)))
(provide '04-custom-init)
;;; 04-custom-init.el ends here