Faster emacs startup
This commit is contained in:
parent
213fa674c8
commit
23306e0379
7 changed files with 69 additions and 40 deletions
|
@ -13,6 +13,7 @@
|
||||||
(use-package diminish)
|
(use-package diminish)
|
||||||
;; For :general in (use-package). Keybinding management framework.
|
;; For :general in (use-package). Keybinding management framework.
|
||||||
(use-package general
|
(use-package general
|
||||||
|
:after evil
|
||||||
:config
|
:config
|
||||||
(general-evil-setup t)
|
(general-evil-setup t)
|
||||||
|
|
||||||
|
@ -20,7 +21,7 @@
|
||||||
(general-create-definer lmap
|
(general-create-definer lmap
|
||||||
:states '(normal visual insert emacs motion)
|
:states '(normal visual insert emacs motion)
|
||||||
:prefix "SPC"
|
:prefix "SPC"
|
||||||
:non-normal-prefix "C-SPC"
|
:global-prefix "C-SPC"
|
||||||
)
|
)
|
||||||
|
|
||||||
(lmap
|
(lmap
|
||||||
|
@ -56,6 +57,22 @@
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
;; Vim keybindings
|
||||||
|
(use-package evil
|
||||||
|
:custom
|
||||||
|
(evil-want-keybinding nil "Disable default evil keybindings, since
|
||||||
|
evil-collection is a superset. See
|
||||||
|
https://github.com/emacs-evil/evil-collection/issues/60.")
|
||||||
|
(evil-want-integration t "Also needed for evil-collection")
|
||||||
|
:config (evil-mode 1)
|
||||||
|
)
|
||||||
|
|
||||||
|
;; Vim keybindings in other packages
|
||||||
|
(use-package evil-collection
|
||||||
|
:after (evil)
|
||||||
|
:config (evil-collection-init)
|
||||||
|
)
|
||||||
|
|
||||||
;; Better defaults that aren't defaults for some reason.
|
;; Better defaults that aren't defaults for some reason.
|
||||||
(use-package better-defaults
|
(use-package better-defaults
|
||||||
;; But don't enable ido-mode...
|
;; But don't enable ido-mode...
|
||||||
|
@ -65,18 +82,18 @@
|
||||||
;; Autocomplete
|
;; Autocomplete
|
||||||
(use-package company
|
(use-package company
|
||||||
:diminish (company-mode)
|
:diminish (company-mode)
|
||||||
|
:defer t
|
||||||
:config (global-company-mode)
|
:config (global-company-mode)
|
||||||
)
|
)
|
||||||
|
|
||||||
;; Prescient in company
|
;; Prescient in company
|
||||||
(use-package company-prescient
|
(use-package company-prescient
|
||||||
|
:after (company prescient)
|
||||||
:config (company-prescient-mode 1)
|
:config (company-prescient-mode 1)
|
||||||
)
|
)
|
||||||
|
|
||||||
;; Replacements for emacs built-ins that better integrate with `selectrum'.
|
;; Replacements for emacs built-ins that better integrate with `selectrum'.
|
||||||
(use-package consult
|
(use-package consult
|
||||||
:demand t
|
|
||||||
:custom (consult-project-root-function #'projectile-project-root "Use projectile to determine project roots.")
|
|
||||||
:general
|
:general
|
||||||
(lmap
|
(lmap
|
||||||
"bb" '(consult-buffer :which-key "switch")
|
"bb" '(consult-buffer :which-key "switch")
|
||||||
|
@ -89,6 +106,7 @@
|
||||||
;; General emacs settings
|
;; General emacs settings
|
||||||
(use-package emacs
|
(use-package emacs
|
||||||
:ensure nil ;; Not a real package, but a place to collect global settings
|
:ensure nil ;; Not a real package, but a place to collect global settings
|
||||||
|
:demand t
|
||||||
:hook
|
:hook
|
||||||
;; Always display line numbers for text-based modes
|
;; Always display line numbers for text-based modes
|
||||||
((text-mode prog-mode) . display-line-numbers-mode)
|
((text-mode prog-mode) . display-line-numbers-mode)
|
||||||
|
@ -97,7 +115,7 @@
|
||||||
;; major modes.
|
;; major modes.
|
||||||
((text-mode prog-mode) . electric-pair-mode)
|
((text-mode prog-mode) . electric-pair-mode)
|
||||||
:custom
|
:custom
|
||||||
(create-lockfiles nil "I'm the only user on my devices, so don't clutter with lockfiles")
|
(create-lockfiles nil "I'm the only user on my devices and use emacs as a daemon, so don't clutter with lockfiles")
|
||||||
(inhibit-startup-screen t "Don't show default startup screen")
|
(inhibit-startup-screen t "Don't show default startup screen")
|
||||||
:config
|
:config
|
||||||
;; Only ask for y/n, never for yes/no.
|
;; Only ask for y/n, never for yes/no.
|
||||||
|
@ -124,31 +142,16 @@
|
||||||
(column-number-mode)
|
(column-number-mode)
|
||||||
)
|
)
|
||||||
|
|
||||||
;; Vim keybindings
|
|
||||||
(use-package evil
|
|
||||||
:custom
|
|
||||||
(evil-want-keybinding nil "Disable default evil keybindings, since
|
|
||||||
evil-collection is a superset. See
|
|
||||||
https://github.com/emacs-evil/evil-collection/issues/60.")
|
|
||||||
(evil-want-integration t "Also needed for evil-collection")
|
|
||||||
:config (evil-mode 1)
|
|
||||||
)
|
|
||||||
|
|
||||||
;; Vim keybindings in other packages
|
|
||||||
(use-package evil-collection
|
|
||||||
:after (evil)
|
|
||||||
:config (evil-collection-init)
|
|
||||||
)
|
|
||||||
|
|
||||||
;; Linting
|
;; Linting
|
||||||
(use-package flycheck
|
(use-package flycheck
|
||||||
|
:defer t
|
||||||
:diminish (flycheck-mode)
|
:diminish (flycheck-mode)
|
||||||
:config (global-flycheck-mode)
|
:config (global-flycheck-mode)
|
||||||
)
|
)
|
||||||
|
|
||||||
;; Annotations in selection interface
|
;; Annotations in selection interface
|
||||||
(use-package marginalia
|
(use-package marginalia
|
||||||
:demand t
|
:after (selectrum)
|
||||||
:custom
|
:custom
|
||||||
(marginalia-annotators '(marginalia-annotators-heavy marginalia-annotators-light nil))
|
(marginalia-annotators '(marginalia-annotators-heavy marginalia-annotators-light nil))
|
||||||
:config
|
:config
|
||||||
|
@ -174,7 +177,9 @@
|
||||||
(use-package no-littering
|
(use-package no-littering
|
||||||
:custom
|
:custom
|
||||||
(user-emacs-directory (expand-file-name "~/.cache/emacs/") "Don't put files into .emacs.d")
|
(user-emacs-directory (expand-file-name "~/.cache/emacs/") "Don't put files into .emacs.d")
|
||||||
(url-history-file (expand-file-name "url/history" user-emacs-directory) "Same for url-history file")
|
:config
|
||||||
|
;; Also make sure auto-save files are saved out-of-tree
|
||||||
|
(setq auto-save-file-name-transforms `((".*" ,(no-littering-expand-var-file-name "auto-save/") t)))
|
||||||
)
|
)
|
||||||
|
|
||||||
;; Orderless filtering
|
;; Orderless filtering
|
||||||
|
@ -210,6 +215,7 @@
|
||||||
|
|
||||||
;; Prescient integration in selectrum
|
;; Prescient integration in selectrum
|
||||||
(use-package selectrum-prescient
|
(use-package selectrum-prescient
|
||||||
|
:after (selectrum prescient)
|
||||||
:custom (selectrum-prescient-enable-filtering nil "`orderless' manages the filtering part.")
|
:custom (selectrum-prescient-enable-filtering nil "`orderless' manages the filtering part.")
|
||||||
:config (selectrum-prescient-mode 1))
|
:config (selectrum-prescient-mode 1))
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
readOnly = true;
|
readOnly = true;
|
||||||
default = pkgs.emacsWithPackagesFromUsePackage {
|
default = pkgs.emacsWithPackagesFromUsePackage {
|
||||||
config = config.chvp.base.emacs.fullConfig;
|
config = config.chvp.base.emacs.fullConfig;
|
||||||
package = pkgs.emacsPgtk;
|
package = pkgs.emacsPgtkGcc;
|
||||||
alwaysEnsure = true;
|
alwaysEnsure = true;
|
||||||
# mu4e is included in the mu package and should be used from there
|
# mu4e is included in the mu package and should be used from there
|
||||||
extraEmacsPackages = epkgs: lib.optional config.chvp.graphical.mail.enable pkgs.mu;
|
extraEmacsPackages = epkgs: lib.optional config.chvp.graphical.mail.enable pkgs.mu;
|
||||||
|
|
|
@ -62,11 +62,16 @@ in
|
||||||
emacs.extraConfig = [
|
emacs.extraConfig = [
|
||||||
''
|
''
|
||||||
;; Nix syntax support
|
;; Nix syntax support
|
||||||
(use-package nix-mode :mode "\\.nix\\'")
|
(use-package nix-mode
|
||||||
|
:mode "\\.nix\\'"
|
||||||
|
)
|
||||||
''
|
''
|
||||||
] ++ lib.optional config.chvp.base.nix.enableDirenv ''
|
] ++ lib.optional config.chvp.base.nix.enableDirenv ''
|
||||||
;; Direnv integration in emacs.
|
;; Direnv integration in emacs.
|
||||||
(use-package direnv :config (direnv-mode))
|
(use-package direnv
|
||||||
|
:defer t
|
||||||
|
:config (direnv-mode)
|
||||||
|
)
|
||||||
'';
|
'';
|
||||||
zfs = {
|
zfs = {
|
||||||
homeLinks =
|
homeLinks =
|
||||||
|
|
|
@ -18,13 +18,17 @@
|
||||||
''
|
''
|
||||||
;; Editorconfig
|
;; Editorconfig
|
||||||
(use-package editorconfig
|
(use-package editorconfig
|
||||||
|
:defer t
|
||||||
:diminish (editorconfig-mode)
|
:diminish (editorconfig-mode)
|
||||||
:custom (editorconfig-get-properties-function 'editorconfig-get-properties)
|
:custom (editorconfig-get-properties-function 'editorconfig-get-properties)
|
||||||
:config (editorconfig-mode 1)
|
:config (editorconfig-mode 1)
|
||||||
)
|
)
|
||||||
|
|
||||||
;; Language server support
|
;; Language server support
|
||||||
(use-package lsp-mode :commands (lsp))
|
(use-package lsp-mode
|
||||||
|
:commands (lsp lsp-deferred)
|
||||||
|
:config (lsp-enable-which-key-integration t)
|
||||||
|
)
|
||||||
|
|
||||||
;; Markdown syntax support
|
;; Markdown syntax support
|
||||||
(use-package markdown-mode
|
(use-package markdown-mode
|
||||||
|
@ -41,32 +45,44 @@
|
||||||
)
|
)
|
||||||
|
|
||||||
;; R language support
|
;; R language support
|
||||||
(use-package ess)
|
(use-package ess
|
||||||
|
:mode "\\.r\\'"
|
||||||
|
:mode "\\.R\\'"
|
||||||
|
)
|
||||||
|
|
||||||
;; Haskell language support
|
;; Haskell language support
|
||||||
(use-package haskell-mode
|
(use-package haskell-mode
|
||||||
:mode "\\.hs\\'")
|
:mode "\\.hs\\'"
|
||||||
|
)
|
||||||
|
|
||||||
;; Python syntax support
|
;; Python syntax support
|
||||||
(use-package python-mode :mode "\\.py\\'")
|
(use-package python-mode
|
||||||
|
:mode "\\.py\\'"
|
||||||
|
)
|
||||||
|
|
||||||
;; Ruby language support
|
;; Ruby language support
|
||||||
(use-package ruby-mode
|
(use-package ruby-mode
|
||||||
:ensure nil ;; Included with emacs
|
:ensure nil ;; Included with emacs
|
||||||
|
:mode "\\.\\(?:cap\\|gemspec\\|irbrc\\|gemrc\\|rake\\|rb\\|ru\\|thor\\)\\'"
|
||||||
|
:mode "\\(?:Brewfile\\|Capfile\\|Gemfile\\(?:\\.[a-zA-Z0-9._-]+\\)?\\|[rR]akefile\\)\\'"
|
||||||
:custom
|
:custom
|
||||||
(ruby-insert-encoding-magic-comment nil "Don't insert encoding magic comment")
|
(ruby-insert-encoding-magic-comment nil "Don't insert encoding magic comment")
|
||||||
)
|
)
|
||||||
|
|
||||||
;; Rust language support
|
;; Rust language support
|
||||||
(use-package rust-mode :mode "\\.rs\\'")
|
(use-package rust-mode
|
||||||
|
:mode "\\.rs\\'"
|
||||||
|
)
|
||||||
|
|
||||||
;; TypeScript language support
|
;; TypeScript language support
|
||||||
(use-package typescript-mode
|
(use-package typescript-mode
|
||||||
:mode "\\.ts\\'")
|
:mode "\\.ts\\'"
|
||||||
|
)
|
||||||
|
|
||||||
;; Vue language support
|
;; Vue language support
|
||||||
(use-package vue-mode
|
(use-package vue-mode
|
||||||
:mode "\\.vue\\'")
|
:mode "\\.vue\\'"
|
||||||
|
)
|
||||||
|
|
||||||
;; HTML (and HTML template) support
|
;; HTML (and HTML template) support
|
||||||
(use-package web-mode
|
(use-package web-mode
|
||||||
|
|
|
@ -56,7 +56,6 @@
|
||||||
|
|
||||||
;; Git integration
|
;; Git integration
|
||||||
(use-package magit
|
(use-package magit
|
||||||
:demand t
|
|
||||||
:general
|
:general
|
||||||
(lmap
|
(lmap
|
||||||
"g" '(:ignore t :which-key "git")
|
"g" '(:ignore t :which-key "git")
|
||||||
|
@ -66,8 +65,8 @@
|
||||||
|
|
||||||
;; Project management
|
;; Project management
|
||||||
(use-package projectile
|
(use-package projectile
|
||||||
:after (ripgrep selectrum)
|
:commands (projectile-project-root)
|
||||||
:demand t
|
:custom (consult-project-root-function #'projectile-project-root "Use projectile to determine project roots.")
|
||||||
:diminish (projectile-mode)
|
:diminish (projectile-mode)
|
||||||
:config (projectile-mode 1)
|
:config (projectile-mode 1)
|
||||||
:general
|
:general
|
||||||
|
@ -84,7 +83,9 @@
|
||||||
)
|
)
|
||||||
|
|
||||||
;; Ripgrep support (needed for `projectile-ripgrep')
|
;; Ripgrep support (needed for `projectile-ripgrep')
|
||||||
(use-package ripgrep)
|
(use-package ripgrep
|
||||||
|
:after (projectile)
|
||||||
|
)
|
||||||
''
|
''
|
||||||
];
|
];
|
||||||
home-manager.users.charlotte = { ... }: base;
|
home-manager.users.charlotte = { ... }: base;
|
||||||
|
|
|
@ -113,7 +113,7 @@ in
|
||||||
(use-package mu4e
|
(use-package mu4e
|
||||||
;; Use mu4e included in the mu package, see emacs.nix
|
;; Use mu4e included in the mu package, see emacs.nix
|
||||||
:ensure nil
|
:ensure nil
|
||||||
:demand t
|
:commands (mu4e mu4e-update-index)
|
||||||
:after (selectrum)
|
:after (selectrum)
|
||||||
:hook
|
:hook
|
||||||
(mu4e-view-mode . display-line-numbers-mode)
|
(mu4e-view-mode . display-line-numbers-mode)
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
''
|
''
|
||||||
(use-package auth-source-pass
|
(use-package auth-source-pass
|
||||||
:ensure nil
|
:ensure nil
|
||||||
|
:defer t
|
||||||
:custom
|
:custom
|
||||||
(auth-sources '(password-store))
|
(auth-sources '(password-store))
|
||||||
(auth-source-pass-filename "${config.home-manager.users.charlotte.programs.password-store.settings.PASSWORD_STORE_DIR}")
|
(auth-source-pass-filename "${config.home-manager.users.charlotte.programs.password-store.settings.PASSWORD_STORE_DIR}")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue