diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 031b033..ec06d3a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -24,14 +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 conda configuration + run: | + conda --version || (echo "Conda is not installed" && exit 1) + shell: zsh {0} - name: Check for Tmux configuration run: | - 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) - + 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) + shell: zsh {0} 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/* 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/install.sh b/install.sh index cc51891..2b7aa93 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,25 +105,15 @@ 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" 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 @@ -150,21 +140,33 @@ install_stow() { set_symlinks() { echo "Setting symlinks using stow from $(pwd)..." - stow -v -R -t $HOME config/ - stow -v -R -t $HOME terminal/ + 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 () { 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 gh tree snapd sudo snap install tldr elif [ "$OS" = "Darwin" ]; then - brew install tree gh tldr + brew install gh tree tldr fi - gh extension install nektos/gh-act } +setup_conda() { + echo "Setting up Conda..." + if ! command_exists conda; then + $HOME/miniconda/bin/conda init zsh + else + conda init zsh + fi +} + + main() { install_brew @@ -176,9 +178,9 @@ main() { install_neovim install_neovim_chad install_tmux - install_tmp install_stow set_symlinks + setup_conda echo "All requested dependencies are installed." } 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 diff --git a/terminal/.zshrc b/terminal/.zshrc new file mode 100644 index 0000000..aef2da9 --- /dev/null +++ b/terminal/.zshrc @@ -0,0 +1,27 @@ +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 +} + +[[ -z $TMUX ]] || conda deactivate; conda activate base + +# alias +alias vim=nvim