Skip to content
kcp edited this page Nov 21, 2020 · 3 revisions

title: Zsh date: 2018-12-15 12:06:10 tags: - Shell categories: - Linux

目录 start

  1. Zsh
    1. 为什么要使用
    2. Tips
    3. oh-my-zsh
      1. 插件
      2. 主题
        1. 自己定制

目录 end|2020-11-05 16:05|


Zsh

arch zsh wiki

为什么要使用

mac 装了 oh my zsh 后比用 bash 具体好在哪儿?
终极 Shell——ZSH

某人的配置

Tips

  • 数组使用 list=(a b c); for i in $list; do echo $i; done

oh-my-zsh

Github
关于PS1环境变量的折腾 因为含特殊字符GitBook构建通不过,只能放出去了

  1. 安装好 zsh wget git
  2. sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
  3. vi ~/.zshrc 进行配置
    plugins=(
        git mvn docker
    )

插件

wiki: plugins
zsh oh-my-zsh 插件推荐

  • 个人常用 git gitfast mvn gradle golang docker kubectl sudo

主题

官网主题列表

  • 自带主题: amuse clean wedisagree, muse也还好,就是没时间

额外主题列表

  • 推荐 powerlevel10k 性能强劲,交互式配置

    • Github
    • install nerd-fonts-meslo-lg
  • powerlevel9k

    • Github Doc
    • git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k
    • powerlevel9k/powerlevel9k
  • Bullet Train 桌面在用 bullet-train

    wget https://raw.githubusercontent.com/caiogondim/bullet-train.zsh/master/bullet-train.zsh-theme -O /home/kcp/.oh-my-zsh/custom/themes

    wget https://github.com/powerline/powerline/raw/develop/font/PowerlineSymbols.otf
    wget https://github.com/powerline/powerline/raw/develop/font/10-powerline-symbols.conf
    mv PowerlineSymbols.otf ~/.local/share/fonts/
    fc-cache -vf ~/.local/share/fonts/
    mv 10-powerline-symbols.conf ~/.config/fontconfig/conf.d/

安装步骤

  1. mkdir $ZSH_CUSTOM/themes/
  2. wget http://raw.github.com/caiogondim/bullet-train-oh-my-zsh-theme/master/bullet-train.zsh-theme
  3. config .zshrc to ZSH_THEME="bullet-train"

自己定制

Github doc

基于muse的主题 用在服务器上挺好

~/.oh-my-zsh/custom/themes/muse-myth.zsh-theme 源码

Summary

Clone this wiki locally