From 1737a0f0a87a17ea7c6aab6e1cf0501f510e5a66 Mon Sep 17 00:00:00 2001 From: Michael Yockey Date: Wed, 25 Jan 2023 11:40:49 -0500 Subject: [PATCH] Add functions capability Includes the wreck directory function --- functions/wreck.zsh | 7 +++++++ install.zsh | 2 ++ zshrc | 13 +++++++++++++ 3 files changed, 22 insertions(+) create mode 100644 functions/wreck.zsh diff --git a/functions/wreck.zsh b/functions/wreck.zsh new file mode 100644 index 0000000..9295489 --- /dev/null +++ b/functions/wreck.zsh @@ -0,0 +1,7 @@ +function wreck() { + pushd . + + WRECKDIR=`mktemp -d /tmp/wreckXXXXXXXXX` && { + cd $WRECKDIR + } +} diff --git a/install.zsh b/install.zsh index e80ad16..39e42f2 100755 --- a/install.zsh +++ b/install.zsh @@ -59,6 +59,8 @@ popd mkdir -p $INSTALL_DIR cp -rf packages $INSTALL_DIR/packages cp -f zshrc $INSTALL_DIR/zshrc +cp -rf functions $INSTALL_DIR/functions +cp -f env $INSTALL_DIR/.env # Insert the INSTALL_DIR variable into the installed run control file sed -i "" -e "1 i\\ diff --git a/zshrc b/zshrc index 1e0d168..bd8e2aa 100644 --- a/zshrc +++ b/zshrc @@ -1,6 +1,10 @@ eval "$(rbenv init -)" eval "$(nodenv init -)" +while IFS= read -r line; do + export $line +done <$INSTALL_DIR/.env + source $INSTALL_DIR/packages/geometry/geometry.zsh if type brew &>/dev/null; then @@ -12,6 +16,10 @@ fi source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh +for file in $INSTALL_DIR/functions/*.zsh; do + source $file +done + typeset -U path cdpath fpath setopt auto_cd cdpath=($HOME/src) @@ -19,4 +27,9 @@ cdpath=($HOME/src) zstyle ':completion:*' group-name '' zstyle ':completion:*:descriptions' format %d +export COMPLETION_WAITING_DOTS="true" +export TERM="xterm-256color" export GPG_TTY=$(tty) +export EDITOR="code -nw" + +export PATH="/usr/local/sbin:$PATH"