From 0fbf4b41ee3a7bd59fa2e540a261247d4c193b8a Mon Sep 17 00:00:00 2001 From: Matthew Jensen Date: Tue, 3 Aug 2021 10:18:04 -0700 Subject: [PATCH] add back files. add sourcing bashrc to profile. --- Makefile | 4 +++- dotfiles/.bash_profile | 17 +++++++++++++++-- dotfiles/.gitignore | 1 + 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 dotfiles/.gitignore diff --git a/Makefile b/Makefile index b9bcec7..33f4f46 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,12 @@ FILES:=.vimrc .gitconfig .bash_profile all:$(FILES) - source ${HOME}/.bash_profile + . ${HOME}/.bash_profile $(FILES): + cp -rf $(HOME)/$@ dotfiles/$@.bak cp -rf dotfiles/$@ ${HOME}/$@ clean: @echo "clean: idk yet.\nTODO: default config swap\n- .git-config.sample.\n- .debian_bash_profile.sample\n- .vimrc.sample?" + diff --git a/dotfiles/.bash_profile b/dotfiles/.bash_profile index b7bd7b1..5c921f2 100644 --- a/dotfiles/.bash_profile +++ b/dotfiles/.bash_profile @@ -1,10 +1,23 @@ -export VISUAL=vim +export VISUAL=vi export EDITOR="$VISUAL" -function homestead() { +homestead() { ( cd ~/Homestead && vagrant $* ) } alias hup="homestead up && homestead ssh" PATH=$PATH:$HOME/.config/composer/vendor/bin set -o vi + +# tm - create new tmux session, or switch to existing one. Works from within tmux too. (@bag-man) +# `tm` will allow you to select your tmux session via fzf. +# `tm irc` will attach to the irc session (if it exists), else it will create it. + +tm() { + [[ -n "$TMUX" ]] && change="switch-client" || change="attach-session" + if [ $1 ]; then + tmux $change -t "$1" 2>/dev/null || (tmux new-session -d -s $1 && tmux $change -t "$1"); return + fi + session=$(tmux list-sessions -F "#{session_name}" 2>/dev/null | fzf --exit-0) && tmux $change -t "$session" || echo "No sessions found." +} +. ~/.bashrc diff --git a/dotfiles/.gitignore b/dotfiles/.gitignore new file mode 100644 index 0000000..751553b --- /dev/null +++ b/dotfiles/.gitignore @@ -0,0 +1 @@ +*.bak