From 7b47b78ac1fa3fd542a6bc63fe17e0cef8c8b832 Mon Sep 17 00:00:00 2001 From: Eric Torres Date: Fri, 3 Feb 2023 12:34:44 -0800 Subject: [PATCH] Move mkcd() into OS-specific config dirs --- zsh-linux/.config/zsh-linux/zshrc | 15 +++++++++++++++ zsh-macos/.config/zsh-macos/zshrc | 7 +++++++ zsh/.config/zsh/.zshrc | 9 --------- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/zsh-linux/.config/zsh-linux/zshrc b/zsh-linux/.config/zsh-linux/zshrc index 26f4ca2..f1a69ae 100644 --- a/zsh-linux/.config/zsh-linux/zshrc +++ b/zsh-linux/.config/zsh-linux/zshrc @@ -1 +1,16 @@ # Linux-specific zsh configuration +# Make a directory, then change into it +mkcd() { + [[ ! -d "${1}" ]] && gmkdir --parents -- "${1}" + cd "${1}" || exit +} + +autoload -Uz mkcd + +rgenv () { + if [[ -n $1 ]]; then + env | rg --ignore-case $1 + else + return 0 + fi +} diff --git a/zsh-macos/.config/zsh-macos/zshrc b/zsh-macos/.config/zsh-macos/zshrc index c266ba5..14a071f 100644 --- a/zsh-macos/.config/zsh-macos/zshrc +++ b/zsh-macos/.config/zsh-macos/zshrc @@ -1 +1,8 @@ # macOS-specific zsh configuration +# Make a directory, then change into it +mkcd() { + [[ ! -d "${1}" ]] && gmkdir --parents -- "${1}" + cd "${1}" || exit +} + +autoload -Uz mkcd diff --git a/zsh/.config/zsh/.zshrc b/zsh/.config/zsh/.zshrc index bd684b1..4eb3760 100755 --- a/zsh/.config/zsh/.zshrc +++ b/zsh/.config/zsh/.zshrc @@ -52,15 +52,6 @@ cf() { autoload -Uz cf -# Make a directory, then change into it - -mkcd() { - [[ ! -d "${1}" ]] && mkdir --parents -- "${1}" - cd "${1}" || exit -} - -autoload -Uz mkcd - rgenv () { if [[ -n $1 ]]; then env | rg --ignore-case $1