Mac 安装 oh-my-zsh + autojump + zsh-autosuggestions + zsh-syntax-highlighting + zsh-completions + solarized 配色

平凡
2019-01-11 16:19:24
835 阅读

查看Mac上已有的shell

cat /etc/shells

/bin/bash
/bin/csh
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh

将默认shell改成zsh

chsh -s /bin/zsh

安装oh my zsh

git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc

配置zsh

vim ~/.zshrc

ZSH_THEME="ys"
plugins=(git brew laravel5)

shell solarized 配色

git clone https://github.com/altercation/solarized.git
# 然后打开 solarized/osx-terminal.app-colors-solarized/Solarized Dark ansi.terminal 配置文件

安装 autojump 插件

brew install autojump # 确保有 brew 命令

编辑 ~/.zshrc 文件

vim ~/.zshrc

plugins=(git brew laravel5 autojump)
[[ -s $(brew --prefix)/etc/profile.d/autojump.sh ]] && . $(brew --prefix)/etc/profile.d/autojump.sh

安装 zsh-autosuggestions 插件

克隆源码

git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

编辑 ~/.zshrc 文件

vim ~/.zshrc

plugins=(git brew laravel5 autojump zsh-autosuggestions)

安装 zsh-syntax-highlighting 插件

克隆源码

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

编辑 ~/.zshrc 文件

vim ~/.zshrc

plugins=(git brew laravel5 autojump zsh-autosuggestions zsh-syntax-highlighting)

安装 zsh-completions 插件

克隆源码

git clone https://github.com/zsh-users/zsh-completions ~/.oh-my-zsh/custom/plugins/zsh-completions

编辑 ~/.zshrc 文件

vim ~/.zshrc

plugins=(git brew laravel5 autojump zsh-autosuggestions zsh-syntax-highlighting zsh-completions)
autoload -U compinit && compinit

安装 spaceship 主题

克隆源码

git clone https://github.com/denysdovhan/spaceship-prompt.git "$ZSH_CUSTOM/themes/spaceship-prompt"
ln -s "$ZSH_CUSTOM/themes/spaceship-prompt/spaceship.zsh-theme" "$ZSH_CUSTOM/themes/spaceship.zsh-theme"

编辑 ~/.zshrc 文件

vim ~/.zshrc

ZSH_THEME="spaceship"
source ~/.zshrc
2
4 评论
  • comment-avatar

    维生素

    • 回复
    comment-avatar

    ???

    • 回复
    comment-avatar

    试试

    • 回复
    comment-avatar

    瞬间温暖

    • 回复
  • comment-avatar

    ***

    • 回复
  • comment-avatar

    哈哈

    • 回复
  • comment-avatar

    哈哈哈哈

    • 回复