Compare commits
3 Commits
4b401aa1cb
...
5f22fb4d7e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5f22fb4d7e | ||
|
|
d160d1795b | ||
|
|
4a063ea8d5 |
19
.zshrc
19
.zshrc
@@ -1,3 +1,8 @@
|
||||
# Homebrew initialization
|
||||
if [ -d '/opt/homebrew' ]; then
|
||||
eval "$(/opt/homebrew/bin/brew shellenv)"
|
||||
fi
|
||||
|
||||
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
|
||||
# Initialization code that may require console input (password prompts, [y/n]
|
||||
# confirmations, etc.) must go above this block; everything else may go below.
|
||||
@@ -68,7 +73,6 @@ plugins=(
|
||||
systemd
|
||||
k
|
||||
extract
|
||||
z
|
||||
sudo
|
||||
fzf-tab
|
||||
# web-search
|
||||
@@ -137,6 +141,12 @@ plugins=(
|
||||
|
||||
|
||||
fpath+=$ZSH/custom/plugins/zsh-completions/src
|
||||
|
||||
# Setup Homebrew completions for macOS
|
||||
if [[ "$OSTYPE" == "darwin"* ]] && command -v brew &> /dev/null; then
|
||||
FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}"
|
||||
fi
|
||||
|
||||
autoload -U compinit && compinit -C -d ~/.cache/zsh/.zcompdump # zsh-completions
|
||||
# autoload bashcompinit # bash completions
|
||||
# bashcompinit
|
||||
@@ -150,7 +160,7 @@ alias myip="wget -qO- https://wtfismyip.com/text" # quickly show external ip add
|
||||
alias l="ls --hyperlink=auto -lAhrtF" # show all except . .. , sort by recent, / at the end of folders, clickable
|
||||
alias e="exit"
|
||||
alias ip="ip --color=auto"
|
||||
## Install EZA to use this. The better ls command
|
||||
## EZA - the better ls command
|
||||
alias a='eza -la --git --colour-scale all -g --smart-group --icons always --hyperlink' # the new ls; add --hyperlink if you like
|
||||
alias aa='eza -la --git --colour-scale all -g --smart-group --icons always -s modified -r --hyperlink' # sort by new
|
||||
|
||||
@@ -215,4 +225,7 @@ source $ZSH/oh-my-zsh.sh
|
||||
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
|
||||
export FZF_DEFAULT_OPS="--extended"
|
||||
|
||||
alias k="k -h" # show human readable file sizes, in kb, mb etc
|
||||
# Initialize zoxide (smarter cd command)
|
||||
eval "$(zoxide init zsh)"
|
||||
|
||||
alias k="k -h" # show human readable file sizes, in kb, mb etc
|
||||
|
||||
133
install.sh
133
install.sh
@@ -1,5 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Save the original working directory
|
||||
ORIGINAL_DIR="$(pwd)"
|
||||
|
||||
# Flags to determine if the arguments were passed
|
||||
cp_hist_flag=false
|
||||
noninteractive_flag=false
|
||||
@@ -48,35 +51,123 @@ install_packages() {
|
||||
echo "Homebrew is not installed. Installing Homebrew..."
|
||||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||
fi
|
||||
brew install zsh git wget fontconfig
|
||||
brew install zsh git wget fontconfig eza zoxide
|
||||
;;
|
||||
ubuntu|debian)
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y zsh git wget fontconfig
|
||||
|
||||
# Install eza if not already installed
|
||||
if ! command -v eza &> /dev/null; then
|
||||
echo "Installing eza..."
|
||||
# Install GPG if not present
|
||||
if ! command -v gpg &> /dev/null; then
|
||||
sudo apt install -y gpg
|
||||
fi
|
||||
|
||||
# Add eza repository and install
|
||||
sudo mkdir -p /etc/apt/keyrings
|
||||
wget -qO- https://raw.githubusercontent.com/eza-community/eza/main/deb.asc | sudo gpg --dearmor -o /etc/apt/keyrings/gierens.gpg
|
||||
echo "deb [signed-by=/etc/apt/keyrings/gierens.gpg] http://deb.gierens.de stable main" | sudo tee /etc/apt/sources.list.d/gierens.list
|
||||
sudo chmod 644 /etc/apt/keyrings/gierens.gpg /etc/apt/sources.list.d/gierens.list
|
||||
sudo apt update
|
||||
sudo apt install -y eza
|
||||
fi
|
||||
|
||||
# Install zoxide if not already installed
|
||||
if ! command -v zoxide &> /dev/null; then
|
||||
echo "Installing zoxide..."
|
||||
curl -sSfL https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | sh
|
||||
fi
|
||||
;;
|
||||
fedora)
|
||||
sudo dnf install -y zsh git wget fontconfig
|
||||
|
||||
# Install eza if not already installed
|
||||
if ! command -v eza &> /dev/null; then
|
||||
echo "Installing eza..."
|
||||
# For Fedora versions prior to 42
|
||||
if ! sudo dnf install -y eza; then
|
||||
echo "eza not available in official repository, installing from cargo..."
|
||||
if command -v cargo &> /dev/null; then
|
||||
cargo install eza
|
||||
else
|
||||
echo "cargo not found. Please install Rust/cargo first or install eza manually."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Install zoxide if not already installed
|
||||
if ! command -v zoxide &> /dev/null; then
|
||||
echo "Installing zoxide..."
|
||||
# zoxide is available in Fedora 32+
|
||||
if ! sudo dnf install -y zoxide; then
|
||||
echo "zoxide not available in official repository, installing from install script..."
|
||||
curl -sSfL https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | sh
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
centos|rhel)
|
||||
sudo yum install -y zsh git wget fontconfig
|
||||
|
||||
# Install eza if not already installed
|
||||
if ! command -v eza &> /dev/null; then
|
||||
echo "Installing eza..."
|
||||
# Install from cargo as primary method
|
||||
if command -v cargo &> /dev/null; then
|
||||
cargo install eza
|
||||
else
|
||||
echo "cargo not found. Installing from binary..."
|
||||
wget -c https://github.com/eza-community/eza/releases/latest/download/eza_x86_64-unknown-linux-gnu.tar.gz -O - | tar xz
|
||||
sudo chmod +x eza
|
||||
sudo chown root:root eza
|
||||
sudo mv eza /usr/local/bin/eza
|
||||
fi
|
||||
fi
|
||||
|
||||
# Install zoxide if not already installed
|
||||
if ! command -v zoxide &> /dev/null; then
|
||||
echo "Installing zoxide..."
|
||||
# Try dnf first (RHEL 8+ and CentOS Stream have zoxide in EPEL), fallback to install script
|
||||
if ! (command -v dnf &> /dev/null && sudo dnf install -y zoxide); then
|
||||
echo "Installing zoxide from install script..."
|
||||
curl -sSfL https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | sh
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
arch|manjaro)
|
||||
sudo pacman -Syu --noconfirm zsh git wget fontconfig
|
||||
sudo pacman -Syu --noconfirm zsh git wget fontconfig eza zoxide
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported operating system. Please install zsh, git, wget, and fontconfig manually."
|
||||
# Try to install eza from binary for unsupported systems
|
||||
if ! command -v eza &> /dev/null; then
|
||||
echo "Installing eza from binary..."
|
||||
wget -c https://github.com/eza-community/eza/releases/latest/download/eza_x86_64-unknown-linux-gnu.tar.gz -O - | tar xz
|
||||
sudo chmod +x eza
|
||||
sudo chown root:root eza
|
||||
sudo mv eza /usr/local/bin/eza
|
||||
fi
|
||||
|
||||
# Try to install zoxide for unsupported systems
|
||||
if ! command -v zoxide &> /dev/null; then
|
||||
echo "Installing zoxide from install script..."
|
||||
curl -sSfL https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | sh
|
||||
fi
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
|
||||
# Check if required packages are installed, if not, install them
|
||||
if command -v zsh &> /dev/null && command -v git &> /dev/null && command -v wget &> /dev/null && command -v fc-cache &> /dev/null; then
|
||||
echo -e "ZSH, Git, wget, and fontconfig are already installed\n"
|
||||
if command -v zsh &> /dev/null && command -v git &> /dev/null && command -v wget &> /dev/null && command -v fc-cache &> /dev/null && command -v eza &> /dev/null && command -v zoxide &> /dev/null; then
|
||||
echo -e "ZSH, Git, wget, fontconfig, eza, and zoxide are already installed\n"
|
||||
else
|
||||
echo "Installing required packages..."
|
||||
install_packages
|
||||
echo -e "zsh, wget, git, and fontconfig Installed\n"
|
||||
echo -e "zsh, wget, git, fontconfig, eza, and zoxide Installed\n"
|
||||
fi
|
||||
|
||||
if [ -f ~/.gitconfig.backup ]; then
|
||||
@@ -128,25 +219,25 @@ if [ -f ~/.zcompdump ]; then
|
||||
fi
|
||||
|
||||
if [ -d $ZSH/plugins/zsh-autosuggestions ]; then
|
||||
cd $ZSH/plugins/zsh-autosuggestions && git pull
|
||||
git -C $ZSH/plugins/zsh-autosuggestions pull
|
||||
else
|
||||
git clone --depth=1 https://github.com/zsh-users/zsh-autosuggestions $ZSH/plugins/zsh-autosuggestions
|
||||
fi
|
||||
|
||||
if [ -d $ZSH/custom/plugins/zsh-syntax-highlighting ]; then
|
||||
cd $ZSH/custom/plugins/zsh-syntax-highlighting && git pull
|
||||
git -C $ZSH/custom/plugins/zsh-syntax-highlighting pull
|
||||
else
|
||||
git clone --depth=1 https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH/custom/plugins/zsh-syntax-highlighting
|
||||
fi
|
||||
|
||||
if [ -d $ZSH/custom/plugins/zsh-completions ]; then
|
||||
cd $ZSH/custom/plugins/zsh-completions && git pull
|
||||
git -C $ZSH/custom/plugins/zsh-completions pull
|
||||
else
|
||||
git clone --depth=1 https://github.com/zsh-users/zsh-completions $ZSH/custom/plugins/zsh-completions
|
||||
fi
|
||||
|
||||
if [ -d $ZSH/custom/plugins/zsh-history-substring-search ]; then
|
||||
cd $ZSH/custom/plugins/zsh-history-substring-search && git pull
|
||||
git -C $ZSH/custom/plugins/zsh-history-substring-search pull
|
||||
else
|
||||
git clone --depth=1 https://github.com/zsh-users/zsh-history-substring-search $ZSH/custom/plugins/zsh-history-substring-search
|
||||
fi
|
||||
@@ -163,14 +254,14 @@ wget -q --show-progress -N https://github.com/ryanoasis/nerd-fonts/raw/master/pa
|
||||
fc-cache -fv ~/.fonts
|
||||
|
||||
if [ -d $ZSH/custom/themes/powerlevel10k ]; then
|
||||
cd $ZSH/custom/themes/powerlevel10k && git pull
|
||||
git -C $ZSH/custom/themes/powerlevel10k pull
|
||||
else
|
||||
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git $ZSH/custom/themes/powerlevel10k
|
||||
fi
|
||||
curl -s https://git.miomio.moe/mio/easyzsh/raw/branch/master/patch.sh | bash -s p10k
|
||||
|
||||
if [ -d ~/.fzf ]; then
|
||||
cd ~/.fzf && git pull
|
||||
git -C ~/.fzf pull
|
||||
~/.fzf/install --all --key-bindings --completion --no-update-rc
|
||||
else
|
||||
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
|
||||
@@ -178,17 +269,28 @@ else
|
||||
fi
|
||||
|
||||
if [ -d $ZSH/custom/plugins/k ]; then
|
||||
cd $ZSH/custom/plugins/k && git pull
|
||||
git -C $ZSH/custom/plugins/k pull
|
||||
else
|
||||
git clone --depth 1 https://github.com/supercrabtree/k $ZSH/custom/plugins/k
|
||||
fi
|
||||
|
||||
if [ -d $ZSH/custom/plugins/fzf-tab ]; then
|
||||
cd $ZSH/custom/plugins/fzf-tab && git pull
|
||||
git -C $ZSH/custom/plugins/fzf-tab pull
|
||||
else
|
||||
git clone --depth 1 https://github.com/Aloxaf/fzf-tab $ZSH/custom/plugins/fzf-tab
|
||||
fi
|
||||
|
||||
# Import existing z data into zoxide if available
|
||||
if command -v zoxide &> /dev/null; then
|
||||
for z_file in ~/.z ~/.local/share/z/data ~/.zlua ~/.fasd; do
|
||||
if [ -f "$z_file" ]; then
|
||||
echo -e "Importing existing z data from $z_file into zoxide\n"
|
||||
zoxide import --from=z "$z_file" 2>/dev/null || echo "Failed to import $z_file, continuing..."
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# if git clone --depth 1 https://github.com/todotxt/todo.txt-cli.git ~/.config/ezsh/todo; then :
|
||||
@@ -242,4 +344,7 @@ else
|
||||
|
||||
fi
|
||||
fi
|
||||
exit
|
||||
|
||||
# Restore original working directory
|
||||
cd "$ORIGINAL_DIR"
|
||||
exit
|
||||
|
||||
29
install_nvm.sh
Executable file
29
install_nvm.sh
Executable file
@@ -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"
|
||||
4
zshrc/nvm.zsh
Normal file
4
zshrc/nvm.zsh
Normal file
@@ -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
|
||||
11
zshrc/personal.zsh
Normal file
11
zshrc/personal.zsh
Normal file
@@ -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)
|
||||
Reference in New Issue
Block a user