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 ...
随机推荐
- 《手把手教你》系列技巧篇(七)-java+ selenium自动化测试-宏哥带你全方位吊打Chrome启动过程(详细教程)
1.简介 经过前边几篇文章和宏哥一起的学习,想必你已经知道了如何去查看Selenium相关接口或者方法.一般来说我们绝大多数看到的是已经封装好的接口,在查看接口源码的时候,你可以看到这个接口上边的注释 ...
- SpringCloud:Eureka 配置心跳机制
Server服务端 server: port: 8761 eureka: client: #实例是否在eureka服务器上注册自己的信息以提供其他服务发现,默认为true re ...
- 第八章 - JUC
J.U.C AQS 原理 全称是 AbstractQueuedSynchronizer,是阻塞式锁和相关的同步器工具的框架 特点: 用 state 属性来表示资源的状态(分独占模式和共享模式),子类需 ...
- Linux:从windows到linux的shell脚本编码和格式
从windows到linux的shell脚本编码和格式问题 异常问题 :set ff=unix 启动脚本在启动时报错比如执行sh start.sh,时会报Command not found等等的错误, ...
- abp知识
领域驱动开发的特点:1.分层更多,前期代码量大,后期维护方便2.业务进行了专业的领域划分,业务逻辑更加清晰,便于业务扩展.3.代码工程高内聚,更加精简.4.主要是解决复杂业务逻辑编写问题 为什么要使用 ...
- C语言:获取汉字的编码
#include <stdio.h> #include <locale.h> #include <wchar.h> int main() { setlocale(L ...
- python使用selenium,webdriver自动下载百度网盘内容
想实现一个自动下载微信公众号分享百度网盘图片链接的爬虫,使用selenium和火狐的webdriver进行完成 1.首先根据自己的浏览器下载相应的webdriver驱动器,python中导入selen ...
- Python+API接口测试框架设计(pytest)
1.测试框架简介 整个接口测试框架的设计图如下: base:存放的是请求方法二次封装 common:存放的是自定义工具,操作excel,yaml文件等 data:存放的是公共动态数据,如data.xl ...
- spring-1-spring介绍和IOC容器开发
一.介绍 1.版本 2.下载(jar包依赖) 下载 所以搜索:https://repo.spring.io/release/org/springframework/spring/ 文件分配 maven ...
- LCT(Link-Cut-Tree)
LCT(Link-Cut-Tree) LCT维护一个森林,即把每个节点用splay维护,可以进行许多操作: 查询.修改链上的信息 随意指定原树的根(即换根) 动态连边.删边 合并两棵树.分离一棵树 动 ...