From c9d8a52b39ec49d29cf5aeb7e91ce926f9f1c3ac Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Wed, 23 Aug 2023 10:57:10 -0700 Subject: Add ZSH contextual abbrevs package --- oni/home/services/zsh.scm | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'oni/home') diff --git a/oni/home/services/zsh.scm b/oni/home/services/zsh.scm index 80abdb4..d89a237 100644 --- a/oni/home/services/zsh.scm +++ b/oni/home/services/zsh.scm @@ -6,11 +6,14 @@ #:use-module (gnu home services utils) #:use-module (guix packages) #:use-module (guix gexp) + #:use-module (oni packages zsh) #:export (home-zsh-autosuggestions-service-type home-zsh-autosuggestions-configuration home-zsh-syntax-highlighting-service-type - home-zsh-syntax-highlighting-configuration)) + home-zsh-syntax-highlighting-configuration + home-zsh-contextual-abbrevs-service-type + home-zsh-contextual-abbrevs-configuration)) (define-configuration/no-serialization home-zsh-autosuggestions-configuration (package @@ -72,3 +75,33 @@ (compose identity) (default-value (home-zsh-syntax-highlighting-configuration)) (description "Install and configure zsh-syntax-highlighting."))) + +(define-configuration/no-serialization home-zsh-contextual-abbrevs-configuration + (package + (package zsh-contextual-abbrevs) + "Package to use for setting zsh-contexual-abbrevs.")) + +(define (add-zsh-contextual-abbrevs config) + (home-zsh-extension + (zshrc + (list + (mixed-text-file + "zshrc" + "source " (home-zsh-contextual-abbrevs-configuration-package config) "/share/zsh/plugins/zsh-contextual-abbrevs/contextual-abbrevs.zsh"))))) + +(define (add-zsh-contextual-abbrevs-packages config) + (list (home-zsh-contextual-abbrevs-configuration-package config))) + +(define home-zsh-contextual-abbrevs-service-type + (service-type + (name 'home-zsh-contextual-abbrevs) + (extensions + (list (service-extension + home-zsh-service-type + add-zsh-contextual-abbrevs) + (service-extension + home-profile-service-type + add-zsh-contextual-abbrevs-packages))) + (compose identity) + (default-value (home-zsh-contextual-abbrevs-configuration)) + (description "Install and configure zsh-contextual-abbrevs."))) -- cgit v1.3-2-g0d8e