From 720f41b8b29e4952dc43df8d0ef8e0d18dbc149e Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Thu, 10 Sep 2020 14:43:15 +0100 Subject: [PATCH] zsh: Change `m` from an alias to a function Change `m` from an alias to a function to allow for passing additional parameters. --- tag-zsh/zsh/configs/aliases.zsh | 1 - tag-zsh/zsh/configs/functions.zsh | 9 +++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tag-zsh/zsh/configs/aliases.zsh b/tag-zsh/zsh/configs/aliases.zsh index ae006cc..36cb415 100644 --- a/tag-zsh/zsh/configs/aliases.zsh +++ b/tag-zsh/zsh/configs/aliases.zsh @@ -1,6 +1,5 @@ alias c="clear" alias l="ls -lah" -alias m="if [[ -f .notes/Makefile ]]; then make -f .notes/Makefile; else make; fi" alias mkdir="mkdir -p" alias s=symfony alias v=vagrant diff --git a/tag-zsh/zsh/configs/functions.zsh b/tag-zsh/zsh/configs/functions.zsh index 315f83a..daaef87 100644 --- a/tag-zsh/zsh/configs/functions.zsh +++ b/tag-zsh/zsh/configs/functions.zsh @@ -1,3 +1,12 @@ +function m() { + if [[ -f .notes/Makefile ]]; + then + make -f .notes/Makefile "$@" + else + make "$@" + fi +} + function mkd() { mkdir -p "$@" && cd "$@" }