From 29e60f8aef5c8801564be5af6c06f5575282624f Mon Sep 17 00:00:00 2001 From: Charlotte Van Petegem Date: Wed, 2 Feb 2022 14:13:41 +0100 Subject: [PATCH] Small emacs changes --- modules/base/emacs/base-init.el | 10 +++++++--- modules/base/emacs/default.nix | 8 ++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/modules/base/emacs/base-init.el b/modules/base/emacs/base-init.el index 4f5ef7d4..e1df5c5d 100644 --- a/modules/base/emacs/base-init.el +++ b/modules/base/emacs/base-init.el @@ -121,6 +121,8 @@ ;; advanced later? Look into configuring pairs for frequently used ;; major modes. ((text-mode prog-mode) . electric-pair-mode) + ;; Always highlight the current line in text modes + ((text-mode prog-mode) . hl-line-mode) :custom (fill-column 80 "Fill at column 80 instead of 70") (create-lockfiles nil "I'm the only user on my devices and use emacs as a daemon, so don't clutter with lockfiles") @@ -209,9 +211,11 @@ ;; Sorting when filtering (use-package prescient - :config - (prescient-persist-mode 1) - (run-at-time t 300 'prescient--save) + :custom + (prescient-aggressive-file-save t "Be aggressive with saving prescient data since we're in daemon mode") + (prescient-history-length 100000 "Save a lot of history") + (prescient-frequency-threshold 0.00005 "Save a lot of history") + :config (prescient-persist-mode 1) ) ;; Rainbow delimiters diff --git a/modules/base/emacs/default.nix b/modules/base/emacs/default.nix index baf5a05b..b0ccdda3 100644 --- a/modules/base/emacs/default.nix +++ b/modules/base/emacs/default.nix @@ -37,16 +37,16 @@ package = config.chvp.base.emacs.package; }; home = { - file = { - ".emacs.d/early-init.el".source = ./early-init.el; - ".emacs.d/init.el".text = config.chvp.base.emacs.fullConfig; - }; packages = [ (pkgs.writeShellScriptBin "emacs" ''${config.chvp.base.emacs.package}/bin/emacsclient -c "$@"'') (pkgs.writeShellScriptBin "emacsclient" ''${config.chvp.base.emacs.package}/bin/emacsclient "$@"'') ]; sessionVariables = { EDITOR = "emacs"; }; }; + xdg.configFile = { + "emacs/init.el".text = config.chvp.base.emacs.fullConfig; + "emacs/early-init.el".source = ./early-init.el; + }; }; }; }