Install Zsh from source
依赖
1 | # sudo apt-get install libncurses-dev |
安装
1 | # 可能遇到证书错误,需要手动下载,scp传上去,mobaxterm传输也会抽风 |
Oh my zsh
1 | wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh |
主题安装
默认主题是agnoster
,修改.zshrc
文件,将ZSH_THEME="agnoster"
改为ZSH_THEME="chivier"
。
配置文件很简单,存放在~/.oh-my-zsh/themes/chivier.zsh-theme
1 | #PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' |
插件安装
先把两个装了
1 | git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions |
修改.zshrc
加上plugins=(zsh-syntax-highlighting zsh-autosuggestions)
语法正确性高亮
zsh-syntax-highlighting 能在输入命令时用红色和绿色来显示语法错误(命令或者路径是否存在)。
命令补齐
zsh-autosuggestions 会基于zsh_history来预测出下一个命令。
zshrc常见配置
1 | alias l='ls -al --color=auto' |
参考文献
Install Zsh from source
http://icarus.shaojiemike.top/2024/12/07/Work/Programming/1-env/terminal/zsh/