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

Build a Beautiful oh-my-zsh Themes的更多相关文章

  1. [poj1113][Wall] (水平序+graham算法 求凸包)

    Description Once upon a time there was a greedy King who ordered his chief Architect to build a wall ...

  2. 7 Must Read Python Books

    7 Must Read Python Books I started learning Python just two years ago. Coming from a C++ and Java ba ...

  3. POJ 1113:Wall

    原文链接:https://www.dreamwings.cn/poj1113/2832.html Wall Time Limit: 1000MS   Memory Limit: 10000K Tota ...

  4. hdu 1348 Wall (凸包)

    Wall Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submis ...

  5. 彩色的Shell

    我常在命令行下工作,以前老被同事说"你整天在那个黑窗口上倒腾什么?" 现在这个问题变成了"你这个花花绿绿的窗口是什么东西?" 其实都是同一个东西:一个兼容于xterm的终端窗口,要么是PuTTY/Ki ...

  6. 计算几何--求凸包模板--Graham算法--poj 1113

    Wall Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 28157   Accepted: 9401 Description ...

  7. poj 1113:Wall(计算几何,求凸包周长)

    Wall Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 28462   Accepted: 9498 Description ...

  8. 【POJ】1113 Wall(凸包)

    http://poj.org/problem?id=1113 答案是凸包周长+半径为l的圆的周长... 证明?这是个坑.. #include <cstdio> #include <c ...

  9. Wall(凸包POJ 1113)

    Wall Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 32360 Accepted: 10969 Description On ...

随机推荐

  1. CRM客户管理系统哪个好用

    当企业管理者在进行CRM系统的选型时,面对搜索引擎上五花八门的结果和各式各样的广告,一定会有这样的疑惑:CRM客户管理系统到底哪个好用?抛开网上那些为了广告效果而"夸张"出的优点, ...

  2. Hibernate框架(二)POJO对象的操作

    POJO对象其实就是我们的实体,这篇博客总结一下框架对POJO对象对应数据库主键的生成策略,和一些对POJO对象的简单增删改查的操作. 一,Hibernate框架中主键的生成策略有三种方式: 1,数据 ...

  3. Linux平台安装MongoDB(转)

      一.下载完安装包,并解压 tgz(以下演示的是 64 位 Linux上的安装) . curl -O https://fastdl.mongodb.org/linux/mongodb-linux-x ...

  4. 获取操作系统OS等相关信息

    问题一:Windows SDK 8.1版本中的VersionHelper.h文件当中没有IsWindows10ORGreater,所以当你用IsWindows8Point1ORGreater判断出版本 ...

  5. CF277E Binary Tree on Plane

    CF277E Binary Tree on Plane 题目大意 给定平面上的 \(n\) 个点,定义两个点之间的距离为两点欧几里得距离,求最小二叉生成树. 题解 妙啊. 难点在于二叉的限制. 注意到 ...

  6. c语言:结果不理解

    #include <stdio.h> int main() { int a;float b; scanf("a=%d,b=%f",&a,&b); pri ...

  7. Intellij idea 设置关闭自动更新

    目录结构: File -> Settings- -> Appearance & Behavior -> System Settings -> Updates 把Auto ...

  8. [刘阳Java]_步步窥探JS变量作用域

    今天的这个文章题目名称甚是让人会突发异想.JS变量作用域是务必需要搞懂的,单从面试过程就会让面试者烧脑壳.所以,我们还是写一篇关于JS变量作用域的技术专题,让所有小伙伴能够借此文章去整理JS的基础学习 ...

  9. WLS中Linux与Windows间的环境共享

    Reference 更多cmd.exe帮助参考 (cmd_helps)[https://ss64.com/nt/cmd.html] (WSL备份,windows Docker安装)[https://w ...

  10. 关于hashcode和equals方法说明

    一.前言 我们都知道,要比较两个对象是否相等时需要调用对象的equals()方法,即判断对象引用所指向的对象地址是否相等,对象地址相等时,那么与对象相关的对象句柄.对象头.对象实例数据.对象类型数据等 ...