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:
"3.9 Customizing the prompt" on zsh on archlinux
Put it together
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} '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的更多相关文章
- [poj1113][Wall] (水平序+graham算法 求凸包)
Description Once upon a time there was a greedy King who ordered his chief Architect to build a wall ...
- 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 ...
- POJ 1113:Wall
原文链接:https://www.dreamwings.cn/poj1113/2832.html Wall Time Limit: 1000MS Memory Limit: 10000K Tota ...
- hdu 1348 Wall (凸包)
Wall Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submis ...
- 彩色的Shell
我常在命令行下工作,以前老被同事说"你整天在那个黑窗口上倒腾什么?" 现在这个问题变成了"你这个花花绿绿的窗口是什么东西?" 其实都是同一个东西:一个兼容于xterm的终端窗口,要么是PuTTY/Ki ...
- 计算几何--求凸包模板--Graham算法--poj 1113
Wall Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 28157 Accepted: 9401 Description ...
- poj 1113:Wall(计算几何,求凸包周长)
Wall Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 28462 Accepted: 9498 Description ...
- 【POJ】1113 Wall(凸包)
http://poj.org/problem?id=1113 答案是凸包周长+半径为l的圆的周长... 证明?这是个坑.. #include <cstdio> #include <c ...
- Wall(凸包POJ 1113)
Wall Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 32360 Accepted: 10969 Description On ...
随机推荐
- Gym 100283F Bakkar In The Army
数学公式: n^2的前n项和n(n+1)(2*n+1)/6,用二分进行查找: 算出层数后继续二分查找位于这一层的哪一位,也可以推出相应公式 #include <iostream> #inc ...
- linux 退出状态码
状态码 描述 0 命令成功结束 1 一般性未知错误 2 不适合的shell 命令 123 命令不可执行 127 没找到命令 128 无效退出参数 128+x 与linux信号x相关的严重错误 130 ...
- PHP中“简单工厂模式”实例讲解(转)
? 1 2 3 4 5 6 7 8 原创文章,转载请注明出处:http://www.cnblogs.com/hongfei/archive/2012/07/07/2580776.html 简单 ...
- linux学习之路第八天(linux文件权限详解)
建议和我上一篇博客一起通读,效果更加 1.权限的基本介绍 通过一张图片解决疑惑(重点) rwx权限详解 rwx作用到文件 1)[r]代表可读(read) :可以读取,查看 2)[w]代表可写(writ ...
- ADO.NET整理 [转]
虽然我们都知道ADO.NET是对数据库的操作,但是要真的说出ADO.NET的具体含义还不是很容易. ADO.NET是ActiveX Data Objects的缩写,它是一个COM组件库,用于在micr ...
- ZooKeeper 分布式锁 Curator 源码 01:可重入锁
前言 一般工作中常用的分布式锁,就是基于 Redis 和 ZooKeeper,前面已经介绍完了 Redisson 锁相关的源码,下面一起看看基于 ZooKeeper 的锁.也就是 Curator 这个 ...
- ARTS第五周
-第五周.这两周在复习大学里的课程,发现当时觉得课上很多看不懂的,现在看起来轻松多了,也带来了新的感悟. 1.Algorithm:每周至少做一个 leetcode 的算法题2.Review:阅读并点评 ...
- 算法leetcode二分算法
二分算法通常用于有序序列中查找元素: 有序序列中是否存在满足某条件的元素: 有序序列中第一个满足某条件的元素的位置: 有序序列中最后一个满足某条件的元素的位置. 思路很简单,细节是魔鬼. 一.有序序列 ...
- spring-1-spring介绍和IOC容器开发
一.介绍 1.版本 2.下载(jar包依赖) 下载 所以搜索:https://repo.spring.io/release/org/springframework/spring/ 文件分配 maven ...
- 简单快速安装Apache+PHP+MySql服务环境(二)—— centos使用yum安装php5.6
使用默认方式yum install php安装的php版本为5.4,在使用某些PHP框架的时候可能会有问题,所以需要安装高版本的PHP. 通过yum list php*查看是否有自己需要安装的版本,如 ...