Mac安装终端插件Oh my zsh

2019-05-30  本文已影响0人  sy随缘
  1. 安装oh my zsh

sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

  1. 主题配置

cd ~

vi .zshrc

##替换文件中的PROMPT部分为以下部分,来更换命令行中光标之前的目录文案和配色
PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p%{$fg[cyan]%}%d %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}% %{$reset_color%}>'
#PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
  1. 插件配置

vi .zshrc

下面是自己常用的插件
plugins=(git autojump osx mvn gradle brew node npm)

  1. 插件安装

  * 描述:一个快捷导航文件系统的工具

  * 安装,未安装homebrew的可以先安装homebrew(官网)

brew install autojump

  * 安装成功后,在zsh的总配置文件的最后一行添加如下命令

[[ -s ~/.autojump/etc/profile.d/autojump.sh ]] && . ~/.autojump/etc/profile.d/autojump.sh
  * 将autojump插件配置到zsh的插件中

  * 在命令行直接使用命令 j 目录名

  * Github: https://github.com/zsh-users/zsh-autosuggestions

上一篇 下一篇

猜你喜欢

热点阅读