From ca4d693a8b87ff3f8ea28106f07b6951cf1d6973 Mon Sep 17 00:00:00 2001 From: Eric Torres Date: Tue, 13 Dec 2022 20:54:24 -0800 Subject: [PATCH] Split os-specific zsh-aliases into their own files --- .../{00-aliases.zsh => 00-linux-aliases.zsh} | 11 +++++++++++ .../{00-aliases.zsh => 00-macos-aliases.zsh} | 18 +++++++++--------- zsh/.config/zsh/00-common-aliases.zsh | 11 +---------- 3 files changed, 21 insertions(+), 19 deletions(-) rename zsh-linux/.config/zsh-linux/{00-aliases.zsh => 00-linux-aliases.zsh} (86%) rename zsh-macos/.config/zsh-macos/{00-aliases.zsh => 00-macos-aliases.zsh} (76%) diff --git a/zsh-linux/.config/zsh-linux/00-aliases.zsh b/zsh-linux/.config/zsh-linux/00-linux-aliases.zsh similarity index 86% rename from zsh-linux/.config/zsh-linux/00-aliases.zsh rename to zsh-linux/.config/zsh-linux/00-linux-aliases.zsh index 358b245..3480ad2 100644 --- a/zsh-linux/.config/zsh-linux/00-aliases.zsh +++ b/zsh-linux/.config/zsh-linux/00-linux-aliases.zsh @@ -62,6 +62,17 @@ alias ll='ls --classify --color --group-directories-first --human-readable -l' alias bootloader='cd /boot/loader/entries' alias restartfans='sudo systemctl restart fancontrol.service' +# zsh +alias zdotdir='cd -- ${ZDOTDIR}' +alias zshaliases='${EDITOR} -- "${XDG_CONFIG_HOME}"/zsh-linux/00-linux-aliases.zsh' +alias zbindings='${EDITOR} -- ${ZDOTDIR}/keybindings.zsh' +alias zhist='${EDITOR} -- ${HISTFILE}' +alias zpath='${EDITOR} -- ${ZDOTDIR}/path.zsh' +alias zprompt='${EDITOR} -- ${ZDOTDIR}/prompt.zsh' +alias zshrc='${EDITOR} -- ${ZDOTDIR}/.zshrc' +alias zshrefresh='source -- ${ZDOTDIR}/.zshrc' +alias zshenv='${EDITOR} -- ${ZDOTDIR}/.zshenv' + # ---------- Parameterized Aliases ---------- # List all binaries of a given package lsbin() { diff --git a/zsh-macos/.config/zsh-macos/00-aliases.zsh b/zsh-macos/.config/zsh-macos/00-macos-aliases.zsh similarity index 76% rename from zsh-macos/.config/zsh-macos/00-aliases.zsh rename to zsh-macos/.config/zsh-macos/00-macos-aliases.zsh index 822ef7e..57417b9 100644 --- a/zsh-macos/.config/zsh-macos/00-aliases.zsh +++ b/zsh-macos/.config/zsh-macos/00-macos-aliases.zsh @@ -33,15 +33,15 @@ alias pacsearch='pacman -Ss' alias myip='curl ifconfig.me' # zsh -alias zdotdir='cd -- "$ZDOTDIR"' -alias zshaliases='${EDITOR} -- "$XDG_CONFIG_HOME"/zsh-macos/00-aliases.zsh' -alias zbindings='${EDITOR} -- "$XDG_CONFIG_HOME"/zsh/00-keybindings.zsh' -alias zconf='cd -- $ZDOTDIR' -alias zhist='${EDITOR} -- "${HISTFILE}"' -alias zpath='${EDITOR} -- "$XDG_CONFIG_HOME"/zsh-macos/path.zsh' -alias zprompt='${EDITOR} -- "$ZDOTDIR"/prompt.zsh' -alias zshrc='${EDITOR} -- "$ZDOTDIR"/.zshrc' -alias zshenv='${EDITOR} -- "$ZDOTDIR"/.zshenv' +alias zdotdir='cd -- ${ZDOTDIR}' +alias zshaliases='${EDITOR} -- "${XDG_CONFIG_HOME}"/zsh-linux/00-macos-aliases.zsh' +alias zbindings='${EDITOR} -- ${ZDOTDIR}/keybindings.zsh' +alias zhist='${EDITOR} -- ${HISTFILE}' +alias zpath='${EDITOR} -- ${ZDOTDIR}/path.zsh' +alias zprompt='${EDITOR} -- ${ZDOTDIR}/prompt.zsh' +alias zshrc='${EDITOR} -- ${ZDOTDIR}/.zshrc' +alias zshrefresh='source -- ${ZDOTDIR}/.zshrc' +alias zshenv='${EDITOR} -- ${ZDOTDIR}/.zshenv' # ---------- Parameterized Aliases ---------- # Use macOS-specific command line flags diff --git a/zsh/.config/zsh/00-common-aliases.zsh b/zsh/.config/zsh/00-common-aliases.zsh index cb00054..ddae0ae 100644 --- a/zsh/.config/zsh/00-common-aliases.zsh +++ b/zsh/.config/zsh/00-common-aliases.zsh @@ -52,13 +52,4 @@ alias sshconfig='"${EDITOR}" -- ${HOME}/.ssh/config' alias myip='curl ifconfig.me' # zsh -alias zdotdir='cd -- ${ZDOTDIR:-${HOME}/.zsh}' -alias zshaliases='${EDITOR} -- ${ZDOTDIR:-${HOME}/.zsh}/conf.d/00-aliases.zsh' -alias zbindings='${EDITOR} -- ${ZDOTDIR:-${HOME}/.zsh}/conf.d/keybindings.zsh' -alias zhist='${EDITOR} -- ${HISTFILE}' -alias zmod='cd -- ${ZDOTDIR:-${HOME}/.zsh}/conf.d/modules' -alias zpath='${EDITOR} -- ${ZDOTDIR:-${HOME}/.zsh}/conf.d/path.zsh' -alias zprompt='${EDITOR} -- ${ZDOTDIR:-${HOME}/.zsh}/conf.d/prompt.zsh' -alias zshrc='${EDITOR} -- ${ZDOTDIR:-${HOME}/.zsh}/.zshrc' -alias zshrefresh='source -- ${ZDOTDIR:-${HOME}/.zsh}/.zshrc' -alias zshenv='${EDITOR} -- ${ZDOTDIR:-${HOME}/.zsh}/.zshenv' +alias zshcaliases='"${EDITOR}" "${ZDOTDIR}"/00-common-aliases.zsh'