From 115b426f5c17efd83ffaa1610e35fb911ca51e56 Mon Sep 17 00:00:00 2001 From: FedericoGarza Date: Tue, 7 Nov 2023 00:43:46 +0000 Subject: [PATCH 01/17] feat: add zshrc file --- terminal/.zshrc | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 terminal/.zshrc diff --git a/terminal/.zshrc b/terminal/.zshrc new file mode 100644 index 0000000..8b05620 --- /dev/null +++ b/terminal/.zshrc @@ -0,0 +1,25 @@ +export ZSH="$HOME/.oh-my-zsh" +ZSH_THEME="robbyrussell" +plugins=(git) + +source $ZSH/oh-my-zsh.sh + +# User configuration +TIMEPROMPT='%{$fg_bold[blue]%}%D{%b %d, %Y - %H:%M:%S}%{$reset_color%}' + +function preexec() { + timer=${timer:-$SECONDS} +} + +function precmd() { + if [ $timer ]; then + timer_show=$(($SECONDS - $timer)) + export RPROMPT="%F{cyan}${timer_show}s %{$reset_color%} ${TIMEPROMPT}" + unset timer +else + export RPROMPT=$TIMEPROMPT + fi +} + +# alias +alias vim=nvim From 08266fac867ab099c45a96508d8af64f5e168a21 Mon Sep 17 00:00:00 2001 From: FedericoGarza Date: Tue, 7 Nov 2023 00:45:19 +0000 Subject: [PATCH 02/17] feat: add tmux zsh config --- terminal/.zshrc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/terminal/.zshrc b/terminal/.zshrc index 8b05620..aef2da9 100644 --- a/terminal/.zshrc +++ b/terminal/.zshrc @@ -21,5 +21,7 @@ else fi } +[[ -z $TMUX ]] || conda deactivate; conda activate base + # alias alias vim=nvim From 0d9b60798095936c869ab8d371221bcf847121de Mon Sep 17 00:00:00 2001 From: FedericoGarza Date: Tue, 7 Nov 2023 00:46:35 +0000 Subject: [PATCH 03/17] fix: configure conda for zsh --- install.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/install.sh b/install.sh index cc51891..caf506f 100755 --- a/install.sh +++ b/install.sh @@ -165,6 +165,12 @@ install_additional_deps () { gh extension install nektos/gh-act } +setup_conda() { + echo "Setting up Conda..." + $HOME/miniconda/bin/conda init zsh +} + + main() { install_brew @@ -179,6 +185,7 @@ main() { install_tmp install_stow set_symlinks + setup_conda echo "All requested dependencies are installed." } From 434cc5344e239e118665bcf98c3c61f24921627d Mon Sep 17 00:00:00 2001 From: FedericoGarza Date: Tue, 7 Nov 2023 00:50:57 +0000 Subject: [PATCH 04/17] test: add conda test --- .github/workflows/ci.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 031b033..00e1514 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -35,3 +35,7 @@ jobs: test -f "$HOME/.tmux/plugins/tpm/tpm" || (echo "Tmux plugins dont exist" && exit 1) test -f "$HOME/.tmux.conf" || (echo "Tmux configuration dont exists" && exit 1) + - name: Check for conda configuration + run: | + zsh + conda --version || (echo "Conda is not installed" && exit 1) From 33dec8e45587ac70e0f11ad4d6f2d91d9c19d0d0 Mon Sep 17 00:00:00 2001 From: FedericoGarza Date: Tue, 7 Nov 2023 01:22:40 +0000 Subject: [PATCH 05/17] fix: call conda if it exists --- install.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index caf506f..88a0232 100755 --- a/install.sh +++ b/install.sh @@ -167,7 +167,11 @@ install_additional_deps () { setup_conda() { echo "Setting up Conda..." - $HOME/miniconda/bin/conda init zsh + if ! command_exists conda; then + $HOME/miniconda/bin/conda init zsh + else + conda init zsh + fi } From 8e1a114c00e2a6666f0cb8ebfdd753712b4238f8 Mon Sep 17 00:00:00 2001 From: FedericoGarza Date: Tue, 7 Nov 2023 01:40:06 +0000 Subject: [PATCH 06/17] fix: tmux installation --- .github/workflows/ci.yaml | 2 +- install.sh | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 00e1514..fbe0034 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -32,7 +32,7 @@ jobs: - name: Check for Tmux configuration run: | - test -f "$HOME/.tmux/plugins/tpm/tpm" || (echo "Tmux plugins dont exist" && exit 1) + test -d "$HOME/.tmux/plugins/tpm" || (echo "Tmux plugins dont exist" && exit 1) test -f "$HOME/.tmux.conf" || (echo "Tmux configuration dont exists" && exit 1) - name: Check for conda configuration diff --git a/install.sh b/install.sh index 88a0232..17a2911 100755 --- a/install.sh +++ b/install.sh @@ -90,10 +90,10 @@ install_neovim_chad() { install_neovim() { echo "Installing Neovim..." if ! command_exists nvim; then - if [ "$OS" = "Linux" ]; then - sudo snap install nvim --classic # using snap to get the latest version of neovim + if [ "$OS" = "Linux" ]; then + sudo snap install nvim --classic # using snap to get the latest version of neovim elif [ "$OS" = "Darwin" ]; then - brew install neovim + brew install neovim fi else echo "Neovim is already installed" @@ -105,9 +105,9 @@ install_tmux() { echo "Installing Tmux..." if ! command_exists tmux; then if [ "$OS" = "Linux" ]; then - sudo apt-get update && sudo apt-get install -y tmux + sudo apt-get update && sudo apt-get install -y tmux elif [ "$OS" = "Darwin" ]; then - brew install tmux + brew install tmux fi else echo "Tmux is already installed" From 871829b2029f098937d975b93c18da26cd909db0 Mon Sep 17 00:00:00 2001 From: FedericoGarza Date: Tue, 7 Nov 2023 02:02:46 +0000 Subject: [PATCH 07/17] feat: add tpm as submodule --- .gitmodules | 3 +++ terminal/.tmux/plugins/tpm | 1 + 2 files changed, 4 insertions(+) create mode 100644 .gitmodules create mode 160000 terminal/.tmux/plugins/tpm diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..0e3ed4c --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "terminal/.tmux/plugins/tpm"] + path = terminal/.tmux/plugins/tpm + url = https://github.com/tmux-plugins/tpm diff --git a/terminal/.tmux/plugins/tpm b/terminal/.tmux/plugins/tpm new file mode 160000 index 0000000..99469c4 --- /dev/null +++ b/terminal/.tmux/plugins/tpm @@ -0,0 +1 @@ +Subproject commit 99469c4a9b1ccf77fade25842dc7bafbc8ce9946 From d2c1879bce5cc5e5ce33a365c5e9e236a98d1cae Mon Sep 17 00:00:00 2001 From: FedericoGarza Date: Tue, 7 Nov 2023 02:06:32 +0000 Subject: [PATCH 08/17] fix: ignore installed plugins --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 944f1b2..5a75788 100644 --- a/.gitignore +++ b/.gitignore @@ -160,3 +160,4 @@ cython_debug/ #.idea/ *.tar.gz */~/* +*/.tmux/plugins/* From e69a6302c37e7a353f44b04f05b58739601588c9 Mon Sep 17 00:00:00 2001 From: FedericoGarza Date: Tue, 7 Nov 2023 02:06:49 +0000 Subject: [PATCH 09/17] fix: use tmp submodule --- install.sh | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/install.sh b/install.sh index 17a2911..f0f2ae0 100755 --- a/install.sh +++ b/install.sh @@ -114,16 +114,6 @@ install_tmux() { fi } -# install tmp -install_tmp() { - echo "Installing tmp..." - if ! [ -d "$HOME/.tmux/plugins/tpm" ]; then - git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm - else - echo "tmp is already installed" - fi -} - install_brew() { echo "Installing Homebrew..." if ! command_exists brew; then From 780e992e020536216aa31786766ce26d3874a996 Mon Sep 17 00:00:00 2001 From: FedericoGarza Date: Tue, 7 Nov 2023 02:14:27 +0000 Subject: [PATCH 10/17] fix: run on zsh --- .github/workflows/ci.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index fbe0034..ec9d98f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -24,18 +24,21 @@ jobs: run: | test -f "$HOME/.zshrc" || (echo "Zsh configuration dont exist" && exit 1) test -d "$HOME/.oh-my-zsh" || (echo "Oh My Zsh is not installed" && exit 1) + shell: zsh {0} - name: Check for Neovim configuration run: | test -f "$HOME/.config/nvim/init.lua" || (echo "Neovim configuration dont exist" && exit 1) test -d "$HOME/.config/nvim/lua/custom" || (echo "Neovim plugins dont exist" && exit 1) + shell: zsh {0} - name: Check for Tmux configuration run: | test -d "$HOME/.tmux/plugins/tpm" || (echo "Tmux plugins dont exist" && exit 1) test -f "$HOME/.tmux.conf" || (echo "Tmux configuration dont exists" && exit 1) + shell: zsh {0} - name: Check for conda configuration run: | - zsh conda --version || (echo "Conda is not installed" && exit 1) + shell: zsh {0} From 689a58877b024804d5e3738be4159e751c814a1e Mon Sep 17 00:00:00 2001 From: FedericoGarza Date: Tue, 7 Nov 2023 02:22:48 +0000 Subject: [PATCH 11/17] test --- .github/workflows/ci.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ec9d98f..61f2426 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -32,13 +32,13 @@ jobs: test -d "$HOME/.config/nvim/lua/custom" || (echo "Neovim plugins dont exist" && exit 1) shell: zsh {0} + - name: Check for conda configuration + run: | + conda --version || (echo "Conda is not installed" && exit 1) + shell: zsh {0} + - name: Check for Tmux configuration run: | test -d "$HOME/.tmux/plugins/tpm" || (echo "Tmux plugins dont exist" && exit 1) test -f "$HOME/.tmux.conf" || (echo "Tmux configuration dont exists" && exit 1) shell: zsh {0} - - - name: Check for conda configuration - run: | - conda --version || (echo "Conda is not installed" && exit 1) - shell: zsh {0} From 23f95ca01649e2998db8ba6ca2cbed438c17615e Mon Sep 17 00:00:00 2001 From: FedericoGarza Date: Tue, 7 Nov 2023 02:29:47 +0000 Subject: [PATCH 12/17] test: change to see if changes --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 61f2426..ec06d3a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -39,6 +39,6 @@ jobs: - name: Check for Tmux configuration run: | + test -f "$HOME/.tmux.conf" || (echo "Tmux configuration dont exist" && exit 1) test -d "$HOME/.tmux/plugins/tpm" || (echo "Tmux plugins dont exist" && exit 1) - test -f "$HOME/.tmux.conf" || (echo "Tmux configuration dont exists" && exit 1) shell: zsh {0} From 1632324bcdd8a1874c1b2c79825a31c49579810e Mon Sep 17 00:00:00 2001 From: FedericoGarza Date: Tue, 7 Nov 2023 02:39:09 +0000 Subject: [PATCH 13/17] fix: rm gh and act --- install.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index f0f2ae0..a395a32 100755 --- a/install.sh +++ b/install.sh @@ -147,12 +147,11 @@ set_symlinks() { install_additional_deps () { echo "Installing additional dependencies..." if [ "$OS" = "Linux" ]; then - sudo apt-get update && sudo apt-get install -y tree gh snapd + sudo apt-get update && sudo apt-get install -y tree snapd sudo snap install tldr elif [ "$OS" = "Darwin" ]; then - brew install tree gh tldr + brew install tree tldr fi - gh extension install nektos/gh-act } setup_conda() { @@ -176,7 +175,6 @@ main() { install_neovim install_neovim_chad install_tmux - install_tmp install_stow set_symlinks setup_conda From 208cf12a331dbf22df8df0055b5d59ac61dca130 Mon Sep 17 00:00:00 2001 From: FedericoGarza Date: Tue, 7 Nov 2023 02:48:44 +0000 Subject: [PATCH 14/17] test: change stow order --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index a395a32..fa829a4 100755 --- a/install.sh +++ b/install.sh @@ -140,8 +140,8 @@ install_stow() { set_symlinks() { echo "Setting symlinks using stow from $(pwd)..." - stow -v -R -t $HOME config/ stow -v -R -t $HOME terminal/ + stow -v -R -t $HOME config/ } install_additional_deps () { From 2d9085328e84c1e7dc5e0e9676d03878e199e851 Mon Sep 17 00:00:00 2001 From: FedericoGarza Date: Tue, 7 Nov 2023 02:57:34 +0000 Subject: [PATCH 15/17] fix: mv .zshrc if exists --- install.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index fa829a4..b191d71 100755 --- a/install.sh +++ b/install.sh @@ -140,8 +140,11 @@ install_stow() { set_symlinks() { echo "Setting symlinks using stow from $(pwd)..." - stow -v -R -t $HOME terminal/ - stow -v -R -t $HOME config/ + if [-f "$HOME/.zshrc"]; then + mv $HOME/.zshrc $HOME/.zshrc.backup + fi + stow -v -R -t $HOME terminal + stow -v -R -t $HOME config } install_additional_deps () { From 4003b6bc2e79dac8c560f2e7624f74c1d51f9b77 Mon Sep 17 00:00:00 2001 From: FedericoGarza Date: Tue, 7 Nov 2023 03:03:05 +0000 Subject: [PATCH 16/17] fix: add correct space --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index b191d71..3e4c984 100755 --- a/install.sh +++ b/install.sh @@ -140,7 +140,7 @@ install_stow() { set_symlinks() { echo "Setting symlinks using stow from $(pwd)..." - if [-f "$HOME/.zshrc"]; then + if [ -f "$HOME/.zshrc" ]; then mv $HOME/.zshrc $HOME/.zshrc.backup fi stow -v -R -t $HOME terminal From e7fe705856866d9cfa7ce92b23186abc81b288f9 Mon Sep 17 00:00:00 2001 From: FedericoGarza Date: Tue, 7 Nov 2023 03:11:44 +0000 Subject: [PATCH 17/17] feat: recover gh --- install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 3e4c984..2b7aa93 100755 --- a/install.sh +++ b/install.sh @@ -150,10 +150,10 @@ set_symlinks() { install_additional_deps () { echo "Installing additional dependencies..." if [ "$OS" = "Linux" ]; then - sudo apt-get update && sudo apt-get install -y tree snapd + sudo apt-get update && sudo apt-get install -y gh tree snapd sudo snap install tldr elif [ "$OS" = "Darwin" ]; then - brew install tree tldr + brew install gh tree tldr fi }