✨ (.zshrc, install.sh): add autojump support and installation across multiple OSes
This commit is contained in:
4
.zshrc
4
.zshrc
@@ -224,6 +224,10 @@ source $ZSH/oh-my-zsh.sh
|
|||||||
|
|
||||||
# Configs that can only work after "source $ZSH/oh-my-zsh.sh", such as Aliases that depend oh-my-zsh plugins
|
# Configs that can only work after "source $ZSH/oh-my-zsh.sh", such as Aliases that depend oh-my-zsh plugins
|
||||||
|
|
||||||
|
# Autojump configuration
|
||||||
|
[ -f /usr/local/etc/profile.d/autojump.sh ] && . /usr/local/etc/profile.d/autojump.sh
|
||||||
|
[ -f /usr/share/autojump/autojump.sh ] && . /usr/share/autojump/autojump.sh
|
||||||
|
|
||||||
# Now source fzf.zsh , otherwise Ctr+r is overwritten by ohmyzsh
|
# Now source fzf.zsh , otherwise Ctr+r is overwritten by ohmyzsh
|
||||||
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
|
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
|
||||||
export FZF_DEFAULT_OPS="--extended"
|
export FZF_DEFAULT_OPS="--extended"
|
||||||
|
|||||||
18
install.sh
18
install.sh
@@ -48,35 +48,35 @@ install_packages() {
|
|||||||
echo "Homebrew is not installed. Installing Homebrew..."
|
echo "Homebrew is not installed. Installing Homebrew..."
|
||||||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||||
fi
|
fi
|
||||||
brew install zsh git wget fontconfig
|
brew install zsh git wget fontconfig autojump
|
||||||
;;
|
;;
|
||||||
ubuntu|debian)
|
ubuntu|debian)
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y zsh git wget fontconfig
|
sudo apt-get install -y zsh git wget fontconfig autojump
|
||||||
;;
|
;;
|
||||||
fedora)
|
fedora)
|
||||||
sudo dnf install -y zsh git wget fontconfig
|
sudo dnf install -y zsh git wget fontconfig autojump
|
||||||
;;
|
;;
|
||||||
centos|rhel)
|
centos|rhel)
|
||||||
sudo yum install -y zsh git wget fontconfig
|
sudo yum install -y zsh git wget fontconfig autojump
|
||||||
;;
|
;;
|
||||||
arch|manjaro)
|
arch|manjaro)
|
||||||
sudo pacman -Syu --noconfirm zsh git wget fontconfig
|
sudo pacman -Syu --noconfirm zsh git wget fontconfig autojump
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Unsupported operating system. Please install zsh, git, wget, and fontconfig manually."
|
echo "Unsupported operating system. Please install zsh, git, wget, fontconfig, and autojump manually."
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
# Check if required packages are installed, if not, install them
|
# 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
|
if command -v zsh &> /dev/null && command -v git &> /dev/null && command -v wget &> /dev/null && command -v fc-cache &> /dev/null && command -v autojump &> /dev/null; then
|
||||||
echo -e "ZSH, Git, wget, and fontconfig are already installed\n"
|
echo -e "ZSH, Git, wget, fontconfig, and autojump are already installed\n"
|
||||||
else
|
else
|
||||||
echo "Installing required packages..."
|
echo "Installing required packages..."
|
||||||
install_packages
|
install_packages
|
||||||
echo -e "zsh, wget, git, and fontconfig Installed\n"
|
echo -e "zsh, wget, git, fontconfig, and autojump Installed\n"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f ~/.gitconfig.backup ]; then
|
if [ -f ~/.gitconfig.backup ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user