• Mac配置iTerm样式终端


    一、MacOs系统

    MacOs中终端使用iTerm2

    1. 配置oh-my-zsh

    oh my zsh 的地址: https//github.com/ohmyzsh/ohmyzsh

    插件存放位置:~/.oh-my-zsh/plugins    下载常用的插件

    git clone http://github.com/zsh-users/zsh-syntax-highlighting.git

    修改配置文件

    1. vim ~/.zshrc
    2. plugins=(git zsh-syntax-highlighting)

    生效配置

    source ~/.zshrc

    2. 配置字体

    安装字体

    1. brew tap homebrew/cask-fonts
    2. brew cask install font-hack-nerd-font

    ITerm2中配置字体:

    iTerm2 > Preferences > Profiles > Text   配置Font

    3. 配置powerlevel10

    1. cd ~/.oh-my-zsh/themes
    2. git clone --depth=1 https://github.com/romkatv/powerlevel10k.git powerlevel10k

    ~/.zshrc配置文件中的主题设置为powerlevel10k

    ZSH_THEME="powerlevel10k/powerlevel10k"

    配置显示的样式

    1. p10k configure
    2. 跟随指示选择就好

    4. 配置colorls

    安装ruby,ruby的版本需要为2.7以上,使用ruby2.6无法安装colorls

    brew install ruby

    配置ruby环境变量

    1. 编辑文件
    2. vim ~/.zshrc
    3. 把这个配置放到zshrc里面
    4. export PATH="/usr/local/Cellar/ruby/2.7.2/bin:$PATH"
    5. 然后输入一下代码启动
    6. source ~/.zshrc

    查看ruby的版本

    ruby --version

    安装colorls

    1. sudo gem install colorls -n /usr/local/bin
    2. 如果安装这个之后出现了warning 那就跟warning报错的路径设置权限
    3. sudo chmod 755 /opt/homebrew/sbin

    配置~/.zshrc

    1. vim ~/.zshrc
    2. source $(dirname $(gem which colorls))/tab_complete.sh
    3. alias ll='colorls -lA --sd --gs --group-directories-first'
    4. alias ls='colorls --group-directories-first'
    5. alias lc='colorls' # Colorls with no options
    6. alias l='colorls -l --sort-dirs' # List
    7. #alias ll='colorls -lA --git-status --sort-dirs' # List, show almost all files (excludes ./ and ../)
    8. alias la='colorls -la --sort-dirs' # List, show all files
    9. alias lt='colorls -lt --git-status' # List, sort by modification time (newest first)
    10. alias lS='colorls -lS --git-status' # List, sort by size (largest first)
    11. alias lr='colorls --tree=5' # Show tree heirarchy, capped at depth 5 just in case
    12. alias lx='colorls -lAX --git-status' # List, Sort by file type

    5. 最终结果

    6.配置文件~/.zshrc 完整内容

    1. ZSH_DISABLE_COMPFIX=true
    2. export ZSH="/Users/juejieli/.oh-my-zsh"
    3. #ZSH_THEME="robbyrussell"
    4. #ZSH_THEME="cloud"
    5. ZSH_THEME="powerlevel10k/powerlevel10k"
    6. #ZSH_THEME="agonster"
    7. POWERLEVEL9K_MODE='nerdfont-complete'
    8. plugins=(git zsh-syntax-highlighting)
    9. source $ZSH/oh-my-zsh.sh
    10. # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
    11. export PATH="/usr/local/Cellar/ruby/2.7.2/bin:$PATH"
    12. [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
    13. alias ll='colorls -lA --sd --gs --group-directories-first'
    14. alias ls='colorls --group-directories-first'
    15. alias lc='colorls' # Colorls with no options
    16. alias l='colorls -l --sort-dirs' # List
    17. #alias ll='colorls -lA --git-status --sort-dirs' # List, show almost all files (excludes ./ and ../)
    18. alias la='colorls -la --sort-dirs' # List, show all files
    19. alias lt='colorls -lt --git-status' # List, sort by modification time (newest first)
    20. alias lS='colorls -lS --git-status' # List, sort by size (largest first)
    21. alias lr='colorls --tree=5' # Show tree heirarchy, capped at depth 5 just in case
    22. alias lx='colorls -lAX --git-status' # List, Sort by file type
    23. source $(dirname $(gem which colorls))/tab_complete.sh
  • 相关阅读:
    【KingbaseES】sys_dump命令详解及示例
    Django事务确保数据一致性
    基于taro搭建小程序多项目框架
    Nginx_day02_Nginx进阶篇_静态资源部署
    2023秋招—大数据开发面经—闻泰科技
    微服务讲解
    React + Typescript领域初学者的常见问题和技巧
    附近的人(使用<GeoHash>经纬度查询附近的人,并根据距离排序)
    [python 刷题] 287 Find the Duplicate Number
    Arduino框架下轻量级ssd1306 I2C屏幕驱动库
  • 原文地址:https://blog.csdn.net/weixin_45925028/article/details/133171123