From d7e5659e770b19ce89936c59c6a05b502573068f Mon Sep 17 00:00:00 2001 From: Marc Cataford Date: Sat, 8 May 2021 10:42:53 -0400 Subject: [PATCH] feat: basic tmux aliases --- README.md | 14 ++++++++++++++ aliases | 13 +++++++++++++ setup | 21 ++++++++++++--------- 3 files changed, 39 insertions(+), 9 deletions(-) create mode 100644 README.md create mode 100644 aliases diff --git a/README.md b/README.md new file mode 100644 index 0000000..02cf1f6 --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +# Shell goodies + +A collection of shell enhancement for everyday happiness. + +## Setup + +```bash +git clone git@github.com:mcataford/env.git ~/.env_goodies | . ./setup +``` + +## Updating existing setups + +Since `~/.env_goodies` is a cloned repository, pulling new changes should update everything. You may need to `source` +the shell configuration file again for new goodies to apply. diff --git a/aliases b/aliases new file mode 100644 index 0000000..85decf2 --- /dev/null +++ b/aliases @@ -0,0 +1,13 @@ +################ +# TMUX-related # +################ + +# Lists all sessions +alias ts="tmux ls" + +# Attaches to session with name $1 +alias ta="tmux attach -t $1" + +# Create new session with provided name. +alias tm="tmux new -s $1" + diff --git a/setup b/setup index ff25392..2f69194 100644 --- a/setup +++ b/setup @@ -1,12 +1,15 @@ -# ZSH -sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" +#!/bin/bash -# NVM -curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash +SHELL_CONFIG_PATH="" -# YVM -curl -s https://raw.githubusercontent.com/tophat/yvm/master/scripts/install.js | node +if [[ -n $(echo $SHELL | grep zsh) ]]; then + SHELL_CONFIG_PATH="$HOME/.zshrc" +else + SHELL_CONFIG_PATH="$HOME/.bashrc" +fi -# pyenv - -echo "Install PyEnv." +if [[ -z $(cat $SHELL_CONFIG_PATH | grep 'mcataford/env-managed-block') ]]; then + echo '# mcataford/env-managed-block:start +for f in ~/.env_goodies/*; do source $f; done +# mcataford/env-managed-block:end' >> $SHELL_CONFIG_PATH +fi