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. AcWing 1134. 最短路计数

    给出一个n个顶m 条边的无向无权图,顶点编号为 1 到 n.N. 问从顶点 1开始,到其他每个点的最短路有几条. #include<bits/stdc++.h> #define N 100 ...

  2. python logger 动态设置日志名

    代码: import logging logger = logging.getLogger('') logger.setLevel(level=logging.INFO) def setLogName ...

  3. 看看PHP迭代器的内部执行过程(转)

      1 class myIterator implements Iterator { 2 private $position = 0; 3 private $array = array( 4 &quo ...

  4. buu crypto 幂数加密

    一.这和二进制幂数加密有些不同,可以从数字大小判断出来,超过4了,一般4以上已经可以表达出31以内了,所以是云影密码,以0为分隔符,01248组成的密码 二.python代码解密下 code=&quo ...

  5. ROS2学习之旅(12)——创建工作空间

    workspace(工作空间)是包含ROS2 packages(包)的文件夹.在使用ROS 2之前,有必要在终端中source一下ROS 2的安装工作区,这样就可以在该终端中使用ROS 2的软件包. ...

  6. ES6新增语法(一)——let、const、var的区别

    ES6简介 ES6是ECMAScript 6.0的简称,是javascript语言的下一代标准,已经在2015年6月正式发布上线.目的就是为了统一javascript的语法标准,可以用来开发大型应用程 ...

  7. selenium3 + python - js&jquery操作处理

    # 推荐学习:https://www.w3school.com.cn/js/index.asp## 下面以简书登录&注册定位元素为例"""js定位 id name ...

  8. sync/fsync/fdatasync的简单比较

    此文主要转载自 http://blog.csdn.net/zbszhangbosen/article/details/7956558 官网上有关于MySQL的flush method的设置参数说明,但 ...

  9. 【LeetCode】142. 环形链表 II

    142. 环形链表 II 知识点:链表:set:快慢指针 题目描述 给定一个链表,判断链表中是否有环. 给定一个链表,返回链表开始入环的第一个节点. 如果链表无环,则返回 null. 为了表示给定链表 ...

  10. bootstrap与vue的区别是什么?(十七)

    Bootstrap Bootstrap是美国Twitter公司的设计师Mark Otto和Jacob Thornton合作基于HTML.CSS.JavaScript 开发的简洁.直观.强悍的前端开发框 ...