From eac3b0c3ea3d07f8b71cba349cd12b38936b7c4e Mon Sep 17 00:00:00 2001 From: sid Date: Sun, 31 May 2026 21:01:15 +0200 Subject: [PATCH] zsh: add fr function --- modules/home/common/fr.sh | 7 +++++++ modules/home/common/zsh.nix | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 modules/home/common/fr.sh diff --git a/modules/home/common/fr.sh b/modules/home/common/fr.sh new file mode 100644 index 0000000..a02fc1b --- /dev/null +++ b/modules/home/common/fr.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +# find and replace strings with rg +# Usage: fr OLD NEW + +fr() { + rg -lF "$1" | xargs sed -i "s|$1|$2|g" +} diff --git a/modules/home/common/zsh.nix b/modules/home/common/zsh.nix index 5141aa9..4378e25 100644 --- a/modules/home/common/zsh.nix +++ b/modules/home/common/zsh.nix @@ -12,6 +12,7 @@ in PROMPT='%F{green}%n%f@%F{blue}%m%f %B%1~%b > ' RPROMPT='[%F{yellow}%?%f]' '' - + builtins.readFile ./cdf.sh; + + builtins.readFile ./cdf.sh + + builtins.readFile ./fr.sh; }; }