From 10a41ff8fd0ea562d788888b339a3596236833db Mon Sep 17 00:00:00 2001 From: Isaac Corbrey Date: Wed, 3 Jun 2026 19:34:11 -0400 Subject: [PATCH] emacs: Set up helix-mode for modal editing Drops helix-mode (the Emacs minor mode, not the editor) into the wrapped emacs-pgtk and wires its activation into init.el via a new lisp/init-helix.el. The same module also adds a personal `lisp/` directory to `load-path`, anchored at `user-emacs-directory`, so future per-package init files can hang off the same `(require ...)` pattern. Also disables the startup splash so the first frame lands directly in *scratch* (where (helix-mode) activates helix-normal-mode for the current buffer at init load time). helix-mode-all is called after helix-mode so all already-existing buffers (Messages, etc.), not just the current one, enter helix-normal-mode at startup. --- modules/home/emacs/default.nix | 2 +- modules/home/emacs/init.el | 5 +++++ modules/home/emacs/lisp/init-helix.el | 8 ++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 modules/home/emacs/lisp/init-helix.el diff --git a/modules/home/emacs/default.nix b/modules/home/emacs/default.nix index 16d5b89..354f9b1 100644 --- a/modules/home/emacs/default.nix +++ b/modules/home/emacs/default.nix @@ -8,7 +8,7 @@ repoPath = "${config.home.homeDirectory}/.nix/modules/home/emacs"; in lib.mkIf emacs.enable (let emacs-pgtk = pkgs.emacs-pgtk.pkgs.withPackages(epkgs: with epkgs; [ - + helix ]); in { home.packages = [ diff --git a/modules/home/emacs/init.el b/modules/home/emacs/init.el index e69de29..2611f00 100644 --- a/modules/home/emacs/init.el +++ b/modules/home/emacs/init.el @@ -0,0 +1,5 @@ +(setq inhibit-startup-screen t) + +(add-to-list 'load-path (expand-file-name "lisp" user-emacs-directory)) + +(require 'init-helix) diff --git a/modules/home/emacs/lisp/init-helix.el b/modules/home/emacs/lisp/init-helix.el new file mode 100644 index 0000000..0b4894b --- /dev/null +++ b/modules/home/emacs/lisp/init-helix.el @@ -0,0 +1,8 @@ +;;; init-helix.el --- Helix-style modal editing -*- lexical-binding: t; -*- + +(require 'helix) +(helix-mode) +(helix-mode-all) + +(provide 'init-helix) +;;; init-helix.el ends here -- 2.51.2