pop-os: Add history filter to Atuin

This commit is contained in:
Tom Willemse 2025-02-03 22:47:11 -08:00
parent c41b33cb0b
commit f1854bb4f6
2 changed files with 18 additions and 5 deletions

View file

@ -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

View file

@ -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 Atuins 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