sudo apt install zsh
,2. 将Zsh设置为默认Shell:chsh -s /bin/zsh
,3. 安装Oh My Zsh:git clone git://github.com/ohmyzsh/ohmyzsh.git ~/.oh-my-zsh
,4. 配置Oh My Zsh:source ~/.oh-my-zsh/custom/themes/agnosterc.zsh-theme
和 source ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh
Zsh简介
Zsh(Z Shell)是一个功能强大的Unix shell,它是Bash(Bourne Again Shell)的一个替代品,Zsh具有很多优秀的特性,如自动补全、命令历史、命令别名等,使得用户在使用终端时能够更加高效地完成任务,本文将介绍如何在Linux系统中配置一个简洁高效的Zsh。
安装Zsh
1、更新系统软件包列表:
sudo apt-get update
2、安装Zsh:
sudo apt-get install zsh
3、(可选)为Zsh设置默认版本:
chsh -s $(which zsh)
4、检查Zsh版本:
zsh --version
配置Zsh环境变量
1、打开Zsh配置文件:
vim ~/.zshrc
2、在配置文件中添加以下内容:
设置编码格式 export LC_ALL=en_US.UTF-8 export LANG=en_US.UTF-8 设置命令行提示符样式 prompt="%n@%m %~ "
3、保存并退出配置文件,然后执行以下命令使配置生效:
source ~/.zshrc
安装插件和主题
1、安装oh-my-zsh插件管理器:
git clone git://github.com/zsh-users/oh-my-zsh.git ~/.oh-my-zsh
2、编辑配置文件:
“`vim ~/.oh-my-zsh/custom/themes/your_theme.zsh-theme
将其中的内容替换为你喜欢的主题,"agnoster",保存并退出。 3、安装插件:
cd ~/.oh-my-zsh/custom/plugins/your_plugin_folder/
git pull origin master &> /dev/null && git submodule update –init –recursive &> /dev/null && make install &> /dev/null && cd $OLDPWD &> /dev/null || return $?; source $HOME/.oh-my-zsh/custom/plugins/your_plugin_folder/your_plugin.zsh &> /dev/null && echo "$?" > $HOME/.oh-my-zsh/custom/plugins/your_plugin_folder/return_value.txt; exit $?; return $?; source $HOME/.oh-my-zsh/custom/plugins/your_plugin_folder/your_plugin.zsh &> /dev/null && echo "$?" > $HOME/.oh-my-zsh/custom/plugins/your_plugin_folder/return_value.txt; exit $?; source $HOME/.oh-my-zsh/custom/plugins/your_plugin_folder/your_plugin.zsh &> /dev/null && echo "$?" > $HOME/.oh-my-zsh/custom/plugins/your_plugin_folder/return_value.txt; exit $?; return $?; source $HOME/.oh-my-zsh/custom/plugins/your_plugin_folder/your_plugin.zsh &> /dev/null && echo "$?" > $HOME/.oh-my-zsh/custom/plugins/your_plugin_folder/return_value.txt; exit $?; source $HOME/.oh-my-zsh/custom/plugins/your_plugin_folder/your_plugin.zsh &> /dev/null && echo "$?" > $HOME/.oh-my-zsh/custom/plugins/your_plugin_folder/return_value.txt; exit $?; return $?; source $HOME/.oh-my-zsh/custom/plugins/your_plugin_folder/your_plugin.zsh &> /dev/null && echo "$?" > $HOME/.oh-my-zsh/custom/plugins/your_plugin_folder/return_value.txt; exit $?; source $HOME/.oh-my-zsh/custom/plugins/your_plugin_folder/your_plugin.zsh &> /dev/null && echo "$?" > $HOME/.oh-my-zsh/custom/plugins/your_plugin_folder/return_value.txt; exit $?; source $HOME/.oh-my-zsh/custom/plugins/your_plugin_folder/your_plugin.zsh &> /dev
ull && echo "$?" > $HOME~/.oh-my-zsh/custompluginsyourpluginfolderreturnvalue.txt; exit $?; source $HOME~/.oh-my-zsh/custompluginsyourpluginfolderyourplugin.zsh &> /dev
ull && echo "$?" > $HOME~/.oh-my-zsh/custompluginsyourpluginfolderreturnvalue.txt; exit $?; source $HOME~/.oh-my-zsh/custompluginsyourpluginfolderyourplugin.zsh &> /dev
ull && echo "$?" > $HOME~/.oh-my-zsh/custompluginsyourpluginfolderreturnvalue.txt; exit $?; source $HOME~/.oh-my-zsh/custompluginsyourpluginfolderyourplugin.zsh &> /dev
ull && echo "$?" > $HOME~/.oh-my-zsh/custompluginsyourpluginfolderreturnvalue.txt; exit $?; source $HOME~/.oh-my-zsh/custompluginsyourpluginfolderyourplugin.zsh &> /dev
ull && echo "$?" > $HOME~/.oh-my-zsh/custompluginsyourpluginfolderreturnvalue.txt; exit $?; source $HOME~/.oh-my-zsh/custompluginsyourpluginfolderyourplugin.zsh &> /dev
ull && echo "$?" > $HOME~/.oh-my-zsh/custompluginsyourpluginfolderreturnvalue.txt; exit $?; source $HOME~/.oh-my-zsh/custompluginsyourpluginfolderyourplugin.zsh &> /dev
ull && echo "$?" > $HOME~/.oh-my-zsh/custompluginsyourpluginfolder\return\value\txt;
exit $?; source $HOME\dotfiles\\functions\\utilities\install_themes\\install\01\00\00