This commit is contained in:
Sindre Sorhus
2012-09-20 20:16:36 +02:00
commit 62852d7fd1
3 changed files with 53 additions and 0 deletions

24
prompt.zsh Normal file
View File

@@ -0,0 +1,24 @@
# Pure
# by Sindre Sorhus
# https://github.com/sindresorhus/pure/
# MIT License
local default_username='sindresorhus'
# Only show username if not default
username() {
if [ $USER != $default_username ]; then echo '%n@%m '; fi
}
git_branch() {
echo `git symbolic-ref --short -q HEAD 2>/dev/null`
}
precmd() {
print -P '\n%F{blue}%~%f %F{236}`git_branch` `username`%*%f'
}
# Turns the prompt red if the last command exited with 0
PROMPT='%(?.%F{magenta}.%F{red})%f '
# Can be disabled:
# PROMPT='%F{magenta}%f '

29
readme.md Normal file
View File

@@ -0,0 +1,29 @@
# Pure
Minimal and fast ZSH prompt
![screenshot](https://raw.github.com/sindresorhus/pure/master/screenshot.png)
## Overview
Most prompts are ugly, cluttered and slow. I wanted something visually pleasing that stayed out of my way.
Pure only shows the current user if it's not the default. It shows the current git branch, but not dirty status since that is awfully slow. And the prompt symbol turns red if the last command exited with 0.
## Getting Started
- Download or git submodule it into your dotfiles folder
- In your `.zshrc` add `. prompt.zsh`
- Add your username to the `default_username` variable
## Tip
[Tomorrow Night](https://github.com/chriskempson/tomorrow-theme) theme with the [Droid Sans Mono](http://www.google.com/webfonts/specimen/Droid+Sans+Mono) font (15pt) is a beautiful combination, as seen in the screenshot above.
## License
[MIT License](http://en.wikipedia.org/wiki/MIT_License)
(c) [Sindre Sorhus](http://sindresorhus.com)

BIN
screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB