From da5ef3b9e22e11192279f0becaa0c8c35b7ff929 Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Mon, 15 Jul 2024 13:39:24 -0400 Subject: Migrate `mkcd` to aliasrc --- .config/aliasrc | 10 +++++++--- .config/zsh/.zshrc | 6 ------ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.config/aliasrc b/.config/aliasrc index 959fee5..3853818 100644 --- a/.config/aliasrc +++ b/.config/aliasrc @@ -7,9 +7,12 @@ # # # #---Universal Shell Alias Configuration File---# # -# First column contains the alias -# Second column contains the command to execute -# Aliases and/or commands cannot contain commas +# Since the creation of the aliasgen script, alias have been migrated to +# functions. This facilitates the following: +# - Escaping quotes +# - Only evaluating variables (ex: $groot) at runtime +# For this to work, "$@" is appended to the end of every function here. +# Take this into consideration when creating new ones. :e, $EDITOR :q, exit @@ -22,6 +25,7 @@ bi, brew install gg, go generate ./... gr, groot=$(git rev-parse --show-toplevel 2>/dev/null); [ -z "$groot" ] || cd "$groot" || return mmi, make clean && make && sudo make install +mkcd, mkdir -p -- "$1" && cd -P -- R, R -q tmcd, tmux attach-session -t tmdd, tmux kill-session -t diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index fef70e0..b621cfd 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -76,12 +76,6 @@ RPROMPT="\$vcs_info_msg_0_ %B%F{magenta}(%B%F{cyan}%1/%B%F{magenta})" zstyle ':vcs_info:git:*' formats '%b' -# Quickly navigate to a created directory -mkcd() { - mkdir -p -- "$1" && - cd -P -- "$1" -} - f() { tmp="$(mktemp -uq)" trap 'rm -f $tmp >/dev/null 2>&1 && trap - HUP INT QUIT TERM EXIT' HUP INT QUIT TERM EXIT -- cgit v1.2.3