💠

💠 2024-11-14 23:33:08


Zsh

arch zsh wiki

为什么要使用

终极 Shell——ZSH 某人的配置

Github: Zsh 开发指南

  • 提供较为强大的历史命令match功能
  • 较为丰富的扩展实现
  • 更现代化的支持 更多语言,unicode字符

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 进行配置
1
2
3
    plugins=(
        git mvn docker
    )

mac 装了 oh my zsh 后比用 bash 具体好在哪儿?

插件

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

  • 个人常用 git gitfast docker kubectl sudo colored-man-pages systemd emoji dotenv

主题

官网主题列表

额外主题列表

  • 推荐 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

1
2
3
4
5
6
7
    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 源码