From 5f22fb4d7ef5da6d36d0bfcd11e63ebba98f117c Mon Sep 17 00:00:00 2001 From: Frank Qing Date: Wed, 28 May 2025 02:42:18 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20(.zshrc,=20install.sh):=20fix=20?= =?UTF-8?q?newline=20issues=20at=20the=20end=20of=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .zshrc | 2 +- install.sh | 2 +- install_nvm.sh | 29 +++++++++++++++++++++++++++++ zshrc/nvm.zsh | 4 ++++ zshrc/personal.zsh | 11 +++++++++++ 5 files changed, 46 insertions(+), 2 deletions(-) create mode 100755 install_nvm.sh create mode 100644 zshrc/nvm.zsh create mode 100644 zshrc/personal.zsh diff --git a/.zshrc b/.zshrc index a89eab8..f7d9a28 100644 --- a/.zshrc +++ b/.zshrc @@ -228,4 +228,4 @@ export FZF_DEFAULT_OPS="--extended" # Initialize zoxide (smarter cd command) eval "$(zoxide init zsh)" -alias k="k -h" # show human readable file sizes, in kb, mb etc \ No newline at end of file +alias k="k -h" # show human readable file sizes, in kb, mb etc diff --git a/install.sh b/install.sh index d7183ea..3fb0e7d 100755 --- a/install.sh +++ b/install.sh @@ -347,4 +347,4 @@ fi # Restore original working directory cd "$ORIGINAL_DIR" -exit \ No newline at end of file +exit diff --git a/install_nvm.sh b/install_nvm.sh new file mode 100755 index 0000000..0f9f71d --- /dev/null +++ b/install_nvm.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +# Save the original working directory +ORIGINAL_DIR="$(pwd)" + +# Install nvm (Node Version Manager) if it is not already installed +if command -v nvm &> /dev/null; then + echo -e "nvm is already installed\n" +else + echo -e "Installing nvm (Node Version Manager)\n" + # Using the official install script (https://github.com/nvm-sh/nvm) + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash + + # Load nvm for the remainder of this script + export NVM_DIR="${XDG_CONFIG_HOME:-$HOME/.nvm}" + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" +fi + +# OPTIONAL: Install the latest LTS version of Node.js +# Uncomment the following line if you would like to automatically install it +nvm install --lts + +# Apply the "basic" zsh configuration patch (downloads zshrc/basic.zsh to ~/.config/zshrc/basic.zsh) +curl -s https://git.miomio.moe/mio/easyzsh/raw/branch/master/patch.sh | bash -s basic + +# Restore original working directory +cd "$ORIGINAL_DIR" + +echo -e "\nAll basic packages have been installed. Restart your terminal or run 'source ~/.zshrc' to start using them.\n" diff --git a/zshrc/nvm.zsh b/zshrc/nvm.zsh new file mode 100644 index 0000000..8a4849d --- /dev/null +++ b/zshrc/nvm.zsh @@ -0,0 +1,4 @@ +# Initialize nvm (Node Version Manager) +export NVM_DIR="${XDG_CONFIG_HOME:-$HOME/.nvm}" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm +[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion diff --git a/zshrc/personal.zsh b/zshrc/personal.zsh new file mode 100644 index 0000000..be2d74e --- /dev/null +++ b/zshrc/personal.zsh @@ -0,0 +1,11 @@ + +# This my personal zshrc configs. Feel free to use it and modify according to your needs +# Place all your .zshrc configurations (including this one) in a single or multiple files under ~/.config/ezsh/zshrc/ folder + +# Additional OH-MY-ZSH plugins to enable +plugins+=(lol httpie docker docker-compose pyenv pip) + +# Remove OH-MY-ZSH plugins from the default config +plugins=(${plugins:#(zsh-autosuggestions|lol)}) + +POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(virtualenv status command_execution_time background_jobs todo ram load rvm time) \ No newline at end of file