aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemse2025-02-03 22:47:11 -0800
committerGravatar Tom Willemse2025-02-03 22:47:24 -0800
commitf1854bb4f66f1130ad4b7965c5f306d69a725929 (patch)
tree5ca08dd7fc94f944ed460c1e16c09ec7ca0887c6
parentc41b33cb0bcd8d781ae26e501f5a4971b7069732 (diff)
downloadnew-dotfiles-f1854bb4f66f1130ad4b7965c5f306d69a725929.tar.gz
new-dotfiles-f1854bb4f66f1130ad4b7965c5f306d69a725929.zip
pop-os: Add history filter to Atuin
-rw-r--r--oni/home/config/pop-os.scm4
-rw-r--r--oni/home/services/zsh.scm19
2 files changed, 18 insertions, 5 deletions
diff --git a/oni/home/config/pop-os.scm b/oni/home/config/pop-os.scm
index 853bb5b..7d9f7be 100644
--- a/oni/home/config/pop-os.scm
+++ b/oni/home/config/pop-os.scm
@@ -135,7 +135,9 @@
(service home-zsh-atuin-service-type
(home-zsh-atuin-configuration
(inline-height 20)
- (filter-mode 'directory)))
+ (filter-mode 'directory)
+ (history-filter
+ '("^ +"))))
(service home-stumpwm-service-type
(home-stumpwm-configuration
diff --git a/oni/home/services/zsh.scm b/oni/home/services/zsh.scm
index 4de41cc..373ea6e 100644
--- a/oni/home/services/zsh.scm
+++ b/oni/home/services/zsh.scm
@@ -143,12 +143,18 @@
(default-value (home-zsh-autopair-configuration))
(description "Install and configure zsh-autopair.")))
+(define (serialize-field-name field)
+ (string-replace-substring (symbol->string field) "-" "_"))
+
(define (serialize-integer field value)
- (format #f "~a = ~a~%" (string-replace-substring (symbol->string field) "-" "_") value))
+ (format #f "~a = ~a~%" (serialize-field-name field) value))
(define (serialize-filter-mode field value)
- (format #f "~a = ~s~%" (string-replace-substring (symbol->string field) "-" "_")
- (symbol->string value)))
+ (format #f "~a = ~s~%" (serialize-field-name field) (symbol->string value)))
+
+(define (serialize-list-of-strings field value)
+ (format #f "~a = ~a~%" (serialize-field-name field)
+ (string-append "[" (string-join (map (λ (v) (format #f "~s" v)) value) ",") "]")))
(define (filter-mode? value)
(memq value '(global host session directory workspace)))
@@ -162,7 +168,12 @@
"Set the maximum number of lines Atuin’s interface should take up.")
(filter-mode
(filter-mode 'global)
- "The default filter to use when searching"))
+ "The default filter to use when searching")
+ (history-filter
+ (list-of-strings '())
+ "The history filter allows you to exclude commands from history tracking - maybe
+you want to keep ALL of your curl commands totally out of your shell history, or
+maybe just some matching a pattern."))
(define (add-zsh-atuin config)
(home-zsh-extension