Improved emacs load time

This commit is contained in:
Random936 2023-09-24 20:23:31 -07:00
parent eeb1f21ad0
commit fe4262ae6a
2 changed files with 53 additions and 40 deletions

View File

@ -134,6 +134,7 @@ Install use package for easier installation of other packages.
(require 'use-package) (require 'use-package)
(setq use-package-always-ensure t) (setq use-package-always-ensure t)
(setq use-package-compute-statistics t)
#+end_src #+end_src
Fixes path issue that occurs on mac. Fixes path issue that occurs on mac.
@ -154,9 +155,9 @@ This is a list of installed packages not included in any other category.
Command Log Mode creates a window that logs all commands and corresponding keybindings. Command Log Mode creates a window that logs all commands and corresponding keybindings.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package command-log-mode (use-package command-log-mode
:defer :defer t
:config (global-command-log-mode)) :config (global-command-log-mode))
#+end_src #+end_src
*** Magit *** Magit
@ -164,7 +165,8 @@ Command Log Mode creates a window that logs all commands and corresponding keybi
*Magit* adds several features to Emacs that make using git easier. *Magit* adds several features to Emacs that make using git easier.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package magit) (use-package magit
:defer t)
#+end_src #+end_src
*** Helpful *** Helpful

View File

@ -5,17 +5,19 @@ This will include any language server packages and configuration.
** HTML ** HTML
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package web-mode (use-package web-mode
:mode "\\.html\\'" :defer t
:hook (web-mode . lsp-deferred)) :mode "\\.html\\'"
:hook (web-mode . lsp-deferred))
#+end_src #+end_src
** JavaScript/Typescript ** JavaScript/Typescript
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package typescript-mode (use-package typescript-mode
:mode ("\\.ts\\'" "\\.js\\'") :defer t
:hook (typescript-mode . lsp-deferred)) :mode ("\\.ts\\'" "\\.js\\'")
:hook (typescript-mode . lsp-deferred))
#+end_src #+end_src
Install the ~typescript-language-server~ through npm. Install the ~typescript-language-server~ through npm.
@ -27,9 +29,10 @@ Install the ~typescript-language-server~ through npm.
** Python ** Python
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package python-mode (use-package python-mode
:mode ("\\.py\\'") :defer t
:hook (python-mode . lsp-deferred)) :mode ("\\.py\\'")
:hook (python-mode . lsp-deferred))
#+end_src #+end_src
Install the ~python-lsp-server~ though pip. Install the ~python-lsp-server~ though pip.
@ -41,11 +44,12 @@ Install the ~python-lsp-server~ though pip.
** C/C++ ** C/C++
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package ccls (use-package ccls
:hook ((c-mode cc-mode c++-mode objc-mode cuda-mode) . :defer t
(lambda () (require 'ccls) (lsp))) :hook ((c-mode cc-mode c++-mode objc-mode cuda-mode) .
:config (lambda () (require 'ccls) (lsp)))
(setq ccls-executable "/usr/bin/ccls")) :config
(setq ccls-executable "/usr/bin/ccls"))
#+end_src #+end_src
Install ~ccls~ with homebrew using the following command. Install ~ccls~ with homebrew using the following command.
@ -57,36 +61,41 @@ Install ~ccls~ with homebrew using the following command.
** Golang ** Golang
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package go-mode (use-package go-mode
:hook (go-mode . lsp-deferred)) :defer t
:hook (go-mode . lsp-deferred))
#+end_src #+end_src
** Rust ** Rust
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package rustic (use-package rustic
:hook (rust-mode . lsp-deferred)) :defer t
:hook (rust-mode . lsp-deferred))
#+end_src #+end_src
** C# ** C#
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package csharp-mode (use-package csharp-mode
:hook (csharp-mode . lsp-deferred)) :defer t
:hook (csharp-mode . lsp-deferred))
#+end_src #+end_src
** JSON ** JSON
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package json-mode (use-package json-mode
:hook (json-mode . lsp-deferred)) :defer t
:hook (json-mode . lsp-deferred))
#+end_src #+end_src
** Yaml ** Yaml
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package yaml-mode (use-package yaml-mode
:hook (yaml-mode . lsp-deferred)) :defer t
:hook (yaml-mode . lsp-deferred))
#+end_src #+end_src
** Yara ** Yara
@ -94,22 +103,24 @@ Install ~ccls~ with homebrew using the following command.
To install the corresponding LSP, you need to install ~yls~. Using the command ~pip install -U yls-yara~. Keep in mind that ~yls~ is dependent on an up to date version of ~yara-python~. To install the corresponding LSP, you need to install ~yls~. Using the command ~pip install -U yls-yara~. Keep in mind that ~yls~ is dependent on an up to date version of ~yara-python~.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package yara-mode (use-package yara-mode
:hook (yara-mode . lsp-deferred) :defer t
:config :hook (yara-mode . lsp-deferred)
(with-eval-after-load 'lsp-mode :config
(add-to-list 'lsp-language-id-configuration (with-eval-after-load 'lsp-mode
'(yara-mode . "yara")) (add-to-list 'lsp-language-id-configuration
'(yara-mode . "yara"))
(lsp-register-client (lsp-register-client
(make-lsp-client :new-connection (lsp-stdio-connection "yls") (make-lsp-client :new-connection (lsp-stdio-connection "yls")
:activation-fn (lsp-activate-on "yara") :activation-fn (lsp-activate-on "yara")
:server-id 'yls)))) :server-id 'yls))))
#+end_src #+end_src
** R ** R
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package ess (use-package ess
:hook (R-mode . lsp-deferred)) :defer t
:hook (R-mode . lsp-deferred))
#+end_src #+end_src