Skip to content

Commit

Permalink
master : mostly fzf and oh my zsh updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jbhouse committed May 26, 2024
1 parent a9cf2a5 commit 332e941
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 68 deletions.
17 changes: 16 additions & 1 deletion .zsh_functions
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,26 @@ function docker-container-exec () {
}

# git functions (need to handle ??)
# tmux new-session -d -s foo 'exec pfoo'
# tmux send-keys 'bundle exec thin start' 'C-m'
# tmux rename-window 'Foo'
# tmux select-window -t foo:0
# tmux split-window -h 'exec pfoo'
# tmux send-keys 'bundle exec compass watch' 'C-m'
# tmux split-window -v -t 0 'exec pfoo'
# tmux send-keys 'rake ts:start' 'C-m'
# tmux split-window -v -t 1 'exec pfoo'
# tmux -2 attach-session -t foo

function split-and-execute() {
for i in $*; do;
echo "split and execute $i"
done;
}
function git-diff-unstaged() {
preview="git diff $@ --color=always -- {-1}"
git diff $@ --name-only | fzf -m --ansi --preview $preview
}

function git-diff-staged() {
preview="git diff --cached $@ --color=always -- {-1}"
git diff --cached $@ --name-only | fzf -m --ansi --preview $preview
Expand Down
4 changes: 0 additions & 4 deletions .zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ source ~/.oh-my-zsh/oh-my-zsh.sh
source ~/.zsh_env
source ~/.zsh_aliases
source ~/.zsh_functions
source $(brew --prefix)/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source ~/.oh-my-zsh/custom/zsh-syntax-highlighting/themes/catppuccin_frappe-zsh-syntax-highlighting.zsh
# source $(brew --prefix)/Cellar/fzf/**/shellcompletion.zsh
# source $(brew --prefix)/Cellar/fzf/**/shell/key-bindings.zsh
eval "$(fzf --zsh)"
# source ~/.oh-my-zsh/custom/scripts/fzf-git.sh
if [[ ! -z ~/.zsh_local ]]; then ; for i in ~/.zsh_local/.*; do source $i; done ; fi
# [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
Expand Down
67 changes: 44 additions & 23 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,28 @@ read distro
if [[ "$distro" == *"M"* ]] || [[ "$distro" == *"m"* ]];
then
OS_NAME='mac'
PACKAGE_MANAGER='brew'
PACKAGE_MANAGER='brew install'
fi

if [[ "$distro" == *"L"* ]] || [[ "$distro" == *"l"* ]];
then
OS_NAME='linux'
PACKAGE_MANAGER='sudo apt'
PACKAGE_MANAGER='sudo apt install -y'
fi

if [[ "$distro" == *"W"* ]] || [[ "$distro" == *"w"* ]];
then
OS_NAME='pc'
PACKAGE_MANAGER='sudo apt'
PACKAGE_MANAGER='sudo apt install -y'
fi

ln -s $(pwd)/$OS_NAME/.env_vars ~/.zsh_local/.env_vars
ln -s $(pwd)/$OS_NAME/.functions ~/.zsh_local/.functions
if [ -f $(pwd)/$OS_NAME/.aliases ]
then ln -s $(pwd)/$OS_NAME/.aliases ~/.zsh_local/.aliases
ln -s "$(pwd)"/$OS_NAME/.env_vars ~/.zsh_local/.env_vars
ln -s "$(pwd)"/$OS_NAME/.functions ~/.zsh_local/.functions
if [ -f "$(pwd)"/$OS_NAME/.aliases ]
then ln -s "$(pwd)"/$OS_NAME/.aliases ~/.zsh_local/.aliases
fi
ln -s $(pwd)/$OS_NAME/.env_vars ~/.zsh_env
ln -s $(pwd)/$OS_NAME/.zprofile ~/.zprofile
ln -s "$(pwd)"/$OS_NAME/.env_vars ~/.zsh_env
ln -s "$(pwd)"/$OS_NAME/.zprofile ~/.zprofile

echo '----------------------------'
echo 'running distro-specific install steps'
Expand All @@ -45,13 +45,13 @@ echo '----------------------------'
echo 'creating symlinks'
echo '----------------------------'

ln -s $(pwd)/.gitignore_global ~/.gitignore_global
ln -s $(pwd)/.config ~/.config
ln -s $(pwd)/.tmux.conf ~/.tmux.conf
ln -s $(pwd)/.zshrc ~/.zshrc
ln -s $(pwd)/.zsh_aliases ~/.zsh_aliases
ln -s $(pwd)/.zsh_functions ~/.zsh_functions
ln -s $(pwd)/joe2.zsh-theme ~/.oh-my-zsh/themes/joe2.zsh-theme
ln -s "$(pwd)"/.gitignore_global ~/.gitignore_global
ln -s "$(pwd)"/.config ~/.config
ln -s "$(pwd)"/.tmux.conf ~/.tmux.conf
ln -s "$(pwd)"/.zshrc ~/.zshrc
ln -s "$(pwd)"/.zsh_aliases ~/.zsh_aliases
ln -s "$(pwd)"/.zsh_functions ~/.zsh_functions
ln -s "$(pwd)"/joe2.zsh-theme ~/.oh-my-zsh/themes/joe2.zsh-theme

echo '----------------------------'
echo 'symlink aws functions? (y/Y) or (n/N)'
Expand All @@ -61,7 +61,7 @@ read aws_func
# need to create ~/.aws

if [[ "${aws_func}" == "Y" ]] || [[ "${aws_func}" == "y" ]]
then ln -s $(pwd)/util_functions/.aws_functions ~/.zsh_local/.aws_functions
then ln -s "$(pwd)"/util_functions/.aws_functions ~/.zsh_local/.aws_functions
fi

echo
Expand All @@ -72,14 +72,14 @@ read kafka_func
echo

if [[ "${kafka_func}" == "Y" ]] || [[ "${kafka_func}" == "y" ]]
then ln -s $(pwd)/util_functions/.kafka_functions ~/.zsh_local/.kafka_functions
then ln -s "$(pwd)"/util_functions/.kafka_functions ~/.zsh_local/.kafka_functions
brew install kafka
fi

if [ -f ~/.gitconfig ]
if [ -f ~/.gitconfig ]
then
echo "~/.gitconfig already exists."
else
echo "$HOME/.gitconfig already exists."
else
tee -a ~/.gitconfig << EOF
[core]
excludesfile = ~/.gitignore_global
Expand Down Expand Up @@ -114,10 +114,31 @@ echo '----------------------------'
echo 'contents of ~/.gitconfig'
echo '----------------------------'
cat ~/.gitconfig
echo

# install basic dependencies
echo '----------------------------'
echo 'installing software packages'
echo '----------------------------'
$PACKAGE_MANAGER zsh
(cd ~ && sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)")
echo '----------------------------'
echo "installing fzf-tab. may still be broken on most recent release"
echo "may need to undo commits from main. Do so at ~/.oh-my-zsh/custom/plugins/fzf-tab"
echo '----------------------------'
git clone https://github.com/Aloxaf/fzf-tab ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/fzf-tab
git clone https://github.com/Aloxaf/fzf-tab ~/.oh-my-zsh/custom/plugins/fzf-tab
# git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
$PACKAGE_MANAGER micro
$PACKAGE_MANAGER maven
$PACKAGE_MANAGER fzf
$PACKAGE_MANAGER tmuxinator
$PACKAGE_MANAGER bat
$PACKAGE_MANAGER ripgrep
$PACKAGE_MANAGER btop
#$PACKAGE_MANAGER zsh-syntax-highlighting
$PACKAGE_MANAGER rectangle
$PACKAGE_MANAGER gron
$PACKAGE_MANAGER jq
$PACKAGE_MANAGER jnv
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
git clone https://github.com/catppuccin/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/zsh-syntax-highlighting
git clone https://github.com/junegunn/fzf-git.sh.git ~/.oh-my-zsh/custom/scripts
7 changes: 6 additions & 1 deletion mac/.zprofile
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
eval "$(/opt/homebrew/bin/brew shellenv)"

source $(brew --prefix)/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# source $(brew --prefix)/Cellar/fzf/**/shellcompletion.zsh
# source $(brew --prefix)/Cellar/fzf/**/shell/key-bindings.zsh
eval "$(fzf --zsh)"
#M1 ^
# eval "$(/usr/local/Homebrew/bin/brew shellenv)"
#intel ^
#intel ^
23 changes: 0 additions & 23 deletions mac/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,6 @@ mkdir ~/temp
# alias update="brew update --auto-update && brew upgrade && (cd ~/.oh-my-zsh/custom/plugins/fzf-tab && git pull) && (cd ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions && git pull)"
# alias update="brew update --auto-update && brew upgrade && (cd ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions && git pull)"

echo '----------------------------'
echo 'installing software packages'
echo '----------------------------'

brew install zsh
(cd ~ && sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)")
brew install micro
brew install maven
brew install fzf
brew install tmuxinator
brew install bat
brew install ripgrep
brew install btop
brew install zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/catppuccin/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/zsh-syntax-highlighting
git clone https://github.com/junegunn/fzf-git.sh.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/scripts
brew install bat
brew install rectangle
brew install gron
brew install jq
brew install jnv

echo '----------------------------'
echo 'install openjdk 8? (y/Y) or (n/N)'
read install8
Expand Down
18 changes: 2 additions & 16 deletions pc/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,11 @@

sudo apt -y update && sudo apt -y upgrade && sudo apt -y dist-upgrade && sudo apt -y autoremove

ln -s /mnt/c/Users/$(cd /mnt/c && /mnt/c/Windows/System32/cmd.exe /c 'echo %USERNAME%' | sed -e 's/\r//g')/Documents ~/Documents
ln -s /mnt/c/Users/$(cd /mnt/c && /mnt/c/Windows/System32/cmd.exe /c 'echo %USERNAME%' | sed -e 's/\r//g')/Downloads ~/Downloads
ln -s /mnt/c/Users/"$(cd /mnt/c && /mnt/c/Windows/System32/cmd.exe /c 'echo %USERNAME%' | sed -e 's/\r//g')"/Documents ~/Documents
ln -s /mnt/c/Users/"$(cd /mnt/c && /mnt/c/Windows/System32/cmd.exe /c 'echo %USERNAME%' | sed -e 's/\r//g')"/Downloads ~/Downloads
mkdir /mnt/c/repos && ln -s /mnt/c/repos ~/repos
mkdir /mnt/c/temp && ln -s /mnt/c/temp ~/temp

echo '----------------------------'
echo 'installing software packages'
echo '----------------------------'

sudo apt install -y zsh
(cd ~ && sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)")
sudo apt install -y micro
sudo apt install -y maven
sudo apt install -y fzf
sudo apt install -y tmuxinator
sudo apt install -y bat
sudo apt install -y ripgrep
sudo apt install -y btop

echo 'install openjdk 8? (y/Y) or (n/N)'
read install8
echo 'install openjdk 11? (y/Y) or (n/N)'
Expand Down

0 comments on commit 332e941

Please sign in to comment.