cd
命令 颜色高亮显示, 后面灰色的tessera
目录为上次输入过的目录,按➡️直接填充虚拟终端,兼容bash
chsh -s /bin/zsh
如果想还原回去执行chsh -s /bin/bash
即可
sudo apt install zsh
chsh -s /bin/zsh
基于zsh命令行,是对zsh的包装,提供了主题配置,插件机制.
curl
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
wget
sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
zsh使用最多的主题
git clone https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k
编辑 ~/.zshrc
设置 ZSH_THEME="powerlevel10k/powerlevel10k".
再增加一行配置:POWERLEVEL9K_MODE="awesome-patched"
apt-get install fonts-powerline
https://github.com/powerline/fonts/blob/master/SourceCodePro/Source%20Code%20Pro%20for%20Powerline.otf
https://github.com/Falkor/dotfiles/blob/master/fonts/SourceCodePro%2BPowerline%2BAwesome%2BRegular.ttf
打开下载的字体,然后按“安装字体”。
在iTerm2中设置字体(Preperence->Profiles->Text→Change Font),选择Source Code Pro + Font Awesome
,大小18,最好对“字体”和“非ASCII字体”都进行设置。重新启动iTerm2,以使所有更改生效.
source ~/.zshrc
或者执行下面的命令,重新配置
p10k configure
开始配置Powerlevel10k,根据提示(喜好)选择1234或yes、no
下载主题:https://iterm2colorschemes.com
Preperence->Profiles->Colors->color Presets,点击import,选择刚解压的目录,点击目录下的schemes,选择你想要导入的主题(可多选全部导入),导入后选择自己喜欢的主题,这里我选择了ubuntu主题
下载插件
git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
编辑 ~/.zshrc
,设置plugins
plugins=(zsh-autosuggestions git)
使插件生效
source ~/.zshrc
上次敲过的命令 ,会自动提示,按右方向键➡️确认填充上次的命令
下载插件
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting
写入到配置
echo "source $ZSH_CUSTOM/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc
使插件生效
source ~/.zshrc
命令会自动高亮显示