commit 62852d7fd19acde2c9f1404fb9a7b97a85d6defd Author: Sindre Sorhus Date: Thu Sep 20 20:16:36 2012 +0200 init diff --git a/prompt.zsh b/prompt.zsh new file mode 100644 index 0000000..d2f9d69 --- /dev/null +++ b/prompt.zsh @@ -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 ' diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..3aa5d0d --- /dev/null +++ b/readme.md @@ -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) diff --git a/screenshot.png b/screenshot.png new file mode 100644 index 0000000..682bdd2 Binary files /dev/null and b/screenshot.png differ