Added init speed optimizations.
This commit is contained in:
parent
6320b6931a
commit
783d2e83ca
32
init.el
32
init.el
|
@ -6,6 +6,10 @@
|
|||
|
||||
;;; Code:
|
||||
|
||||
;; Set garbage collection threshold to 100 MiB to speed up init
|
||||
;; It is reset at the end of the file
|
||||
(setq gc-cons-threshold (* 100 1024 1024))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;; Packages ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
(require 'package)
|
||||
;; (add-to-list 'package-archives
|
||||
|
@ -118,7 +122,8 @@
|
|||
clean-buffer-list-kill-regexps ; Add these to special buffers
|
||||
(nconc clean-buffer-list-kill-regexps
|
||||
'("\\`magit-?.*:"
|
||||
"\\.log\\'"))))
|
||||
"\\.log\\'")))
|
||||
(midnight-mode t))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;; Keybindings ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Scroll in other window
|
||||
|
@ -154,7 +159,7 @@
|
|||
|
||||
(use-package flycheck-rtags
|
||||
:after (flycheck rtags)
|
||||
:defer nil
|
||||
:demand t
|
||||
:config
|
||||
;; ensure that we use only rtags checking
|
||||
;; https://github.com/Andersbakken/rtags#optional-1
|
||||
|
@ -240,6 +245,7 @@
|
|||
|
||||
;; Highlight TODO, FIXME, NOTE and so on.
|
||||
(use-package hl-todo
|
||||
:defer 2
|
||||
:config
|
||||
(global-hl-todo-mode t))
|
||||
|
||||
|
@ -258,12 +264,20 @@
|
|||
(electric-pair-mode t)
|
||||
|
||||
;; Folding
|
||||
(add-hook 'prog-mode-hook #'hs-minor-mode)
|
||||
(use-package fold-dwim
|
||||
:bind
|
||||
("<f7>" . fold-dwim-toggle)
|
||||
("C-x t" . fold-dwim-toggle))
|
||||
("C-x t" . fold-dwim-toggle)
|
||||
:hook
|
||||
(prog-mode . hs-minor-mode))
|
||||
|
||||
;; Highlight indentation levels
|
||||
(use-package highlight-indent-guides
|
||||
:config
|
||||
(setq highlight-indent-guides-method 'character
|
||||
highlight-indent-guides-responsive 'top)
|
||||
:hook
|
||||
(prog-mode . highlight-indent-guides-mode))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;; Appearance ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Icons (required by doom)
|
||||
|
@ -354,6 +368,7 @@
|
|||
|
||||
;; Interactive substring matching
|
||||
(use-package ido
|
||||
:defer 1
|
||||
:config
|
||||
(ido-mode t)
|
||||
(ido-everywhere t))
|
||||
|
@ -390,7 +405,7 @@
|
|||
:family "Sans Serif"
|
||||
:italic t)
|
||||
|
||||
(add-hook 'projectile-after-switch-project-hook ; Does not work under :hood
|
||||
(add-hook 'projectile-after-switch-project-hook ; Does not work under :hook
|
||||
'tabbar-ruler-group-by-projectile-project)
|
||||
:bind
|
||||
("C-<prior>" . 'tabbar-ruler-tabbar-backward-tab)
|
||||
|
@ -467,7 +482,6 @@
|
|||
(setq markdown-command "markdown2"))
|
||||
|
||||
(use-package crontab-mode
|
||||
:defer t
|
||||
:mode
|
||||
(("/cron\\.d/" . crontab-mode))
|
||||
("\\`'/etc/crontab\\'" . crontab-mode))
|
||||
|
@ -477,7 +491,6 @@
|
|||
|
||||
(use-package company-nginx
|
||||
:after nginx-mode
|
||||
:config
|
||||
:hook
|
||||
(nginx-mode . company-nginx-keywords))
|
||||
|
||||
|
@ -485,6 +498,7 @@
|
|||
;; Edit remote files
|
||||
(unless slow-computer
|
||||
(use-package tramp
|
||||
:defer 1
|
||||
:config
|
||||
;; ssh is faster than scp and supports ports
|
||||
(setq tramp-default-method "ssh")
|
||||
|
@ -509,6 +523,7 @@
|
|||
(unless (equal (user-real-uid) 0)
|
||||
(unless (getenv "SSH_CONNECTION")
|
||||
(use-package server
|
||||
:defer 1
|
||||
:init
|
||||
(setq server-use-tcp t
|
||||
server-port 51313
|
||||
|
@ -519,5 +534,8 @@
|
|||
(server-start))
|
||||
)))
|
||||
|
||||
;; Set garbage collection threshold to 2 MiB
|
||||
(setq gc-cons-threshold (* 2 1024 1024))
|
||||
|
||||
(provide 'init)
|
||||
;;; init.el ends here
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
127.0.0.1:51313 4674
|
||||
127.0.0.1:51313 10843
|
||||
phahw2ohVoh0oopheish7IVie9desh8aequeenei3uo8wahShe%thuadaeNa4ieh
|
Loading…
Reference in New Issue