aboutsummaryrefslogtreecommitdiff
path: root/.config
diff options
context:
space:
mode:
authorsrdusr <trevorgray@srdusr.com>2023-06-29 02:15:10 +0200
committersrdusr <trevorgray@srdusr.com>2023-06-29 02:15:10 +0200
commit9f5ff81577f35938dfd6def1cabffa70fd70818b (patch)
treea65e68f0e498a0e8404e6cf9f9206d530ae1a858 /.config
parente0cdfda00dcfda3919258a9e8f08244f73edc827 (diff)
downloaddotfiles-9f5ff81577f35938dfd6def1cabffa70fd70818b.tar.gz
dotfiles-9f5ff81577f35938dfd6def1cabffa70fd70818b.zip
Add mkcd() to make and cd into directory
Diffstat (limited to '.config')
-rw-r--r--.config/zsh/.zshrc10
1 files changed, 10 insertions, 0 deletions
diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc
index 6bf58d9..ef3a16d 100644
--- a/.config/zsh/.zshrc
+++ b/.config/zsh/.zshrc
@@ -287,6 +287,16 @@ c() {
cd "$dname"
}
+# Make and cd into directory and any parent directories
+mkcd () {
+ if [[ -z "$1" ]]; then
+ echo "Usage: mkcd <dir>" 1>&2
+ return 1
+ fi
+ mkdir -p "$1"
+ cd "$1"
+}
+
# Back up a file. Usage "backupthis <filename>"
backupthis() {
cp -riv $1 ${1}-$(date +%Y%m%d%H%M).backup;