aboutsummaryrefslogtreecommitdiffstats
path: root/oni
diff options
context:
space:
mode:
authorGravatar Tom Willemse2023-08-29 22:24:25 -0700
committerGravatar Tom Willemse2023-08-29 22:28:30 -0700
commit150273d74199f0c32a2b8594ba10e05829d7c929 (patch)
treed018169be6ad33f0817d7acb0683d551d342bc4e /oni
parent0e0fccec8829caf14f2925ffb0184fc0841318f1 (diff)
downloadnew-dotfiles-150273d74199f0c32a2b8594ba10e05829d7c929.tar.gz
new-dotfiles-150273d74199f0c32a2b8594ba10e05829d7c929.zip
Add zsh-autopair configuration
Diffstat (limited to 'oni')
-rw-r--r--oni/home/config/rincewind.scm4
-rw-r--r--oni/home/services/zsh.scm34
2 files changed, 36 insertions, 2 deletions
diff --git a/oni/home/config/rincewind.scm b/oni/home/config/rincewind.scm
index 540e26e..a36b84b 100644
--- a/oni/home/config/rincewind.scm
+++ b/oni/home/config/rincewind.scm
@@ -110,7 +110,8 @@
#:select (home-inkplate-display-service-type))
#:use-module ((oni home services zsh)
#:select (home-zsh-syntax-highlighting-service-type
- home-zsh-autosuggestions-service-type))
+ home-zsh-autosuggestions-service-type
+ home-zsh-autopair-service-type))
#:use-module ((oni packages count-emails)
#:select (count-emails))
#:use-module ((oni packages emacs)
@@ -271,6 +272,7 @@
;; configuration last.
(service home-zsh-syntax-highlighting-service-type)
(service home-zsh-autosuggestions-service-type)
+ (service home-zsh-autopair-service-type)
(simple-service 'my-channel-service
home-channels-service-type
diff --git a/oni/home/services/zsh.scm b/oni/home/services/zsh.scm
index d89a237..a003db0 100644
--- a/oni/home/services/zsh.scm
+++ b/oni/home/services/zsh.scm
@@ -13,7 +13,9 @@
home-zsh-syntax-highlighting-service-type
home-zsh-syntax-highlighting-configuration
home-zsh-contextual-abbrevs-service-type
- home-zsh-contextual-abbrevs-configuration))
+ home-zsh-contextual-abbrevs-configuration
+ home-zsh-autopair-service-type
+ home-zsh-autopair-configuration))
(define-configuration/no-serialization home-zsh-autosuggestions-configuration
(package
@@ -105,3 +107,33 @@
(compose identity)
(default-value (home-zsh-contextual-abbrevs-configuration))
(description "Install and configure zsh-contextual-abbrevs.")))
+
+(define (add-zsh-autopair config)
+ (home-zsh-extension
+ (zshrc
+ (list
+ (mixed-text-file
+ "zshrc"
+ "source " (home-zsh-autopair-configuration-package config) "/share/zsh/plugins/zsh-autopair/zsh-autopair.zsh")))))
+
+(define-configuration/no-serialization home-zsh-autopair-configuration
+ (package
+ (package zsh-autopair)
+ "Package to use for setting zsh-autopair."))
+
+(define (add-zsh-autopair-packages config)
+ (list (home-zsh-autopair-configuration-package config)))
+
+(define home-zsh-autopair-service-type
+ (service-type
+ (name 'home-zsh-autopair)
+ (extensions
+ (list (service-extension
+ home-zsh-service-type
+ add-zsh-autopair)
+ (service-extension
+ home-profile-service-type
+ add-zsh-autopair-packages)))
+ (compose identity)
+ (default-value (home-zsh-autopair-configuration))
+ (description "Install and configure zsh-autopair.")))