ubuntu18.04安装zsh+oh-my-zsh

ubuntu18.04安装zsh+oh-my-zsh

1. 安装zsh,并修改默认shell为zsh

# 安装curl, zsh
apt install curl zsh -y
# 修改默认shell为zsh
chsh -s /bin/zsh

2. 修改密码配置文件

  • 搜索bash, 替换为zsh
vim /etc/passwd

3. 安装git和oh-my-zsh

# 安装git
apt-get install git -y
# 下载oh-my-zsh(码云)
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

4. 安装显示历史输入提示

# 下载插件
git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
# 修改配置plugin中添加下载的插件
vim ~/.zshrc

plugins=(git docker docker-compose history history-substring-search node npm wd web-search last-working-dir zsh-autosuggestions vi-mode)

ubuntu18.04安装zsh+oh-my-zsh_第1张图片

  • 灰色部分就是提示
    ubuntu18.04安装zsh+oh-my-zsh_第2张图片

你可能感兴趣的:(Shell,Liunx,bash,git,linux)