bc67b8693b40b9a5e7fabb55d96a725007e7c068
- Author
- Pavle Portic <pavle.portic@tilda.center>
- Committer
- Pavle Portic <pavle.portic@tilda.center>
- Date
Message
Diff
This diff is truncated to protect this page.
1diff --git a/boban.zsh-theme b/boban.zsh-theme
2new file mode 100644
3index 0000000000000000000000000000000000000000..c094c82d0d22ff75a3a79d23e342e31a05f578bc
4--- /dev/null
5+++ b/boban.zsh-theme
6@@ -0,0 +1,227 @@
7+# vim:ft=zsh ts=2 sw=2 sts=2
8+#
9+# agnoster's Theme - https://gist.github.com/3712874
10+# A Powerline-inspired theme for ZSH
11+#
12+# # README
13+#
14+# In order for this theme to render correctly, you will need a
15+# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts).
16+# Make sure you have a recent version: the code points that Powerline
17+# uses changed in 2012, and older versions will display incorrectly,
18+# in confusing ways.
19+#
20+# In addition, I recommend the
21+# [Solarized theme](https://github.com/altercation/solarized/) and, if you're
22+# using it on Mac OS X, [iTerm 2](http://www.iterm2.com/) over Terminal.app -
23+# it has significantly better color fidelity.
24+#
25+# # Goals
26+#
27+# The aim of this theme is to only show you *relevant* information. Like most
28+# prompts, it will only show git information when in a git working directory.
29+# However, it goes a step further: everything from the current user and
30+# hostname to whether the last call exited with an error to whether background
31+# jobs are running in this shell will all be displayed automatically when
32+# appropriate.
33+
34+### Segment drawing
35+# A few utility functions to make it easy and re-usable to draw segmented prompts
36+
37+CURRENT_BG='NONE'
38+DEFAULT_USER='pavle'
39+
40+# Special Powerline characters
41+
42+() {
43+ local LC_ALL="" LC_CTYPE="en_US.UTF-8"
44+ # NOTE: This segment separator character is correct. In 2012, Powerline changed
45+ # the code points they use for their special characters. This is the new code point.
46+ # If this is not working for you, you probably have an old version of the
47+ # Powerline-patched fonts installed. Download and install the new version.
48+ # Do not submit PRs to change this unless you have reviewed the Powerline code point
49+ # history and have new information.
50+ # This is defined using a Unicode escape sequence so it is unambiguously readable, regardless of
51+ # what font the user is viewing this source code in. Do not replace the
52+ # escape sequence with a single literal character.
53+ # Do not change this! Do not make it '\u2b80'; that is the old, wrong code point.
54+ SEGMENT_SEPARATOR=$'\ue0b0'
55+ RIGHT_SEPARATOR=$'\ue0b3'
56+}
57+
58+# Begin a segment
59+# Takes two arguments, background and foreground. Both can be omitted,
60+# rendering default background/foreground.
61+prompt_segment() {
62+ local bg fg
63+ [[ -n $1 ]] && bg="%K{$1}" || bg="%k"
64+ [[ -n $2 ]] && fg="%F{$2}" || fg="%f"
65+ if [[ $CURRENT_BG != 'NONE' && $1 != $CURRENT_BG ]]; then
66+ echo -n " %{$bg%F{$CURRENT_BG}%}$SEGMENT_SEPARATOR%{$fg%} "
67+ else
68+ echo -n "%{$bg%}%{$fg%} "
69+ fi
70+ CURRENT_BG=$1
71+ [[ -n $3 ]] && echo -n $3
72+}
73+
74+# End the prompt, closing any open segments
75+prompt_end() {
76+ if [[ -n $CURRENT_BG ]]; then
77+ echo -n " %{%k%F{$CURRENT_BG}%}$SEGMENT_SEPARATOR"
78+ else
79+ echo -n "%{%k%}"
80+ fi
81+ echo -n "%{%f%}"
82+ CURRENT_BG=''
83+}
84+
85+# Begin the right prompt
86+prompt_endr() {
87+ echo -n " %{%k%F{grey}%}$RIGHT_SEPARATOR"
88+ echo -n "%{%f%}"
89+ CURRENT_BG=''
90+}
91+
92+### Prompt components
93+# Each component will draw itself, and hide itself if no information needs to be shown
94+
95+# Context: user@hostname (who am I and where am I)
96+prompt_context() {
97+ if [[ "$USER" != "$DEFAULT_USER" || "$SSH_CLIENT" ]]; then
98+ prompt_segment black default "%(!.%{%F{yellow}%}.)$USER@%m"
99+ fi
100+}
101+
102+# Git: branch/detached head, dirty status
103+prompt_git() {
104+
105+ local PL_BRANCH_CHAR