From 2592dba5660c2a77909f7d4ea383d276d533b9cb Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 20 Oct 2013 18:53:50 -0400 Subject: [PATCH] Add agr search-replace func --- zsh/aliases | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/zsh/aliases b/zsh/aliases index fc09af30..b8239acf 100644 --- a/zsh/aliases +++ b/zsh/aliases @@ -16,6 +16,13 @@ if is_mac && [ -e /Applications/love.app/Contents/MacOS/love ]; then alias love="/Applications/love.app/Contents/MacOS/love" fi +# Text-editing niceties +function agr { + ag -l "$1" | xargs sed -i "" -e "s/${1/\//\\\/}/${2/\//\\\/}/g" + ag "$2" +} + +# Other conveniences if is_mac; then alias ls='ls -G' else