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
最新文章
- 转的: 重绘ListView 修改标题颜色
- [SharePoint] SharePoint 错误集 3
- Git 怎样保证fork出来的project和原project(上游项目)同步更新
- spring配置详解
- 大型网站的 HTTPS 实践(四)——协议层以外的实践
- SQLite 删除表(http://www.w3cschool.cc/sqlite/sqlite-drop-table.html)
- 《DenseNet Models for Tiny ImageNet Classification》课程设计论文
- 重定向printf
- 揭秘IT人才特点:中美印日四国程序员比较
- sublime text3 批量查找替换文件夹或项目中的字符
- odoo 开发基础 -- 视图之xpath语法
- 《网路对抗》Exp8 WEB基础实践
- play framework系列之maven 构建
- tableView删除功能小记
- 关于不同应用程序存储IO类型的描述
- zabbix_get :command not found 解决办法
- 解决 command not found: express
- WPF-MVVM学习心德(WinForm转WPF心德)
- greenplum导数据
- Problem J: 求方程的解——C语言初学者百题大战之十五