zoukankan      html  css  js  c++  java
  • Build a Beautiful oh-my-zsh Themes

    Selection Criteria

    • double line;

    • provide username, hostname, current directory;

    • provide information of git branch and commit status;

    • provide command exit code;

    • prompt is easy to distinguished from command results;

    • optional: provide command order number, current time;

    Customize zsh prompt

    Some important escape sequences in zsh prompt:

    • %n: username;

    • %m: hostname;

    • %~: current directory;

    • %t: current time;

    • %?: return code of last command;

    Customization of font and color see the following demonstration.

    Ref:

    Put it together

    1. Create a new file: ~/.oh-my-zsh/themes/lichao.zsh-theme:

      rc=$reset_color cy=$fg_bold[cyan] bl=$fg_bold[blue] re=$fg_bold[red] wh=$fg_bold[white] ye=$fg_bold[yellow] gr=$fg_bold[green] ma=$fg_bold[magenta]

      ZSH_THEME_GIT_PROMPT_PREFIX="git(" ZSH_THEME_GIT_PROMPT_SUFFIX="):" ZSH_THEME_GIT_PROMPT_CLEAN="✔" ZSH_THEME_GIT_PROMPT_DIRTY="✗" ZSH_THEME_GIT_PROMPT_ADDED="added" ZSH_THEME_GIT_PROMPT_MODIFIED="modified" ZSH_THEME_GIT_PROMPT_DELETED="deleted" ZSH_THEME_GIT_PROMPT_RENAMED="renamed" ZSH_THEME_GIT_PROMPT_UNMERGED="unmerged" ZSH_THEME_GIT_PROMPT_UNTRACKED="untracked"

      PROMPT='$ye%n$rc @ $cy%m $gr%~ $re$(git_prompt_info)$(git_prompt_status)$rc $wh%t$rc ${wh}[%?]${rc} '

    2. Modify "ZSH_THEME" in ~/.zshrc as:

      ZSH_THEME="lichao"

    Recommended Themes

    kphoen: double line, display user, host, CWD, command exit code when it's nonzero, git branch and status, no time, its title line is darker than "ys", but the command and command output is the same;

    ys: double line, display user, host, CWD, time, partial git information, no exit code;

    bureau: double line, display user, host, CWD, time, complete git information, no exit code;

    steeef: double line, display user, host, CWD, complete git information, no exit code;

    rkj: double line, display user, host, CWD, time, command exit code, no git information;

    duellj: double line, display user, host, CWD, command order number, time, no git information;

    some other good themes includes: frisk, candy, blinks

  • 相关阅读:
    delphi 中的异常处理结构
    delphi 获取系统临时文件夹路径
    delphi 之选择文件夹/目录路径的函数SelectDirectory
    delphi DevExpress 系列控件的一点感悟
    delphi 之DevExpress 汉化方法:
    SqlServer 查询表中字段的字段说明:
    delphi数据类型之句柄类型
    Delphi中之PChar, PWideChar, pAnsiChar三种数据类型的一点感悟
    求数值型数组中元素的最大值、最小值、平均值、总和等。
    杨辉三角的实现
  • 原文地址:https://www.cnblogs.com/darkmatter/p/3605595.html
Copyright © 2011-2022 走看看